@@ -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) { |
@@ -37,8 +37,8 @@ |
||
37 | 37 | // Let's only apply the filter to \Exception, \RuntimeException or \Throwable |
38 | 38 | $exceptionType = null; |
39 | 39 | foreach ($node->types as $type) { |
40 | - if (in_array((string)$type, [Exception::class, RuntimeException::class, Throwable::class], true)) { |
|
41 | - $exceptionType = (string)$type; |
|
40 | + if (in_array((string) $type, [Exception::class, RuntimeException::class, Throwable::class], true)) { |
|
41 | + $exceptionType = (string) $type; |
|
42 | 42 | break; |
43 | 43 | } |
44 | 44 | } |