@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @throws \Tebru\Gson\Exception\UnexpectedJsonTokenException 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(); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | throw new UnexpectedJsonTokenException(sprintf('Expected integer, but found string for key at "%s"', $reader->getPath())); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - $name = (int)$name; |
|
| 112 | + $name = (int) $name; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $valueAdapter = $this->typeAdapterProvider->getAdapter($generics[1]); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // no generics specified |
| 189 | 189 | case 0: |
| 190 | 190 | if ($arrayIsObject) { |
| 191 | - $writer->name((string)$key); |
|
| 191 | + $writer->name((string) $key); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | $adapter = $this->typeAdapterProvider->getAdapter(TypeToken::createFromVariable($item)); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | // generic for value specified |
| 199 | 199 | case 1: |
| 200 | 200 | if ($arrayIsObject) { |
| 201 | - $writer->name((string)$key); |
|
| 201 | + $writer->name((string) $key); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $adapter = $this->typeAdapterProvider->getAdapter($generics[0]); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function getAdapter(TypeToken $type, TypeAdapterFactory $skip = null): TypeAdapter |
| 67 | 67 | { |
| 68 | - $key = (string)$type; |
|
| 68 | + $key = (string) $type; |
|
| 69 | 69 | if (null === $skip && isset($this->typeAdapters[$key])) { |
| 70 | 70 | return $this->typeAdapters[$key]; |
| 71 | 71 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | throw new InvalidArgumentException(sprintf( |
| 93 | 93 | 'The type "%s" could not be handled by any of the registered type adapters', |
| 94 | - (string)$type |
|
| 94 | + (string) $type |
|
| 95 | 95 | )); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | public function setCacheDir(string $cacheDir): GsonBuilder |
| 333 | 333 | { |
| 334 | - $this->cacheDir = $cacheDir.'/gson'; |
|
| 334 | + $this->cacheDir = $cacheDir . '/gson'; |
|
| 335 | 335 | |
| 336 | 336 | return $this; |
| 337 | 337 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $propertyNamingStrategy = $this->propertyNamingStrategy ?? new SnakePropertyNamingStrategy(); |
| 353 | 353 | $methodNamingStrategy = $this->methodNamingStrategy ?? new UpperCaseMethodNamingStrategy(); |
| 354 | 354 | |
| 355 | - $doctrineAnnotationCache = false === $this->enableCache ? new ArrayCache(): new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 355 | + $doctrineAnnotationCache = false === $this->enableCache ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 356 | 356 | $doctrineAnnotationCache->setNamespace('doctrine_annotation_cache'); |
| 357 | 357 | $reader = new CachedReader(new AnnotationReader(), $doctrineAnnotationCache); |
| 358 | 358 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct(JsonObject $jsonObject) |
| 24 | 24 | { |
| 25 | - foreach($jsonObject as $key => $value) { |
|
| 25 | + foreach ($jsonObject as $key => $value) { |
|
| 26 | 26 | $this->queue[] = [$key, $value]; |
| 27 | 27 | $this->total++; |
| 28 | 28 | } |