Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function __call($name, $arguments): static |
||
24 | { |
||
25 | $namespace = __NAMESPACE__ . '\\Rules'; |
||
26 | $class = sprintf("%s\%s", $namespace, ucfirst($name)); |
||
27 | if (!class_exists($class)) { |
||
28 | throw new RuntimeException(sprintf('Rule not found: (%s).', $name)); |
||
29 | } |
||
30 | |||
31 | $rule = new $class(...$arguments); |
||
32 | if ($rule instanceof Rule) { |
||
33 | return $this->add($rule); |
||
34 | } |
||
35 | |||
36 | return $this; |
||
37 | } |
||
39 |