@@ -287,15 +287,15 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | if ($type instanceof ObjectType) { |
| 290 | - return ($isNullable?'?':'').'\\'.$type->describe(VerbosityLevel::typeOnly()); |
|
| 290 | + return ($isNullable ? '?' : '').'\\'.$type->describe(VerbosityLevel::typeOnly()); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | if ($type instanceof ArrayType) { |
| 294 | - return ($isNullable?'?':'').'array'; |
|
| 294 | + return ($isNullable ? '?' : '').'array'; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | if ($this->isNativeType($type)) { |
| 298 | - return ($isNullable?'?':'').$type->describe(VerbosityLevel::typeOnly()); |
|
| 298 | + return ($isNullable ? '?' : '').$type->describe(VerbosityLevel::typeOnly()); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | // TODO: more definitions to add here |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | private function typesWithoutNullable(Type $docBlockTypeHints): Type |
| 346 | 346 | { |
| 347 | 347 | if ($docBlockTypeHints instanceof UnionType) { |
| 348 | - $filteredTypes = array_values(array_filter($docBlockTypeHints->getTypes(), function (Type $item) { |
|
| 348 | + $filteredTypes = array_values(array_filter($docBlockTypeHints->getTypes(), function(Type $item) { |
|
| 349 | 349 | return !$item instanceof NullType; |
| 350 | 350 | })); |
| 351 | 351 | if (\count($filteredTypes) === 1) { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | // Let's only apply the filter to \Exception, \RuntimeException or \Throwable |
| 37 | 37 | $elected = false; |
| 38 | 38 | foreach ($node->types as $type) { |
| 39 | - if (in_array((string)$type, [Exception::class, RuntimeException::class, Throwable::class], true)) { |
|
| 39 | + if (in_array((string) $type, [Exception::class, RuntimeException::class, Throwable::class], true)) { |
|
| 40 | 40 | $elected = true; |
| 41 | 41 | break; |
| 42 | 42 | } |