@@ -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; |
@@ -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 | } |
@@ -374,7 +374,7 @@ |
||
374 | 374 | /** |
375 | 375 | * Pop the last element off the stack and return it |
376 | 376 | * |
377 | - * @return JsonElement|Iterator |
|
377 | + * @return JsonObject |
|
378 | 378 | */ |
379 | 379 | private function pop() |
380 | 380 | { |
@@ -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 |