@@ -53,7 +53,7 @@ |
||
| 53 | 53 | public function set($object, $value): void |
| 54 | 54 | { |
| 55 | 55 | if (null === $this->setter) { |
| 56 | - $this->setter = Closure::bind(function ($object, $value, string $propertyName) { |
|
| 56 | + $this->setter = Closure::bind(function($object, $value, string $propertyName) { |
|
| 57 | 57 | $object->{$propertyName} = $value; |
| 58 | 58 | }, null, $this->className); |
| 59 | 59 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function get($object) |
| 61 | 61 | { |
| 62 | 62 | if (null === $this->getter) { |
| 63 | - $this->getter = Closure::bind(function ($object, string $propertyName) { |
|
| 63 | + $this->getter = Closure::bind(function($object, string $propertyName) { |
|
| 64 | 64 | return $object->{$propertyName}; |
| 65 | 65 | }, null, $this->className); |
| 66 | 66 | } |
@@ -354,11 +354,11 @@ |
||
| 354 | 354 | $result = '$'; |
| 355 | 355 | foreach ($this->stack as $index => $item) { |
| 356 | 356 | if ($item instanceof ArrayIterator && isset($this->pathIndices[$index])) { |
| 357 | - $result .= '['.$this->pathIndices[$index].']'; |
|
| 357 | + $result .= '[' . $this->pathIndices[$index] . ']'; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | if ($item instanceof JsonObjectIterator && isset($this->pathNames[$index])) { |
| 361 | - $result .= '.'.$this->pathNames[$index]; |
|
| 361 | + $result .= '.' . $this->pathNames[$index]; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | $token = JsonToken::BEGIN_ARRAY; |
| 167 | 167 | break; |
| 168 | 168 | case JsonNull::class: |
| 169 | - $token = JsonToken::NULL; |
|
| 169 | + $token = JsonToken::null; |
|
| 170 | 170 | break; |
| 171 | 171 | case JsonObject::class: |
| 172 | 172 | $token = JsonToken::BEGIN_OBJECT; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function asString(): string |
| 106 | 106 | { |
| 107 | - return (string) $this->value; |
|
| 107 | + return (string)$this->value; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function asInteger(): int |
| 116 | 116 | { |
| 117 | - return (int) $this->value; |
|
| 117 | + return (int)$this->value; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function asFloat(): float |
| 126 | 126 | { |
| 127 | - return (float) $this->value; |
|
| 127 | + return (float)$this->value; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function asBoolean(): bool |
| 136 | 136 | { |
| 137 | - return (bool) $this->value; |
|
| 137 | + return (bool)$this->value; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | |
| 79 | 79 | $this->write($writer, $var); |
| 80 | 80 | |
| 81 | - return (string) $writer; |
|
| 81 | + return (string)$writer; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | */ |
| 137 | 137 | public function getTypeName(): string |
| 138 | 138 | { |
| 139 | - return (string) $this->type; |
|
| 139 | + return (string)$this->type; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | return JsonPrimitive::create($reader->nextDouble()); |
| 60 | 60 | case JsonToken::BOOLEAN: |
| 61 | 61 | return JsonPrimitive::create($reader->nextBoolean()); |
| 62 | - case JsonToken::NULL: |
|
| 62 | + case JsonToken::null: |
|
| 63 | 63 | $reader->nextNull(); |
| 64 | 64 | |
| 65 | 65 | return new JsonNull(); |
@@ -211,11 +211,11 @@ |
||
| 211 | 211 | $result = '$'; |
| 212 | 212 | foreach ($this->stack as $index => $item) { |
| 213 | 213 | if ($item instanceof ArrayIterator && isset($this->pathIndices[$index])) { |
| 214 | - $result .= '['.$this->pathIndices[$index].']'; |
|
| 214 | + $result .= '[' . $this->pathIndices[$index] . ']'; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if ($item instanceof StdClassIterator && isset($this->pathNames[$index])) { |
| 218 | - $result .= '.'.$this->pathNames[$index]; |
|
| 218 | + $result .= '.' . $this->pathNames[$index]; |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | case 'boolean': |
| 171 | 171 | return JsonToken::BOOLEAN; |
| 172 | 172 | case 'NULL': |
| 173 | - $token = JsonToken::NULL; |
|
| 173 | + $token = JsonToken::null; |
|
| 174 | 174 | break; |
| 175 | 175 | case StdClassIterator::class: |
| 176 | 176 | /** @var StdClassIterator $element */ |
@@ -66,8 +66,8 @@ |
||
| 66 | 66 | case JsonToken::NUMBER: |
| 67 | 67 | $type = new TypeToken(TypeToken::FLOAT); |
| 68 | 68 | break; |
| 69 | - case JsonToken::NULL: |
|
| 70 | - $type = new TypeToken(TypeToken::NULL); |
|
| 69 | + case JsonToken::null: |
|
| 70 | + $type = new TypeToken(TypeToken::null); |
|
| 71 | 71 | break; |
| 72 | 72 | default: |
| 73 | 73 | throw new JsonSyntaxException( |