| 1 | <?php |
||
| 21 | abstract class AbstractRule implements RuleInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Message for error output |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $description = 'is invalid'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @inheritdoc |
||
| 31 | */ |
||
| 32 | abstract public function validate($input) : bool; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @inheritdoc |
||
| 36 | */ |
||
| 37 | public function assert($input) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @inheritdoc |
||
| 46 | */ |
||
| 47 | public function __invoke($input) : bool |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritdoc |
||
| 54 | */ |
||
| 55 | 440 | public function __toString() : string |
|
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritdoc |
||
| 62 | */ |
||
| 63 | 198 | public function getDescription() : string |
|
| 67 | |||
| 68 | /** |
||
| 69 | * @inheritdoc |
||
| 70 | */ |
||
| 71 | 4 | public function setDescription(string $description) : RuleInterface |
|
| 76 | } |
||
| 77 |