@@ -22,37 +22,37 @@ |
||
| 22 | 22 | |
| 23 | 23 | switch ($expectedType) { |
| 24 | 24 | case InputType::BOOLEAN: |
| 25 | - if (!is_bool($value)) { |
|
| 26 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected boolean.']); |
|
| 25 | + if ( ! is_bool($value)) { |
|
| 26 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected boolean.']); |
|
| 27 | 27 | } |
| 28 | 28 | break; |
| 29 | 29 | case InputType::INTEGER: |
| 30 | - if (!is_int($value)) { |
|
| 31 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected integer.']); |
|
| 30 | + if ( ! is_int($value)) { |
|
| 31 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected integer.']); |
|
| 32 | 32 | } |
| 33 | 33 | break; |
| 34 | 34 | case InputType::DOUBLE: |
| 35 | - if (!is_float($value) && !is_int($value)) { |
|
| 36 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected double.']); |
|
| 35 | + if ( ! is_float($value) && ! is_int($value)) { |
|
| 36 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected double.']); |
|
| 37 | 37 | } |
| 38 | 38 | break; |
| 39 | 39 | case InputType::FLOAT: |
| 40 | - if (!is_float($value) && !is_int($value)) { |
|
| 41 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected float.']); |
|
| 40 | + if ( ! is_float($value) && ! is_int($value)) { |
|
| 41 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected float.']); |
|
| 42 | 42 | } |
| 43 | 43 | break; |
| 44 | 44 | case InputType::STRING: |
| 45 | - if (!is_string($value)) { |
|
| 46 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected string.']); |
|
| 45 | + if ( ! is_string($value)) { |
|
| 46 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected string.']); |
|
| 47 | 47 | } |
| 48 | 48 | break; |
| 49 | 49 | case InputType::ARRAY: |
| 50 | - if (!is_array($value)) { |
|
| 51 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected array.']); |
|
| 50 | + if ( ! is_array($value)) { |
|
| 51 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type. Expected array.']); |
|
| 52 | 52 | } |
| 53 | 53 | break; |
| 54 | 54 | default: |
| 55 | - return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type.']); |
|
| 55 | + return new ValidationResult(ValidationResult::STATUS_ERROR, ['Value ' . $value . ' has invalid type.']); |
|
| 56 | 56 | } |
| 57 | 57 | return new ValidationResult(ValidationResult::STATUS_OK); |
| 58 | 58 | } |