@@ -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 | /** |
@@ -48,12 +48,12 @@ |
||
48 | 48 | if (null !== $setterMethod && [] !== $setterMethod->getParameters()) { |
49 | 49 | $parameter = $setterMethod->getParameters()[0]; |
50 | 50 | if (null !== $parameter->getType()) { |
51 | - return new TypeToken((string) $parameter->getType()); |
|
51 | + return new TypeToken((string)$parameter->getType()); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | if (null !== $getterMethod && null !== $getterMethod->getReturnType()) { |
56 | - return new TypeToken((string) $getterMethod->getReturnType()); |
|
56 | + return new TypeToken((string)$getterMethod->getReturnType()); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | if (null !== $setterMethod && [] !== $setterMethod->getParameters()) { |
@@ -112,8 +112,7 @@ |
||
112 | 112 | AnnotationSet $annotations, |
113 | 113 | int $modifiers, |
114 | 114 | bool $virtual |
115 | - ) |
|
116 | - { |
|
115 | + ) { |
|
117 | 116 | $this->realName = $realName; |
118 | 117 | $this->serializedName = $serializedName; |
119 | 118 | $this->type = $type; |
@@ -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 | /** |
@@ -88,8 +88,7 @@ |
||
88 | 88 | ClassMetadata $classMetadata, |
89 | 89 | AnnotationSet $annotations, |
90 | 90 | bool $virtual |
91 | - ) |
|
92 | - { |
|
91 | + ) { |
|
93 | 92 | $this->name = $name; |
94 | 93 | $this->serializedName = $serializedName; |
95 | 94 | $this->type = $type; |
@@ -160,7 +160,7 @@ |
||
160 | 160 | */ |
161 | 161 | public function nextNull() |
162 | 162 | { |
163 | - $this->expect(JsonToken::NULL); |
|
163 | + $this->expect(JsonToken::null); |
|
164 | 164 | |
165 | 165 | $this->pop(); |
166 | 166 |
@@ -56,7 +56,7 @@ discard block |
||
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 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // If there is a nested object, continue deserializing to an array, |
83 | 83 | // otherwise guess the type using the wildcard |
84 | 84 | $type = $reader->peek() === JsonToken::BEGIN_OBJECT |
85 | - ? new TypeToken(TypeToken::ARRAY) |
|
85 | + ? new TypeToken(TypeToken::array) |
|
86 | 86 | : new TypeToken(TypeToken::WILDCARD); |
87 | 87 | |
88 | 88 | $adapter = $this->typeAdapterProvider->getAdapter($type); |
@@ -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(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function read(JsonReadable $reader): ?bool |
28 | 28 | { |
29 | - if ($reader->peek() === JsonToken::NULL) { |
|
29 | + if ($reader->peek() === JsonToken::null) { |
|
30 | 30 | return $reader->nextNull(); |
31 | 31 | } |
32 | 32 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param JsonReadable $reader |
25 | 25 | * @return bool|null |
26 | 26 | */ |
27 | - public function read(JsonReadable $reader): ?bool |
|
27 | + public function read(JsonReadable $reader): ? bool |
|
28 | 28 | { |
29 | 29 | if ($reader->peek() === JsonToken::NULL) { |
30 | 30 | return $reader->nextNull(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function read(JsonReadable $reader): ?string |
28 | 28 | { |
29 | - if ($reader->peek() === JsonToken::NULL) { |
|
29 | + if ($reader->peek() === JsonToken::null) { |
|
30 | 30 | return $reader->nextNull(); |
31 | 31 | } |
32 | 32 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param JsonReadable $reader |
25 | 25 | * @return string|null |
26 | 26 | */ |
27 | - public function read(JsonReadable $reader): ?string |
|
27 | + public function read(JsonReadable $reader): ? string |
|
28 | 28 | { |
29 | 29 | if ($reader->peek() === JsonToken::NULL) { |
30 | 30 | return $reader->nextNull(); |