| @@ 35-58 (lines=24) @@ | ||
| 32 | /** |
|
| 33 | * {@inheritdoc} |
|
| 34 | */ |
|
| 35 | public function getMethodsInjections($fqcn) |
|
| 36 | { |
|
| 37 | $injections = []; |
|
| 38 | ||
| 39 | $reflection = new \ReflectionClass($fqcn); |
|
| 40 | ||
| 41 | foreach ($reflection->getMethods() as $method) { |
|
| 42 | $name = $method->getName(); |
|
| 43 | if ('__construct' === $name) { |
|
| 44 | continue; |
|
| 45 | } |
|
| 46 | ||
| 47 | $inject = $this->reader->getMethodAnnotation( |
|
| 48 | new \ReflectionMethod($fqcn, $name), |
|
| 49 | AnnotationInterface::class |
|
| 50 | ); |
|
| 51 | ||
| 52 | if (null !== $inject) { |
|
| 53 | $injections[$name] = $inject; |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | return $injections; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * {@inheritdoc} |
|
| @@ 63-78 (lines=16) @@ | ||
| 60 | /** |
|
| 61 | * {@inheritdoc} |
|
| 62 | */ |
|
| 63 | public function getPropertiesInjections($fqcn) |
|
| 64 | { |
|
| 65 | $injections = []; |
|
| 66 | $reflection = new \ReflectionClass($fqcn); |
|
| 67 | ||
| 68 | foreach ($reflection->getProperties() as $property) { |
|
| 69 | $reflectionProperty = new \ReflectionProperty($fqcn, $property->getName()); |
|
| 70 | $inject = $this->reader->getPropertyAnnotation($reflectionProperty, AnnotationInterface::class); |
|
| 71 | ||
| 72 | if (null !== $inject) { |
|
| 73 | $injections[$property->getName()] = $inject; |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| 77 | return $injections; |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * {@inheritdoc} |
|