1 | <?php |
||
20 | class Resolver implements ResolverInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var DefinitionData |
||
25 | */ |
||
26 | protected $data; |
||
27 | |||
28 | /** |
||
29 | * @var object |
||
30 | */ |
||
31 | protected $object; |
||
32 | |||
33 | /** |
||
34 | * @var \ReflectionClass |
||
35 | */ |
||
36 | protected $reflection; |
||
37 | |||
38 | /** |
||
39 | * Used to implement the ContainerAwareInterface |
||
40 | */ |
||
41 | use ContainerAwareMethods; |
||
42 | |||
43 | /** |
||
44 | * Resolves the provided data into and object |
||
45 | * |
||
46 | * @param DefinitionData $data |
||
47 | * |
||
48 | * @return object |
||
49 | */ |
||
50 | public function resolve(DefinitionData $data) |
||
62 | |||
63 | /** |
||
64 | * Creates the object |
||
65 | * |
||
66 | * @return object |
||
67 | */ |
||
68 | public function createObject() |
||
77 | |||
78 | /** |
||
79 | * Invoke a method with optional arguments on current object |
||
80 | * |
||
81 | * @param array $call |
||
82 | * |
||
83 | * @return Resolver |
||
84 | */ |
||
85 | protected function apply($call) |
||
100 | |||
101 | /** |
||
102 | * Assign the call value to a property |
||
103 | * |
||
104 | * @param array $data |
||
105 | * |
||
106 | * @return Resolver |
||
107 | */ |
||
108 | protected function setProperty($data) |
||
119 | |||
120 | /** |
||
121 | * Filters all the arguments for aliases |
||
122 | * |
||
123 | * If an argument is prefixed with an '@' its value will be retrieved |
||
124 | * from the container. |
||
125 | * |
||
126 | * @param array $data |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | protected function filterArguments(array $data) |
||
138 | |||
139 | /** |
||
140 | * Filters the value for aliases cases |
||
141 | * |
||
142 | * If the value is a string with an '@' prefix the it should try to get |
||
143 | * value from the container |
||
144 | * |
||
145 | * @param string $value |
||
146 | * |
||
147 | * @return mixed |
||
148 | */ |
||
149 | protected function filterValue($value) |
||
157 | |||
158 | /** |
||
159 | * Get object reflection class |
||
160 | * |
||
161 | * @return \ReflectionClass |
||
162 | */ |
||
163 | protected function getReflection() |
||
170 | } |
||
171 |