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