@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * @throws \OutOfBoundsException if the index doesn't exist |
| 60 | 60 | * @throws \LogicException If ArrayList contains more than one generic type |
| 61 | 61 | */ |
| 62 | - public function read(JsonReadable $reader): ?ArrayList |
|
| 62 | + public function read(JsonReadable $reader): ? ArrayList |
|
| 63 | 63 | { |
| 64 | 64 | if ($reader->peek() === JsonToken::NULL) { |
| 65 | 65 | return $reader->nextNull(); |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | * @throws \LogicException If there is an incorrect number of generic types |
| 58 | 58 | * @throws \Tebru\Gson\Exception\MalformedTypeException If the type cannot be parsed |
| 59 | 59 | */ |
| 60 | - public function read(JsonReadable $reader): ?HashMap |
|
| 60 | + public function read(JsonReadable $reader): ? HashMap |
|
| 61 | 61 | { |
| 62 | 62 | if ($reader->peek() === JsonToken::NULL) { |
| 63 | 63 | return $reader->nextNull(); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @param JsonReadable $reader |
| 25 | 25 | * @return float|null |
| 26 | 26 | */ |
| 27 | - public function read(JsonReadable $reader): ?float |
|
| 27 | + public function read(JsonReadable $reader): ? float |
|
| 28 | 28 | { |
| 29 | 29 | if ($reader->peek() === JsonToken::NULL) { |
| 30 | 30 | return $reader->nextNull(); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * @return DateTime|null |
| 44 | 44 | * @throws \OutOfRangeException if the key doesn't exist |
| 45 | 45 | */ |
| 46 | - public function read(JsonReadable $reader): ?DateTime |
|
| 46 | + public function read(JsonReadable $reader): ? DateTime |
|
| 47 | 47 | { |
| 48 | 48 | if ($reader->peek() === JsonToken::NULL) { |
| 49 | 49 | return $reader->nextNull(); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @param AnnotationSet $annotations |
| 47 | 47 | * @return null|ReflectionMethod |
| 48 | 48 | */ |
| 49 | - public function getterMethod(ReflectionClass $reflectionClass, ReflectionProperty $reflectionProperty, AnnotationSet $annotations): ?ReflectionMethod |
|
| 49 | + public function getterMethod(ReflectionClass $reflectionClass, ReflectionProperty $reflectionProperty, AnnotationSet $annotations): ? ReflectionMethod |
|
| 50 | 50 | { |
| 51 | 51 | /** @var Accessor $accessorAnnotation */ |
| 52 | 52 | $accessorAnnotation = $annotations->getAnnotation(Accessor::class, AnnotationSet::TYPE_PROPERTY); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @param AnnotationSet $annotations |
| 67 | 67 | * @return null|ReflectionMethod |
| 68 | 68 | */ |
| 69 | - public function setterMethod(ReflectionClass $reflectionClass, ReflectionProperty $reflectionProperty, AnnotationSet $annotations): ?ReflectionMethod |
|
| 69 | + public function setterMethod(ReflectionClass $reflectionClass, ReflectionProperty $reflectionProperty, AnnotationSet $annotations): ? ReflectionMethod |
|
| 70 | 70 | { |
| 71 | 71 | /** @var Accessor $accessorAnnotation */ |
| 72 | 72 | $accessorAnnotation = $annotations->getAnnotation(Accessor::class, AnnotationSet::TYPE_PROPERTY); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @param array $accessors |
| 86 | 86 | * @return null|ReflectionMethod |
| 87 | 87 | */ |
| 88 | - private function reflectionClassMethod(ReflectionClass $reflectionClass, array $accessors): ?ReflectionMethod |
|
| 88 | + private function reflectionClassMethod(ReflectionClass $reflectionClass, array $accessors): ? ReflectionMethod |
|
| 89 | 89 | { |
| 90 | 90 | foreach ($accessors as $method) { |
| 91 | 91 | if (!$reflectionClass->hasMethod($method)) { |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | public function set($object, $value): void |
| 54 | 54 | { |
| 55 | 55 | if (null === $this->setter) { |
| 56 | - $this->setter = Closure::bind(function ($object, $value, string $propertyName) { |
|
| 56 | + $this->setter = Closure::bind(function($object, $value, string $propertyName) { |
|
| 57 | 57 | $object->{$propertyName} = $value; |
| 58 | 58 | }, null, $this->className); |
| 59 | 59 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function get($object) |
| 61 | 61 | { |
| 62 | 62 | if (null === $this->getter) { |
| 63 | - $this->getter = Closure::bind(function ($object, string $propertyName) { |
|
| 63 | + $this->getter = Closure::bind(function($object, string $propertyName) { |
|
| 64 | 64 | return $object->{$propertyName}; |
| 65 | 65 | }, null, $this->className); |
| 66 | 66 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @return string |
| 62 | 62 | */ |
| 63 | - public function getter(): ?string |
|
| 63 | + public function getter(): ? string |
|
| 64 | 64 | { |
| 65 | 65 | return $this->get; |
| 66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return string |
| 72 | 72 | */ |
| 73 | - public function setter(): ?string |
|
| 73 | + public function setter(): ? string |
|
| 74 | 74 | { |
| 75 | 75 | return $this->set; |
| 76 | 76 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | public function setCacheDir(string $cacheDir): GsonBuilder |
| 298 | 298 | { |
| 299 | - $this->cacheDir = $cacheDir.'/gson'; |
|
| 299 | + $this->cacheDir = $cacheDir . '/gson'; |
|
| 300 | 300 | |
| 301 | 301 | return $this; |
| 302 | 302 | } |
@@ -312,14 +312,14 @@ discard block |
||
| 312 | 312 | $propertyNamingStrategy = $this->propertyNamingStrategy ?? new SnakePropertyNamingStrategy(); |
| 313 | 313 | $methodNamingStrategy = $this->methodNamingStrategy ?? new UpperCaseMethodNamingStrategy(); |
| 314 | 314 | |
| 315 | - $doctrineAnnotationCache = null === $this->cacheDir ? new ArrayCache(): new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 315 | + $doctrineAnnotationCache = null === $this->cacheDir ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 316 | 316 | $doctrineAnnotationCache->setNamespace('doctrine_annotation_cache'); |
| 317 | 317 | $reader = new CachedReader(new AnnotationReader(), $doctrineAnnotationCache); |
| 318 | 318 | |
| 319 | 319 | $cache = null === $this->cacheDir ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
| 320 | 320 | $cache->setNamespace('property_collection_cache'); |
| 321 | 321 | |
| 322 | - $annotationCache = null === $this->cacheDir ? new ArrayCache(): new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 322 | + $annotationCache = null === $this->cacheDir ? new ArrayCache() : new ChainCache([new ArrayCache(), new FilesystemCache($this->cacheDir)]); |
|
| 323 | 323 | $annotationCache->setNamespace('annotation_cache'); |
| 324 | 324 | |
| 325 | 325 | $annotationCollectionFactory = new AnnotationCollectionFactory($reader, $annotationCache); |