1 | <?php |
||
13 | class ReflectionClass |
||
14 | { |
||
15 | private $class; |
||
16 | private $properties; |
||
17 | private $injectionStrategies; |
||
18 | private $instanciator; |
||
19 | |||
20 | 5 | public function __construct( |
|
21 | string $class, |
||
22 | CollectionInterface $properties = null, |
||
23 | InjectionStrategies $injectionStrategies = null, |
||
24 | InstanciatorInterface $instanciator = null |
||
25 | ) { |
||
26 | 5 | $injectionStrategies = $injectionStrategies ?? new DefaultInjectionStrategies(); |
|
27 | |||
28 | 5 | $this->class = $class; |
|
29 | 5 | $this->properties = $properties ?? new Collection([]); |
|
30 | 5 | $this->injectionStrategies = $injectionStrategies; |
|
31 | 5 | $this->instanciator = $instanciator ?? new ReflectionInstanciator; |
|
32 | 5 | } |
|
33 | |||
34 | /** |
||
35 | * Add a property to be injected in the new object |
||
36 | * |
||
37 | * @param string $property |
||
38 | * @param mixed $value |
||
39 | * |
||
40 | * @return self |
||
41 | */ |
||
42 | 2 | public function withProperty(string $property, $value): self |
|
51 | |||
52 | /** |
||
53 | * Add a set of properties that need to be injected |
||
54 | * |
||
55 | * @param array $properties |
||
56 | * |
||
57 | * @return self |
||
58 | */ |
||
59 | 1 | public function withProperties(array $properties): self |
|
68 | |||
69 | /** |
||
70 | * Return the collection of properties that will be injected in the object |
||
71 | * |
||
72 | * @return CollectionInterface |
||
73 | */ |
||
74 | 1 | public function getProperties(): CollectionInterface |
|
78 | |||
79 | /** |
||
80 | * Return the list of injection strategies used |
||
81 | * |
||
82 | * @return InjectionStrategies |
||
83 | */ |
||
84 | 1 | public function getInjectionStrategies(): InjectionStrategies |
|
88 | |||
89 | /** |
||
90 | * Return the object instanciator |
||
91 | * |
||
92 | * @return InstanciatorInterface |
||
93 | */ |
||
94 | 1 | public function getInstanciator(): InstanciatorInterface |
|
98 | |||
99 | /** |
||
100 | * Return a new instance of the class |
||
101 | * |
||
102 | * @return object |
||
103 | */ |
||
104 | 2 | public function buildObject() |
|
123 | } |
||
124 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.