Code Duplication    Length = 12-17 lines in 2 locations

src/Runner.php 1 location

@@ 59-75 (lines=17) @@
56
     * @param string $entry
57
     * @return Closure|false
58
     */
59
    private function getMiddleware($entry)
60
    {
61
        // If entry is empty return handler
62
        if (!$entry) {
63
            return $this->handler;
64
        }
65
66
        try {
67
            if (substr($entry, 0, 1) === '#') {
68
                return $this->container->getService(substr($entry, 1));
69
            }
70
71
            return $this->container->getByType($entry);
72
        } catch (MissingServiceException $e) {
73
            return false;
74
        }
75
    }
76
}
77

src/Api.php 1 location

@@ 188-199 (lines=12) @@
185
     * @param string $entry
186
     * @return bool|object
187
     */
188
    private function getFromContainer($entry)
189
    {
190
        try {
191
            if (substr($entry, 0, 1) === '#') {
192
                return $this->container->getService(substr($entry, 1));
193
            }
194
195
            return $this->container->getByType($entry);
196
        } catch (MissingServiceException $e) {
197
            return false;
198
        }
199
    }
200
}
201