We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 8 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 89.47% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | abstract class AbstractRule implements Validatable |
||
| 20 | { |
||
| 21 | protected $name; |
||
| 22 | protected $template; |
||
| 23 | |||
| 24 | 2 | public function __invoke($input) |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | public function assert($input): void |
|
| 30 | { |
||
| 31 | 2 | if ($this->validate($input)) { |
|
| 32 | 1 | return; |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | throw $this->reportError($input); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | public function check($input): void |
|
| 41 | 1 | } |
|
| 42 | |||
| 43 | 15 | public function getId() |
|
| 44 | { |
||
| 45 | 15 | return $this->name; |
|
| 46 | } |
||
| 47 | |||
| 48 | public function reportError($input, array $extraParams = []) |
||
| 51 | } |
||
| 52 | |||
| 53 | 11 | public function setId($name) |
|
| 54 | { |
||
| 55 | 11 | $this->name = $name; |
|
| 56 | |||
| 57 | 11 | return $this; |
|
| 58 | } |
||
| 59 | |||
| 60 | 1 | public function setTemplate($template) |
|
| 65 | } |
||
| 66 | } |
||
| 67 |