| 1 | <?php |
||
| 24 | abstract class AbstractValidationRuleSet implements ValidationRuleSetInterface { |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Rules. |
||
| 28 | * |
||
| 29 | * @var ValidationRuleInterface[] |
||
| 30 | */ |
||
| 31 | private $rules; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Constructor. |
||
| 35 | */ |
||
| 36 | protected function __construct() { |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function addRule(ValidationRuleInterface $rule) { |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function getRules() { |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | public function removeRule(ValidationRuleInterface $rule) { |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Set the rules. |
||
| 70 | * |
||
| 71 | * @param ValidationRuleInterface[] $rules The rules. |
||
| 72 | * @return ValidationRuleSetInterface Returns this validation rule set. |
||
| 73 | */ |
||
| 74 | public function setRules(array $rules) { |
||
| 78 | |||
| 79 | /** |
||
| 80 | * {@inheritdoc} |
||
| 81 | */ |
||
| 82 | public function validate($object) { |
||
| 98 | } |
||
| 99 |