Code Duplication    Length = 13-15 lines in 2 locations

lib/Injector.php 2 locations

@@ 228-242 (lines=15) @@
225
     *                            See https://github.com/rdlowrey/atreyu#injecting-for-execution
226
     * @return self
227
     */
228
    public function prepare($name, $callableOrMethodStr)
229
    {
230
        if ($this->isExecutable($callableOrMethodStr) === false) {
231
            throw InjectionException::fromInvalidCallable(
232
                $this->inProgressMakes,
233
                self::E_INVOKABLE,
234
                $callableOrMethodStr
235
            );
236
        }
237
238
        list(, $normalizedName) = $this->resolveAlias($name);
239
        $this->prepares[$normalizedName] = $callableOrMethodStr;
240
241
        return $this;
242
    }
243
244
    private function isExecutable($exe)
245
    {
@@ 540-552 (lines=13) @@
537
        return $this->make($class, $definition);
538
    }
539
540
    private function buildArgFromDelegate($paramName, $callableOrMethodStr)
541
    {
542
        if ($this->isExecutable($callableOrMethodStr) === false) {
543
            throw InjectionException::fromInvalidCallable(
544
                $this->inProgressMakes,
545
                $callableOrMethodStr
546
            );
547
        }
548
549
        $executable = $this->buildExecutable($callableOrMethodStr);
550
551
        return $executable($paramName, $this);
552
    }
553
554
    private function buildArgFromTypeHint(\ReflectionFunctionAbstract $reflFunc, \ReflectionParameter $reflParam)
555
    {