@@ -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 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function asString(): string |
| 106 | 106 | { |
| 107 | - return (string) $this->value; |
|
| 107 | + return (string)$this->value; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function asInteger(): int |
| 116 | 116 | { |
| 117 | - return (int) $this->value; |
|
| 117 | + return (int)$this->value; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function asFloat(): float |
| 126 | 126 | { |
| 127 | - return (float) $this->value; |
|
| 127 | + return (float)$this->value; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function asBoolean(): bool |
| 136 | 136 | { |
| 137 | - return (bool) $this->value; |
|
| 137 | + return (bool)$this->value; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | |
| 79 | 79 | $this->write($writer, $var); |
| 80 | 80 | |
| 81 | - return (string) $writer; |
|
| 81 | + return (string)$writer; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * Read the next value, convert it to its type and return it |
| 51 | 51 | * |
| 52 | 52 | * @param JsonReadable $reader |
| 53 | - * @return DateTimeInterface|null |
|
| 53 | + * @return null|DateTime |
|
| 54 | 54 | * @throws \Tebru\Gson\Exception\JsonSyntaxException If the DateTime could not be created from format |
| 55 | 55 | */ |
| 56 | 56 | public function read(JsonReadable $reader): ?DateTimeInterface |
@@ -376,7 +376,7 @@ |
||
| 376 | 376 | */ |
| 377 | 377 | public function setCacheDir(string $cacheDir): GsonBuilder |
| 378 | 378 | { |
| 379 | - $this->cacheDir = $cacheDir.'/gson'; |
|
| 379 | + $this->cacheDir = $cacheDir . '/gson'; |
|
| 380 | 380 | |
| 381 | 381 | return $this; |
| 382 | 382 | } |
@@ -78,6 +78,6 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | private function prependUpperCaseWith(string $string, string $replacement): string |
| 80 | 80 | { |
| 81 | - return \preg_replace('/(?<!^)([A-Z])/', $replacement.'\\1', $string); |
|
| 81 | + return \preg_replace('/(?<!^)([A-Z])/', $replacement . '\\1', $string); |
|
| 82 | 82 | } |
| 83 | 83 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | /** |
| 39 | 39 | * Update internal stack and stack types, appending values |
| 40 | 40 | * |
| 41 | - * @param mixed $jsonElement |
|
| 41 | + * @param JsonElement $jsonElement |
|
| 42 | 42 | */ |
| 43 | 43 | private function updateStack(JsonElement $jsonElement): void |
| 44 | 44 | { |
@@ -168,9 +168,9 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // for setters, we look for the param name as well |
| 171 | - $pattern = '/@'.$annotation.'\s+([a-zA-Z0-9|\[\]\\\\]+)'; |
|
| 171 | + $pattern = '/@' . $annotation . '\s+([a-zA-Z0-9|\[\]\\\\]+)'; |
|
| 172 | 172 | if ($parameter !== null) { |
| 173 | - $pattern .= '\s+\$'.$parameter; |
|
| 173 | + $pattern .= '\s+\$' . $parameter; |
|
| 174 | 174 | } |
| 175 | 175 | $pattern .= '/'; |
| 176 | 176 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | // return the non-null type |
| 201 | - foreach(\explode('|', $type) as $potentialType) { |
|
| 201 | + foreach (\explode('|', $type) as $potentialType) { |
|
| 202 | 202 | $potentialType = \trim($potentialType); |
| 203 | 203 | if (\strtolower($potentialType) !== 'null') { |
| 204 | 204 | return $potentialType; |
@@ -278,15 +278,15 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | // group use statement |
| 280 | 280 | if (!empty($matches['group'])) { |
| 281 | - return TypeToken::create($matches['group'].$type); |
|
| 281 | + return TypeToken::create($matches['group'] . $type); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | // grouped aliased use statement |
| 285 | 285 | if (!empty($matches['namespace']) && !empty($matches['classname'])) { |
| 286 | - return TypeToken::create($matches['namespace'].$matches['classname']); |
|
| 286 | + return TypeToken::create($matches['namespace'] . $matches['classname']); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - return TypeToken::create($namespace.'\\'.$type); |
|
| 289 | + return TypeToken::create($namespace . '\\' . $type); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |