| Conditions | 6 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function __call($function, $args) |
||
| 21 | { |
||
| 22 | $getOrSet = substr($function, 0, 3); |
||
| 23 | if ($getOrSet === 'set' || $getOrSet === 'get') { |
||
| 24 | $var = lcfirst(ltrim($function, $getOrSet)); |
||
| 25 | if (property_exists($this, $var)) { |
||
| 26 | if ($getOrSet === 'get') { |
||
| 27 | return $this->{$var}; |
||
| 28 | } elseif ($getOrSet === 'set') { |
||
| 29 | $this->{$var} = $args[0]; |
||
| 30 | |||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | } else { |
||
| 34 | user_error( |
||
| 35 | 'Fatal error: can not get/set variable in ModuleUpgraderBaseWithVariables::' . $var, |
||
| 36 | E_USER_ERROR |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } else { |
||
| 40 | user_error( |
||
| 41 | 'Fatal error: Call to undefined method ModuleUpgraderBaseWithVariables::' . $function . '()', |
||
| 42 | E_USER_ERROR |
||
| 43 | ); |
||
| 47 |