| Total Complexity | 5 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | class Formula |
||
| 9 | { |
||
| 10 | public function __construct(private ?string $value, private readonly FormulaEngine $formulaEngine) |
||
| 15 | } |
||
| 16 | } |
||
| 17 | |||
| 18 | private function validate(string $value): void |
||
| 19 | { |
||
| 20 | $error = $this->formulaEngine->validate($value); |
||
| 21 | if ($error !== null) { |
||
| 22 | throw new FormulaEngineException($error); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | public function value(): ?string |
||
| 29 | } |
||
| 30 | } |