Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
39 | 1 | public function __call($method, $args) |
|
40 | { |
||
41 | 1 | if (method_exists($this->metric, $method)) { |
|
42 | 1 | $rate = call_user_func([$this->metric, $method]); |
|
43 | |||
44 | 1 | $temp = $rate * $this->value; |
|
45 | |||
46 | 1 | $this->convert->setValue($temp + $this->convert->getValue()); |
|
47 | |||
48 | 1 | return new To($this->convert, $this->metric); |
|
49 | } |
||
50 | |||
51 | throw new BadMethodCallException(sprintf('Method: %s does not exist on class: %s', $method, get_class($this->metric))); |
||
52 | } |
||
53 | } |
||
54 |