| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 2 | public static function registerCalculator($calculator): int |
|
| 43 | { |
||
| 44 | 2 | if (is_a($calculator, CalculatorInterface::class, true) === false) { |
|
| 45 | 1 | throw new \InvalidArgumentException('Calculator must implement [' . CalculatorInterface::class . '].'); |
|
| 46 | } |
||
| 47 | return |
||
| 48 | 1 | array_unshift(self::$calculators, $calculator); |
|
| 49 | } |
||
| 51 |