1 | <?php |
||
34 | trait ReferenceTrait |
||
35 | { |
||
36 | use LocalCacheTrait; |
||
37 | |||
38 | /** |
||
39 | * refernece start chars |
||
40 | * |
||
41 | * @var string |
||
42 | * @access private |
||
43 | */ |
||
44 | private $ref_start = '${'; |
||
45 | |||
46 | /** |
||
47 | * reference ending chars |
||
48 | * |
||
49 | * @var string |
||
50 | * @access private |
||
51 | */ |
||
52 | private $ref_end = '}'; |
||
53 | |||
54 | /** |
||
55 | * cached pattern to match |
||
56 | * |
||
57 | * @var string |
||
58 | * @access private |
||
59 | */ |
||
60 | private $ref_pattern = '~(\$\{((?:(?!\$\{|\}).)+?)\})~'; |
||
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | public function setReferencePattern( |
||
66 | /*# string */ $start, |
||
67 | /*# string */ $end |
||
68 | ) { |
||
69 | $this->ref_start = $start; |
||
70 | $this->ref_end = $end; |
||
71 | |||
72 | // build pattern on the fly |
||
73 | $s = preg_quote($start); |
||
74 | $e = preg_quote($end); |
||
75 | $this->ref_pattern = sprintf( |
||
76 | "~(%s((?:(?!%s|%s).)+?)%s)~", $s, $s, $e, $e |
||
77 | ); |
||
78 | |||
79 | return $this->clearLocalCache(); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * {@inheritDoc} |
||
84 | */ |
||
85 | public function hasReference( |
||
97 | |||
98 | /** |
||
99 | * {@inheritDoc} |
||
100 | */ |
||
101 | public function deReference(/*# string */ $subject) |
||
125 | |||
126 | /** |
||
127 | * {@inheritDoc} |
||
128 | */ |
||
129 | public function deReferenceArray(&$dataArray) |
||
143 | |||
144 | /** |
||
145 | * Check dereferenced value |
||
146 | * |
||
147 | * @param mixed $value |
||
148 | * @param string $subject the subject to dereference |
||
149 | * @param string $reference the matched whole reference |
||
150 | * @return mixed |
||
151 | * @throws RuntimeException if $subject malformed, like mix string & array |
||
152 | * @access private |
||
153 | */ |
||
154 | private function checkValue( |
||
176 | |||
177 | /** |
||
178 | * Resolve the reference $name |
||
179 | * |
||
180 | * @param string $name |
||
181 | * @return mixed |
||
182 | * @throws RuntimeException if reference unknown |
||
183 | * @access private |
||
184 | * @since 2.0.6 added cache support |
||
185 | * @since 2.0.8 added delegatorAware support |
||
186 | */ |
||
187 | private function resolveReference(/*# string */ $name) |
||
213 | |||
214 | /** |
||
215 | * Throw exception if looped |
||
216 | * |
||
217 | * @param int $loop loop counter |
||
218 | * @param string $name reference name |
||
219 | * @throws RuntimeException if loop found |
||
220 | * @access private |
||
221 | * @since 2.0.6 |
||
222 | */ |
||
223 | private function checkReferenceLoop( |
||
234 | |||
235 | /** |
||
236 | * Lookup reference with delegator |
||
237 | * |
||
238 | * @param string $name |
||
239 | * @return mixed |
||
240 | * @access private |
||
241 | */ |
||
242 | private function delegatedReference(/*# string */ $name) |
||
255 | |||
256 | /** |
||
257 | * For unknown reference $name, normally returns NULL |
||
258 | * |
||
259 | * @param string $name |
||
260 | * @return mixed |
||
261 | * @throws \Exception if implementor WANTS TO !! |
||
262 | * @access protected |
||
263 | */ |
||
264 | abstract protected function resolveUnknown(/*# string */ $name); |
||
265 | |||
266 | /** |
||
267 | * The REAL resolving method. return NULL for unknown reference |
||
268 | * |
||
269 | * @param string $name |
||
270 | * @return mixed |
||
271 | * @access protected |
||
272 | */ |
||
273 | abstract protected function getReference(/*# string */ $name); |
||
274 | } |
||
275 |
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.