Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function evaluate($data) |
||
16 | { |
||
17 | $config = $data->route->getConfig(); |
||
|
|||
18 | |||
19 | // Break up the class and method |
||
20 | list($class, $method) = explode('::', $config['callback']); |
||
21 | if (!class_exists($class)) { |
||
22 | throw new \InvalidArgumentException('Class "'.$class.'" does not exist'); |
||
23 | } |
||
24 | return $class::$method($data); |
||
25 | } |
||
26 | } |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.