Conditions | 4 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __call($name, $arguments) |
||
25 | { |
||
26 | if (strncmp($name, 'get', 3) === 0) { |
||
27 | $parameter = $this->propertyNameByMethodName($name); |
||
|
|||
28 | |||
29 | return $this->__get($parameter); |
||
30 | } |
||
31 | |||
32 | if (strncmp($name, 'with', 4) === 0) { |
||
33 | $parameter = $this->propertyNameByMethodName($name, 4); |
||
34 | |||
35 | $value = $arguments[0]; |
||
36 | $this->data[$parameter] = $value; |
||
37 | $this->parameterPosition()[$parameter] = $value; |
||
38 | |||
39 | return $this; |
||
40 | } |
||
41 | |||
42 | if (strncmp($name, 'set', 3) === 0) { |
||
43 | $parameter = $this->propertyNameByMethodName($name); |
||
44 | $with_method = "with$parameter"; |
||
45 | |||
46 | return $this->$with_method($arguments[0]); |
||
47 | } |
||
48 | |||
49 | throw new RuntimeException('Call to undefined method ' . __CLASS__ . '::' . $name . '()'); |
||
50 | } |
||
52 |