@@ -28,7 +28,7 @@ |
||
28 | 28 | * Read the next value, convert it to its type and return it |
29 | 29 | * |
30 | 30 | * @param JsonReadable $reader |
31 | - * @return mixed |
|
31 | + * @return JsonElement |
|
32 | 32 | * @throws \LogicException If the token can not be handled |
33 | 33 | */ |
34 | 34 | public function read(JsonReadable $reader): JsonElement |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * Read the next value, convert it to its type and return it |
23 | 23 | * |
24 | 24 | * @param JsonReadable $reader |
25 | - * @return mixed |
|
25 | + * @return null|string |
|
26 | 26 | */ |
27 | 27 | public function read(JsonReadable $reader): ?string |
28 | 28 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param JsonReadable $reader |
25 | 25 | * @return mixed |
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(); |
@@ -48,6 +48,6 @@ discard block |
||
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
51 | - $writer->writeString((string)$value); |
|
51 | + $writer->writeString((string) $value); |
|
52 | 52 | } |
53 | 53 | } |
@@ -94,6 +94,7 @@ |
||
94 | 94 | * Sets whether nulls are serialized |
95 | 95 | * |
96 | 96 | * @param bool $serializeNull |
97 | + * @return void |
|
97 | 98 | */ |
98 | 99 | public function setSerializeNull(bool $serializeNull): void; |
99 | 100 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function setCacheDir(string $cacheDir): GsonBuilder |
316 | 316 | { |
317 | - $this->cacheDir = $cacheDir.'/gson'; |
|
317 | + $this->cacheDir = $cacheDir . '/gson'; |
|
318 | 318 | |
319 | 319 | return $this; |
320 | 320 | } |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | $propertyNamingStrategy = $this->propertyNamingStrategy ?? new SnakePropertyNamingStrategy(); |
336 | 336 | $methodNamingStrategy = $this->methodNamingStrategy ?? new UpperCaseMethodNamingStrategy(); |
337 | 337 | |
338 | - $doctrineAnnotationCache = false === $this->enableCache ? new ArrayCache(): new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
338 | + $doctrineAnnotationCache = false === $this->enableCache ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
339 | 339 | $doctrineAnnotationCache->setNamespace('doctrine_annotation_cache'); |
340 | 340 | $reader = new CachedReader(new AnnotationReader(), $doctrineAnnotationCache); |
341 | 341 | |
342 | 342 | $cache = false === $this->enableCache ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
343 | 343 | $cache->setNamespace('property_collection_cache'); |
344 | 344 | |
345 | - $annotationCache = false === $this->enableCache ? new ArrayCache(): new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
345 | + $annotationCache = false === $this->enableCache ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
346 | 346 | $annotationCache->setNamespace('annotation_cache'); |
347 | 347 | |
348 | 348 | $typeAdapterCache = new ArrayCache(); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @return string |
202 | 202 | */ |
203 | - public function getType(): ?string |
|
203 | + public function getType(): ? string |
|
204 | 204 | { |
205 | 205 | return $this->isObject() ? $this->class : $this->fullType; |
206 | 206 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | { |
316 | 316 | return [] === $this->options |
317 | 317 | ? $this->fullType |
318 | - : $this->fullType.serialize($this->options); |
|
318 | + : $this->fullType . serialize($this->options); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - public function getType(): ?string; |
|
31 | + public function getType(): ? string; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Returns true if the type matches the class, parent, full type, or one of the interfaces |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @param string $name |
52 | 52 | * @return Property|null |
53 | 53 | */ |
54 | - public function getBySerializedName(string $name): ?Property |
|
54 | + public function getBySerializedName(string $name): ? Property |
|
55 | 55 | { |
56 | 56 | if (!isset($this->elements[$name])) { |
57 | 57 | return null; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | ); |
174 | 174 | } |
175 | 175 | |
176 | - return (float)$this->pop(); |
|
176 | + return (float) $this->pop(); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | ); |
191 | 191 | } |
192 | 192 | |
193 | - return (int)$this->pop(); |
|
193 | + return (int) $this->pop(); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function __construct(JsonObject $jsonObject) |
25 | 25 | { |
26 | 26 | $this->queue = new SplQueue(); |
27 | - foreach($jsonObject as $key => $value) { |
|
27 | + foreach ($jsonObject as $key => $value) { |
|
28 | 28 | $this->queue[] = [$key, $value]; |
29 | 29 | $this->total++; |
30 | 30 | } |