@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $return = TypeCheckArray::create( |
| 25 | 25 | [ |
| 26 | 26 | Arrayy::ARRAYY_HELPER_TYPES_FOR_ALL_PROPERTIES => new TypeCheckCallback( |
| 27 | - static function ($value) { |
|
| 27 | + static function($value) { |
|
| 28 | 28 | return \is_string($value) && $value !== ''; |
| 29 | 29 | } |
| 30 | 30 | ), |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if ($type instanceof \phpDocumentor\Reflection\Types\Array_) { |
| 118 | 118 | $valueTypeTmp = $type->getValueType()->__toString(); |
| 119 | 119 | if ($valueTypeTmp !== 'mixed') { |
| 120 | - return $valueTypeTmp . '[]'; |
|
| 120 | + return $valueTypeTmp.'[]'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return 'array'; |
@@ -175,6 +175,6 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function throwException($expectedTypes, $value, $type): \Throwable |
| 177 | 177 | { |
| 178 | - throw new \TypeError("Invalid type: expected \"{$this->property_name}\" to be of type {{$expectedTypes}}, instead got value \"" . $this->valueToString($value) . '" (' . \print_r($value, true) . ") with type {{$type}}."); |
|
| 178 | + throw new \TypeError("Invalid type: expected \"{$this->property_name}\" to be of type {{$expectedTypes}}, instead got value \"".$this->valueToString($value).'" ('.\print_r($value, true).") with type {{$type}}."); |
|
| 179 | 179 | } |
| 180 | 180 | } |
@@ -298,9 +298,9 @@ |
||
| 298 | 298 | $jsonObject = \json_decode($json, false); |
| 299 | 299 | |
| 300 | 300 | $mapper = new \Arrayy\Mapper\Json(); |
| 301 | - $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($return) { |
|
| 301 | + $mapper->undefinedPropertyHandler = static function($object, $key, $jsonValue) use ($return) { |
|
| 302 | 302 | if ($return->checkForMissingPropertiesInConstructor) { |
| 303 | - throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); |
|
| 303 | + throw new \TypeError('Property mismatch - input: '.\print_r(['key' => $key, 'jsonValue' => $jsonValue], true).' for object: '.\get_class($object)); |
|
| 304 | 304 | } |
| 305 | 305 | }; |
| 306 | 306 | |