@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function read(JsonReadable $reader): ?DateTime |
| 52 | 52 | { |
| 53 | - if ($reader->peek() === JsonToken::NULL) { |
|
| 53 | + if ($reader->peek() === JsonToken::null) { |
|
| 54 | 54 | return $reader->nextNull(); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * @return DateTime|null |
| 51 | 51 | * @throws \Tebru\Gson\Exception\JsonSyntaxException If the DateTime could not be created from format |
| 52 | 52 | */ |
| 53 | - public function read(JsonReadable $reader): ?DateTime |
|
| 53 | + public function read(JsonReadable $reader): ? DateTime |
|
| 54 | 54 | { |
| 55 | 55 | if ($reader->peek() === JsonToken::NULL) { |
| 56 | 56 | return $reader->nextNull(); |
@@ -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(); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | */ |
| 95 | 95 | public function read(JsonReadable $reader) |
| 96 | 96 | { |
| 97 | - if ($reader->peek() === JsonToken::NULL) { |
|
| 97 | + if ($reader->peek() === JsonToken::null) { |
|
| 98 | 98 | return $reader->nextNull(); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -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 */ |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * @throws \Tebru\Gson\Exception\JsonSyntaxException If trying to read from non object/array |
| 55 | 55 | * @throws \Tebru\PhpType\Exception\MalformedTypeException If the type cannot be parsed |
| 56 | 56 | */ |
| 57 | - public function read(JsonReadable $reader): ?array |
|
| 57 | + public function read(JsonReadable $reader): ? array |
|
| 58 | 58 | { |
| 59 | 59 | if ($reader->peek() === JsonToken::NULL) { |
| 60 | 60 | return $reader->nextNull(); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function read(JsonReadable $reader): ?array |
| 58 | 58 | { |
| 59 | - if ($reader->peek() === JsonToken::NULL) { |
|
| 59 | + if ($reader->peek() === JsonToken::null) { |
|
| 60 | 60 | return $reader->nextNull(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -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( |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param string $annotationClass |
| 81 | 81 | * @return null|AbstractAnnotation |
| 82 | 82 | */ |
| 83 | - public function getAnnotation(string $annotationClass): ?AbstractAnnotation |
|
| 83 | + public function getAnnotation(string $annotationClass): ? AbstractAnnotation |
|
| 84 | 84 | { |
| 85 | 85 | return $this->annotations->get($annotationClass); |
| 86 | 86 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @param string $propertyName |
| 102 | 102 | * @return PropertyMetadata|null |
| 103 | 103 | */ |
| 104 | - public function getProperty(string $propertyName): ?PropertyMetadata |
|
| 104 | + public function getProperty(string $propertyName): ? PropertyMetadata |
|
| 105 | 105 | { |
| 106 | 106 | foreach ($this->propertyMetadata as $property) { |
| 107 | 107 | if ($property->getName() === $propertyName) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | ReflectionClass $reflectionClass, |
| 51 | 51 | ReflectionProperty $reflectionProperty, |
| 52 | 52 | AnnotationCollection $annotations |
| 53 | - ): ?ReflectionMethod { |
|
| 53 | + ): ? ReflectionMethod { |
|
| 54 | 54 | /** @var Accessor $accessorAnnotation */ |
| 55 | 55 | $accessorAnnotation = $annotations->get(Accessor::class); |
| 56 | 56 | $getters = null !== $accessorAnnotation && null !== $accessorAnnotation->getter() |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ReflectionClass $reflectionClass, |
| 74 | 74 | ReflectionProperty $reflectionProperty, |
| 75 | 75 | AnnotationCollection $annotations |
| 76 | - ): ?ReflectionMethod { |
|
| 76 | + ): ? ReflectionMethod { |
|
| 77 | 77 | /** @var Accessor $accessorAnnotation */ |
| 78 | 78 | $accessorAnnotation = $annotations->get(Accessor::class); |
| 79 | 79 | $setters = null !== $accessorAnnotation && null !== $accessorAnnotation->setter() |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param array $accessors |
| 92 | 92 | * @return null|ReflectionMethod |
| 93 | 93 | */ |
| 94 | - private function reflectionClassMethod(ReflectionClass $reflectionClass, array $accessors): ?ReflectionMethod |
|
| 94 | + private function reflectionClassMethod(ReflectionClass $reflectionClass, array $accessors): ? ReflectionMethod |
|
| 95 | 95 | { |
| 96 | 96 | foreach ($accessors as $method) { |
| 97 | 97 | if (!$reflectionClass->hasMethod($method)) { |
@@ -113,8 +113,7 @@ |
||
| 113 | 113 | AnnotationCollection $annotations, |
| 114 | 114 | int $modifiers, |
| 115 | 115 | bool $virtual |
| 116 | - ) |
|
| 117 | - { |
|
| 116 | + ) { |
|
| 118 | 117 | $this->realName = $realName; |
| 119 | 118 | $this->serializedName = $serializedName; |
| 120 | 119 | $this->type = $type; |