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