1 | <?php |
||
16 | class ReflectionObject |
||
17 | { |
||
18 | private $object; |
||
19 | private $properties; |
||
20 | private $injectionStrategies; |
||
21 | |||
22 | 6 | public function __construct( |
|
36 | |||
37 | /** |
||
38 | * Add a property that will be injected |
||
39 | * |
||
40 | * @param string $name |
||
41 | * @param mixed $value |
||
42 | * |
||
43 | * @return self |
||
44 | */ |
||
45 | 4 | public function withProperty(string $name, $value) |
|
53 | |||
54 | /** |
||
55 | * Return the collection of properties that will be injected in the object |
||
56 | * |
||
57 | * @return CollectionInterface |
||
58 | */ |
||
59 | 2 | public function getProperties(): CollectionInterface |
|
63 | |||
64 | /** |
||
65 | * Return the object with the list of properties set on it |
||
66 | * |
||
67 | * @return object |
||
68 | */ |
||
69 | 4 | public function buildObject() |
|
77 | |||
78 | /** |
||
79 | * Inject the given key/value pair into the object |
||
80 | * |
||
81 | * @param string $key |
||
82 | * @param mixed $value |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | 3 | private function inject(string $key, $value) |
|
101 | |||
102 | /** |
||
103 | * @param CollectionInterface|null $properties |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | 5 | private function initProperties(CollectionInterface $properties = null) |
|
115 | |||
116 | /** |
||
117 | * @param TypedCollectionInterface $strategies |
||
118 | * |
||
119 | * @return void |
||
120 | */ |
||
121 | 5 | private function initInjectionStrategies(TypedCollectionInterface $strategies = null) |
|
140 | } |
||
141 |