1 | <?php |
||
23 | class InstanceManager |
||
24 | { |
||
25 | /** |
||
26 | * @var Di |
||
27 | */ |
||
28 | private $di; |
||
29 | |||
30 | /** |
||
31 | * @var Resolver |
||
32 | */ |
||
33 | private $resolver; |
||
34 | |||
35 | /** |
||
36 | * @var object |
||
37 | */ |
||
38 | private $service; |
||
39 | |||
40 | /** |
||
41 | * @var ReflectionClass |
||
42 | */ |
||
43 | private $reflection; |
||
44 | |||
45 | /** |
||
46 | * Constructor. |
||
47 | * |
||
48 | * @param Di $di |
||
49 | * @param mixed $service |
||
50 | */ |
||
51 | public function __construct(Di $di, $service) |
||
65 | |||
66 | /** |
||
67 | * Get original service. |
||
68 | * |
||
69 | * @return object |
||
70 | */ |
||
71 | public function getOriginalInstance() |
||
75 | |||
76 | /** |
||
77 | * Get instance reflection. |
||
78 | * |
||
79 | * @return ReflectionClass |
||
80 | */ |
||
81 | public function getReflection() |
||
85 | |||
86 | /** |
||
87 | * Get instance methods. |
||
88 | * |
||
89 | * @param int|null $filter |
||
90 | * |
||
91 | * @return ReflectionMethod[] |
||
92 | */ |
||
93 | public function getMethods($filter = null) |
||
97 | |||
98 | /** |
||
99 | * Get constructor arguments. |
||
100 | * |
||
101 | * @return ReflectionParameter[] |
||
102 | */ |
||
103 | public function getConstructorArguments() |
||
109 | |||
110 | /** |
||
111 | * @param $method |
||
112 | * |
||
113 | * @return ReflectionParameter[] |
||
114 | */ |
||
115 | public function getMethodArguments($method) |
||
121 | |||
122 | /** |
||
123 | * Set sets of properties. |
||
124 | * |
||
125 | * @param array $properties |
||
126 | * |
||
127 | * @return static |
||
128 | */ |
||
129 | public function setProperties(array $properties) |
||
137 | |||
138 | /** |
||
139 | * Set property to service. |
||
140 | * |
||
141 | * @param string $property |
||
142 | * @param mixed $value |
||
143 | * |
||
144 | * @return static |
||
145 | */ |
||
146 | public function setProperty($property, $value) |
||
152 | |||
153 | /** |
||
154 | * Call sets of method. |
||
155 | * |
||
156 | * @param array $methods |
||
157 | * |
||
158 | * @return array |
||
159 | */ |
||
160 | public function callMethods(array $methods) |
||
171 | |||
172 | /** |
||
173 | * Call method with auto resolution. |
||
174 | * |
||
175 | * @param string $method |
||
176 | * @param array $arguments |
||
177 | * |
||
178 | * @return mixed |
||
179 | */ |
||
180 | public function callMethod($method, array $arguments = array()) |
||
184 | } |
||
185 |