1 | <?php |
||
17 | class HttpMethod extends AbstractValidator |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | const HTTP_METHOD_INVALID = 'httpMethodInvalid'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | const VALIDATE_VALUE_INVALID = 'validateValueInvalid'; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | const REQUEST_INVALID = 'requestInvalid'; |
||
33 | |||
34 | /** |
||
35 | * Validation failure message template definitions |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $messageTemplates = [ |
||
40 | self::HTTP_METHOD_INVALID => 'Http method invalid', |
||
41 | self::VALIDATE_VALUE_INVALID => 'Validate value not implement WorkflowDispatchEventInterface', |
||
42 | self::REQUEST_INVALID => 'The request is not http', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * Настройки валидатора |
||
47 | * |
||
48 | * @var array|null |
||
49 | */ |
||
50 | protected $allowedHttpMethods; |
||
51 | |||
52 | |||
53 | /** |
||
54 | * @param WorkflowDispatchEventInterface $value |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function isValid($value) |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | public function getAllowedHttpMethods() |
||
97 | |||
98 | /** |
||
99 | * @param array|null $allowedHttpMethods |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function setAllowedHttpMethods(array $allowedHttpMethods = null) |
||
120 | } |
||
121 |