| Total Complexity | 8 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class Consider |
||
| 15 | { |
||
| 16 | public static $methods = [ |
||
| 17 | 'validationChecks' => 'validation', |
||
| 18 | ]; |
||
| 19 | |||
| 20 | private $mode; |
||
| 21 | |||
| 22 | 110 | public static function add($key, $listener) |
|
| 25 | 110 | } |
|
| 26 | |||
| 27 | 15 | public function __construct($mode) |
|
| 30 | 15 | } |
|
| 31 | |||
| 32 | 15 | public function __call($method, $args) |
|
| 33 | { |
||
| 34 | 15 | return $this->turn(self::$methods[$method], ...$args); |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | public function allChecks() |
|
| 41 | } |
||
| 42 | 3 | } |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @param $key |
||
| 46 | * @param callable|null $closure |
||
| 47 | */ |
||
| 48 | 15 | private function turn($key, callable $closure = null) |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param $key |
||
| 66 | */ |
||
| 67 | 15 | private function changeMode($key) |
|
| 75 |