Code Duplication    Length = 11-11 lines in 2 locations

src/definition/analyzer/annotation/annotation/InjectClass.php 1 location

@@ 62-72 (lines=11) @@
59
     * @throws ParameterDefinitionAlreadyExistsException
60
     * @throws MethodDefinitionAlreadyExistsException
61
     */
62
    public function resolveMethod(
63
        DefinitionAnalyzer $analyzer,
64
        ClassDefinition $classDefinition,
65
        \ReflectionMethod $reflectionMethod
66
    ) {
67
        // Get parameter key
68
        $key = array_keys($this->value)[0];
69
        $classDefinition->setupMethod($reflectionMethod->getName())
70
            ->defineParameter($key)
71
            ->defineDependency(new ClassReference($this->value[$key]))->end();
72
    }
73
}
74

src/definition/analyzer/annotation/annotation/InjectService.php 1 location

@@ 65-75 (lines=11) @@
62
     * @throws ParameterDefinitionAlreadyExistsException
63
     * @throws MethodDefinitionAlreadyExistsException
64
     */
65
    public function resolveMethod(
66
        DefinitionAnalyzer $analyzer,
67
        ClassDefinition $classDefinition,
68
        \ReflectionMethod $reflectionMethod
69
    ) {
70
        // Get parameter key
71
        $key = array_keys($this->value)[0];
72
        $classDefinition->setupMethod($reflectionMethod->getName())
73
            ->defineParameter($key)
74
            ->defineDependency(new ServiceReference($this->value[$key]))->end();
75
    }
76
}
77