| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait GettersAndSetters |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * creates magic getters and setters |
||
| 9 | * if you call $this->getFooBar() then it will get the variable FooBar even if the method |
||
| 10 | * getFooBar does not exist. |
||
| 11 | * |
||
| 12 | * if you call $this->setFooBar('hello') then it will set the variable FooBar even if the method |
||
| 13 | * setFooBar does not exist. |
||
| 14 | * |
||
| 15 | * See: http://php.net/manual/en/language.oop5.overloading.php#object.call |
||
| 16 | * |
||
| 17 | * @param string $function name of the function |
||
| 18 | * @param array $args parameters provided to the getter / setter |
||
| 19 | */ |
||
| 20 | public function __call($function, $args) |
||
| 47 |