| @@ -44,12 +44,12 @@ 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 | 51 |              'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), | 
| 52 | -            'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), | |
| 52 | +            'country' => $this->buildElement('string', 1, ['min' => 2, 'max' => 2]), | |
| 53 | 53 | 'payment_method' => new Assert\Required([ | 
| 54 | 54 | new Assert\Type([ | 
| 55 | 55 | 'type' => 'string', | 
| @@ -82,7 +82,7 @@ discard block | ||
| 82 | 82 | ]), | 
| 83 | 83 | 'exp_year' => $this->buildElement( | 
| 84 | 84 | 'integer', 1, | 
| 85 | - ['min' => 4,'max' => 4], | |
| 85 | + ['min' => 4, 'max' => 4], | |
| 86 | 86 |                          new Assert\Range(['min' => date('Y')]) | 
| 87 | 87 | ), | 
| 88 | 88 |                      'exp_month' => $this->buildElement('integer', 1), | 
| @@ -204,9 +204,15 @@ | ||
| 204 | 204 | ): object | 
| 205 | 205 |      { | 
| 206 | 206 | $inside_array = $this->getInsideArray($typeValue); | 
| 207 | - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); | |
| 208 | - if ($length) array_push($inside_array, new Assert\Length($length)); | |
| 209 | - if ($args) array_push($inside_array, $args); | |
| 207 | +        if ($isRequired) { | |
| 208 | + array_unshift($inside_array, new Assert\NotBlank()); | |
| 209 | + } | |
| 210 | +        if ($length) { | |
| 211 | + array_push($inside_array, new Assert\Length($length)); | |
| 212 | + } | |
| 213 | +        if ($args) { | |
| 214 | + array_push($inside_array, $args); | |
| 215 | + } | |
| 210 | 216 | |
| 211 | 217 | return $isRequired | 
| 212 | 218 | ? new Assert\Required($inside_array) |