Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function __call($method, $args) |
||
26 | { |
||
27 | $action = substr($method, 0, 3); |
||
28 | if ($action === 'set') { |
||
29 | //Convert method to snake_case (which is the name of the property) |
||
30 | $property_name = ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', substr($method, 3))), '_'); |
||
31 | $this->$property_name = $args[0]; |
||
32 | |||
33 | return $this; |
||
34 | } |
||
35 | |||
36 | return parent::__call($method, $args); |
||
37 | } |
||
38 | } |
||
39 |