We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 17 | abstract class AbstractRule implements Validatable |
||
| 18 | { |
||
| 19 | protected $name; |
||
| 20 | protected $template; |
||
| 21 | |||
| 22 | 2 | public function __invoke($input) |
|
| 23 | { |
||
| 24 | 2 | return $this->validate($input); |
|
| 25 | } |
||
| 26 | |||
| 27 | 2 | public function assert($input) |
|
| 28 | { |
||
| 29 | 2 | if ($this->validate($input)) { |
|
| 30 | 1 | return true; |
|
| 31 | } |
||
| 32 | 1 | throw $this->reportError($input); |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | public function check($input) |
|
| 39 | |||
| 40 | 15 | public function getName() |
|
| 44 | |||
| 45 | public function getTemplate() |
||
| 46 | { |
||
| 49 | |||
| 50 | 2 | public function reportError($input, array $extraParams = []) |
|
| 67 | |||
| 68 | 14 | public function setName($name) |
|
| 74 | |||
| 75 | 2 | public function setTemplate($template) |
|
| 81 | |||
| 82 | 1 | protected function createException() |
|
| 90 | } |
||
| 91 |