@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | {
|
| 45 | 45 | return new Assert\Collection([ |
| 46 | 46 | 'amount' => $this->buildElement('float', 1),
|
| 47 | - 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]),
|
|
| 47 | + 'currency' => $this->buildElement('string', 1, ['min' => 3, 'max' => 3]),
|
|
| 48 | 48 | 'settle' => $this->buildElement('bool'),
|
| 49 | - 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]),
|
|
| 49 | + 'order_id' => $this->buildElement('string', 0, ['min' => 2, 'max' => 50]),
|
|
| 50 | 50 | 'description' => $this->buildElement('string', 0, ['max' => 255]),
|
| 51 | - 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]),
|
|
| 51 | + 'country' => $this->buildElement('string', 1, ['min' => 2, 'max' => 2]),
|
|
| 52 | 52 | 'payment_method' => new Assert\Required([ |
| 53 | 53 | new Assert\Type([ |
| 54 | 54 | 'type' => 'string', |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ]), |
| 82 | 82 | 'exp_year' => $this->buildElement( |
| 83 | 83 | 'integer', 1, |
| 84 | - ['min' => 4,'max' => 4], |
|
| 84 | + ['min' => 4, 'max' => 4], |
|
| 85 | 85 | new Assert\Range(['min' => date('Y')])
|
| 86 | 86 | ), |
| 87 | 87 | 'exp_month' => $this->buildElement('integer', 1),
|
@@ -191,9 +191,15 @@ |
||
| 191 | 191 | ): object |
| 192 | 192 | {
|
| 193 | 193 | $inside_array = $this->getInsideArray($typeValue); |
| 194 | - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); |
|
| 195 | - if ($length) array_push($inside_array, new Assert\Length($length)); |
|
| 196 | - if ($args) array_push($inside_array, $args); |
|
| 194 | + if ($isRequired) { |
|
| 195 | + array_unshift($inside_array, new Assert\NotBlank()); |
|
| 196 | + } |
|
| 197 | + if ($length) { |
|
| 198 | + array_push($inside_array, new Assert\Length($length)); |
|
| 199 | + } |
|
| 200 | + if ($args) { |
|
| 201 | + array_push($inside_array, $args); |
|
| 202 | + } |
|
| 197 | 203 | |
| 198 | 204 | return $isRequired |
| 199 | 205 | ? new Assert\Required($inside_array) |
@@ -12,6 +12,6 @@ |
||
| 12 | 12 | const RESTRICTED_DOMAIN = 'localhost'; |
| 13 | 13 | const RESTRICTED_IP = '127.0.0.1'; |
| 14 | 14 | |
| 15 | - public $message = 'The url "{{ param }}" contains restricted values. Do not use "' .
|
|
| 16 | - self::RESTRICTED_DOMAIN . '" or "' . self::RESTRICTED_IP . '".'; |
|
| 15 | + public $message = 'The url "{{ param }}" contains restricted values. Do not use "'.
|
|
| 16 | + self::RESTRICTED_DOMAIN.'" or "'.self::RESTRICTED_IP.'".'; |
|
| 17 | 17 | } |