@@ -8,6 +8,7 @@ discard block |
||
8 | 8 | * Set custom error messages. |
9 | 9 | * |
10 | 10 | * @param array $userMessages The custom user messages. |
11 | + * @return \TheSupportGroup\Common\Validator\Helpers\FieldsErrorBag |
|
11 | 12 | */ |
12 | 13 | public function setUserMessages($userMessages); |
13 | 14 | |
@@ -25,6 +26,7 @@ discard block |
||
25 | 26 | |
26 | 27 | /** |
27 | 28 | * Erase all error messages. |
29 | + * @return void |
|
28 | 30 | */ |
29 | 31 | public function clear(); |
30 | 32 | |
@@ -33,6 +35,7 @@ discard block |
||
33 | 35 | * |
34 | 36 | * @param $fieldName |
35 | 37 | * @param $message |
38 | + * @return \TheSupportGroup\Common\Validator\Helpers\FieldsErrorBag |
|
36 | 39 | */ |
37 | 40 | public function add($fieldName, $message); |
38 | 41 |
@@ -10,6 +10,7 @@ |
||
10 | 10 | * @param ValidationProviderInterface $validationProvider |
11 | 11 | * @param ValidationResultProcessorInterface $validationResultProcessor |
12 | 12 | * @param RulesFactoryInterface $rulesFactory |
13 | + * @return void |
|
13 | 14 | */ |
14 | 15 | public function __construct( |
15 | 16 | ValidationProviderInterface $validationProvider, |
@@ -6,6 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | /** |
8 | 8 | * Check if the value is valid when the rule is applied. |
9 | + * @return boolean |
|
9 | 10 | */ |
10 | 11 | public function isValid(); |
11 | 12 |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace TheSupportGroup\Common\Validator\Helpers; |
13 | 13 | |
14 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\RulesFactoryInterface; |
|
15 | 14 | use TheSupportGroup\Common\ValidationInterop\ValidationProviderInterface; |
15 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\RulesFactoryInterface; |
|
16 | 16 | |
17 | 17 | class RulesFactory implements RulesFactoryInterface |
18 | 18 | { |
@@ -23,7 +23,6 @@ |
||
23 | 23 | public $fieldsErrorBag = null; |
24 | 24 | |
25 | 25 | /** |
26 | - * @param ValidationProviderInterface $validationProvider |
|
27 | 26 | * @param array $userMessages |
28 | 27 | */ |
29 | 28 | public function __construct( |
@@ -12,10 +12,10 @@ |
||
12 | 12 | namespace TheSupportGroup\Common\Validator\Helpers; |
13 | 13 | |
14 | 14 | use TheSupportGroup\Common\ValidationInterop\ValidationProviderInterface; |
15 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\FieldsErrorBagInterface; |
|
16 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationResultProcessorInterface; |
|
15 | 17 | use TheSupportGroup\Common\Validator\Rules\BaseRule; |
16 | 18 | use TheSupportGroup\Common\Validator\Validator; |
17 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationResultProcessorInterface; |
|
18 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\FieldsErrorBagInterface; |
|
19 | 19 | |
20 | 20 | class ValidationResultProcessor implements ValidationResultProcessorInterface |
21 | 21 | { |
@@ -12,11 +12,10 @@ |
||
12 | 12 | namespace TheSupportGroup\Common\Validator\Helpers; |
13 | 13 | |
14 | 14 | use TheSupportGroup\Common\ValidationInterop\ValidationProviderInterface; |
15 | -use TheSupportGroup\Common\Validator\Rules\BaseRule; |
|
16 | -use TheSupportGroup\Common\Validator\Validator; |
|
17 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationResultProcessorInterface; |
|
18 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationFacadeInterface; |
|
19 | 15 | use TheSupportGroup\Common\Validator\Contracts\Helpers\RulesFactoryInterface; |
16 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationFacadeInterface; |
|
17 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationResultProcessorInterface; |
|
18 | +use TheSupportGroup\Common\Validator\Validator; |
|
20 | 19 | |
21 | 20 | class ValidatorFacade implements ValidationFacadeInterface |
22 | 21 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * Validator calls captured and remapped here. |
53 | 53 | * |
54 | - * @return object Validator rule object. |
|
54 | + * @return BaseRule Validator rule object. |
|
55 | 55 | */ |
56 | 56 | public function __call($method, array $params = array()) |
57 | 57 | { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @param string $type |
89 | 89 | * |
90 | - * @return array |
|
90 | + * @return string |
|
91 | 91 | */ |
92 | 92 | public function getConfig($type = self::CONFIG_ALL) |
93 | 93 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * If field has specific rule. |
103 | 103 | * |
104 | - * @param $rule |
|
104 | + * @param string $rule |
|
105 | 105 | * |
106 | 106 | * @return bool |
107 | 107 | */ |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace TheSupportGroup\Common\Validator\Rules; |
13 | 13 | |
14 | -use Exception; |
|
15 | 14 | use TheSupportGroup\Common\ValidationInterop\ValidationProviderInterface; |
16 | 15 | |
17 | 16 | abstract class BaseRule |
@@ -94,7 +94,6 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @param array $data user request data |
96 | 96 | * @param array $rules validation rules |
97 | - * @param array $userMessages custom error messages |
|
98 | 97 | * |
99 | 98 | * @return ValidatorRule |
100 | 99 | */ |
@@ -159,7 +158,7 @@ discard block |
||
159 | 158 | * |
160 | 159 | * @param array $data |
161 | 160 | * |
162 | - * @return array |
|
161 | + * @return string |
|
163 | 162 | */ |
164 | 163 | private function prepareData(array $data) |
165 | 164 | { |
@@ -12,9 +12,9 @@ |
||
12 | 12 | namespace TheSupportGroup\Common\Validator; |
13 | 13 | |
14 | 14 | use TheSupportGroup\Common\ValidationInterop\ValidationProviderInterface; |
15 | +use TheSupportGroup\Common\Validator\Contracts\Helpers\RulesFactoryInterface; |
|
15 | 16 | use TheSupportGroup\Common\Validator\Contracts\Helpers\ValidationResultProcessorInterface; |
16 | 17 | use TheSupportGroup\Common\Validator\Rules\BaseRule; |
17 | -use TheSupportGroup\Common\Validator\Contracts\Helpers\RulesFactoryInterface; |
|
18 | 18 | |
19 | 19 | final class Validator |
20 | 20 | { |