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

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