@@ -53,8 +53,8 @@ |
||
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $superTypeName = (string)$superTypeName; |
|
| 57 | - $subTypeName = (string)$subTypeName; |
|
| 56 | + $superTypeName = (string) $superTypeName; |
|
| 57 | + $subTypeName = (string) $subTypeName; |
|
| 58 | 58 | |
| 59 | 59 | // Sub type cannot be nullable unless the super type is as well |
| 60 | 60 | if ($subTypeNullable && !$superTypeNullable) { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * Nullable types are either explicitly ?type (PHP>=7.1) or with a default value of null |
| 14 | 14 | */ |
| 15 | - const NULLABLE = 0x02; |
|
| 15 | + const NULLABLE = 0x02; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Reference types must always match |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | protected function __construct($typeName, $flags, $allowsCovariance, $allowsContravariance) |
| 71 | 71 | { |
| 72 | 72 | $this->typeName = $typeName !== null |
| 73 | - ? (string)$typeName |
|
| 73 | + ? (string) $typeName |
|
| 74 | 74 | : null; |
| 75 | 75 | |
| 76 | - $this->isNullable = (bool)($flags & self::NULLABLE); |
|
| 77 | - $this->isByReference = (bool)($flags & self::REFERENCE); |
|
| 78 | - $this->isWeak = (bool)($flags & self::WEAK); |
|
| 79 | - $this->allowsCovariance = (bool)$allowsCovariance; |
|
| 80 | - $this->allowsContravariance = (bool)$allowsContravariance; |
|
| 76 | + $this->isNullable = (bool) ($flags & self::NULLABLE); |
|
| 77 | + $this->isByReference = (bool) ($flags & self::REFERENCE); |
|
| 78 | + $this->isWeak = (bool) ($flags & self::WEAK); |
|
| 79 | + $this->allowsCovariance = (bool) $allowsCovariance; |
|
| 80 | + $this->allowsContravariance = (bool) $allowsContravariance; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $typeReflection = $reflection->getReturnType(); |
| 31 | 31 | |
| 32 | 32 | if ($typeReflection !== null) { |
| 33 | - $typeName = (string)$typeReflection; |
|
| 33 | + $typeName = (string) $typeReflection; |
|
| 34 | 34 | |
| 35 | 35 | if ($typeReflection->allowsNull()) { |
| 36 | 36 | $flags |= self::NULLABLE; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function __construct($typeName = null, $flags = self::COVARIANT) |
| 48 | 48 | { |
| 49 | - $flags = (int)$flags; |
|
| 49 | + $flags = (int) $flags; |
|
| 50 | 50 | |
| 51 | 51 | parent::__construct($typeName, $flags, $flags & self::COVARIANT, $flags & self::CONTRAVARIANT); |
| 52 | 52 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $typeReflection = $reflection->getType(); |
| 74 | 74 | |
| 75 | 75 | if ($typeReflection !== null) { |
| 76 | - $typeName = (string)$typeReflection; |
|
| 76 | + $typeName = (string) $typeReflection; |
|
| 77 | 77 | |
| 78 | 78 | if ($typeReflection->allowsNull()) { |
| 79 | 79 | $flags |= self::NULLABLE; |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function __construct($parameterName, $typeName = null, $flags = self::CONTRAVARIANT) |
| 92 | 92 | { |
| 93 | - $flags = (int)$flags; |
|
| 93 | + $flags = (int) $flags; |
|
| 94 | 94 | |
| 95 | 95 | parent::__construct($typeName, $flags, $flags & self::COVARIANT, $flags & self::CONTRAVARIANT); |
| 96 | 96 | |
| 97 | - $this->parameterName = (string)$parameterName; |
|
| 98 | - $this->isOptional = (bool)($flags & self::OPTIONAL); |
|
| 99 | - $this->isVariadic = (bool)($flags & self::VARIADIC); |
|
| 97 | + $this->parameterName = (string) $parameterName; |
|
| 98 | + $this->isOptional = (bool) ($flags & self::OPTIONAL); |
|
| 99 | + $this->isVariadic = (bool) ($flags & self::VARIADIC); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return new \ReflectionMethod($callback, '__invoke'); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $callback = (string)$callback; |
|
| 41 | + $callback = (string) $callback; |
|
| 42 | 42 | |
| 43 | 43 | return \strpos($callback, '::') !== false |
| 44 | 44 | ? new \ReflectionMethod($callback) |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $returnType = $candidate->getReturnType(); |
| 97 | 97 | |
| 98 | 98 | if ($returnType !== null) { |
| 99 | - $typeName = (string)$returnType; |
|
| 99 | + $typeName = (string) $returnType; |
|
| 100 | 100 | $nullable = $returnType->allowsNull(); |
| 101 | 101 | } else { |
| 102 | 102 | $typeName = null; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | if ($parameter->hasType()) { |
| 116 | 116 | $type = $parameter->getType(); |
| 117 | - $typeName = (string)$type; |
|
| 117 | + $typeName = (string) $type; |
|
| 118 | 118 | $nullable = $type->allowsNull(); |
| 119 | 119 | } else { |
| 120 | 120 | $typeName = null; |