@@ -174,9 +174,15 @@ |
||
| 174 | 174 | 'message' => 'The value {{ value }} is not a valid {{ type }}.' |
| 175 | 175 | ]), |
| 176 | 176 | ]; |
| 177 | - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); |
|
| 178 | - if ($length) array_push($inside_array, new Assert\Length($length)); |
|
| 179 | - if ($args) array_push($inside_array, $args); |
|
| 177 | + if ($isRequired) { |
|
| 178 | + array_unshift($inside_array, new Assert\NotBlank()); |
|
| 179 | + } |
|
| 180 | + if ($length) { |
|
| 181 | + array_push($inside_array, new Assert\Length($length)); |
|
| 182 | + } |
|
| 183 | + if ($args) { |
|
| 184 | + array_push($inside_array, $args); |
|
| 185 | + } |
|
| 180 | 186 | |
| 181 | 187 | return $isRequired |
| 182 | 188 | ? new Assert\Required($inside_array) |