| 1 | <?php |
||
| 10 | final class ResourceValidator extends AbstractValidator |
||
| 11 | { |
||
| 12 | const INVALID = 'invalidResource'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var null|ResourceManagerInterface |
||
| 16 | */ |
||
| 17 | private $manager; |
||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $resource; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var array Error message templates |
||
| 25 | */ |
||
| 26 | protected $messageTemplates = [ |
||
| 27 | self::INVALID => "Resource '%resource%' is invalid and is not among the list of known resources.", |
||
| 28 | ]; |
||
| 29 | /** |
||
| 30 | * @var array Error message template variables |
||
| 31 | */ |
||
| 32 | protected $messageVariables = [ |
||
| 33 | 'resource' => 'resource' |
||
| 34 | ]; |
||
| 35 | |||
| 36 | 38 | public function __construct(ResourceManagerInterface $manager, $options = null) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @inheritdoc |
||
| 44 | */ |
||
| 45 | 34 | public function isValid($value) |
|
| 63 | } |
||
| 64 |