@@ -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(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @throws \LogicException If the wrong number of generics exist |
| 60 | 60 | * @throws \RuntimeException If the value is not valid |
| 61 | 61 | */ |
| 62 | - public function read(JsonReadable $reader): ?array |
|
| 62 | + public function read(JsonReadable $reader): ? array |
|
| 63 | 63 | { |
| 64 | 64 | if ($reader->peek() === JsonToken::NULL) { |
| 65 | 65 | return $reader->nextNull(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | // no generics specified |
| 190 | 190 | case 0: |
| 191 | 191 | if ($arrayIsObject) { |
| 192 | - $writer->name((string)$key); |
|
| 192 | + $writer->name((string) $key); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $adapter = $this->typeAdapterProvider->getAdapter(DefaultPhpType::createFromVariable($item)); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | // generic for value specified |
| 200 | 200 | case 1: |
| 201 | 201 | if ($arrayIsObject) { |
| 202 | - $writer->name((string)$key); |
|
| 202 | + $writer->name((string) $key); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $adapter = $this->typeAdapterProvider->getAdapter($generics[0]); |
@@ -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 |