Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function apply($value) |
||
44 | { |
||
45 | if (!\is_object($value)) { |
||
46 | throw new \RuntimeException('Trying to get property of non-object'); |
||
47 | } |
||
48 | |||
49 | if (!\property_exists($value, $this->name)) { |
||
50 | throw new \RuntimeException(\sprintf('Undefined property %s::%s', \get_class($value), $this->name)); |
||
51 | } |
||
52 | |||
53 | return self::accessor()->getValue($value, $this->name); |
||
54 | } |
||
55 | } |
||
56 |