@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ApiCompare\Comparator\Variance; |
| 6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return false; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ($type->allowsNull() && ! $comparedType->allowsNull()) { |
|
| 35 | + if ($type->allowsNull() && !$comparedType->allowsNull()) { |
|
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (strtolower($comparedTypeAsString) === 'object' && ! $type->isBuiltin()) { |
|
| 51 | + if (strtolower($comparedTypeAsString) === 'object' && !$type->isBuiltin()) { |
|
| 52 | 52 | // `object` is always contravariant to any object type |
| 53 | 53 | return true; |
| 54 | 54 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
| 6 | 6 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | return array_merge( |
| 228 | 228 | [[null]], |
| 229 | 229 | array_merge(...array_map( |
| 230 | - function (string $type) : array { |
|
| 230 | + function(string $type) : array { |
|
| 231 | 231 | return [ |
| 232 | 232 | [ReflectionType::createFromType($type, false)], |
| 233 | 233 | [ReflectionType::createFromType($type, true)], |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | /** @dataProvider existingNullableTypeStrings */ |
| 252 | 252 | public function testContravarianceConsidersNullability(string $type) : void |
| 253 | 253 | { |
| 254 | - $reflector = new ClassReflector(new StringSourceLocator( |
|
| 254 | + $reflector = new ClassReflector(new StringSourceLocator( |
|
| 255 | 255 | <<<'PHP' |
| 256 | 256 | <?php |
| 257 | 257 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | , |
| 262 | 262 | (new BetterReflection())->astLocator() |
| 263 | 263 | )); |
| 264 | - $nullable = InternalReflectionType::fromBetterReflectionTypeAndReflector( |
|
| 264 | + $nullable = InternalReflectionType::fromBetterReflectionTypeAndReflector( |
|
| 265 | 265 | ReflectionType::createFromType($type, true), |
| 266 | 266 | $reflector |
| 267 | 267 | ); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
| 6 | 6 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | return array_merge( |
| 219 | 219 | [[null]], |
| 220 | 220 | array_merge(...array_map( |
| 221 | - function (string $type) : array { |
|
| 221 | + function(string $type) : array { |
|
| 222 | 222 | return [ |
| 223 | 223 | [ReflectionType::createFromType($type, false)], |
| 224 | 224 | [ReflectionType::createFromType($type, true)], |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | (new BetterReflection())->astLocator() |
| 254 | 254 | )); |
| 255 | 255 | |
| 256 | - $nullable = InternalReflectionType::fromBetterReflectionTypeAndReflector( |
|
| 256 | + $nullable = InternalReflectionType::fromBetterReflectionTypeAndReflector( |
|
| 257 | 257 | ReflectionType::createFromType($type, true), |
| 258 | 258 | $reflector |
| 259 | 259 | ); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ApiCompare\Comparator\Variance; |
| 6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return false; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if ($comparedType->allowsNull() && ! $type->allowsNull()) { |
|
| 34 | + if ($comparedType->allowsNull() && !$type->allowsNull()) { |
|
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (strtolower($typeAsString) === 'object' && ! $comparedType->isBuiltin()) { |
|
| 50 | + if (strtolower($typeAsString) === 'object' && !$comparedType->isBuiltin()) { |
|
| 51 | 51 | // `object` is not covariant to a defined class type |
| 52 | 52 | return true; |
| 53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (strtolower($typeAsString) === 'iterable' && ! $comparedType->isBuiltin()) { |
|
| 60 | + if (strtolower($typeAsString) === 'iterable' && !$comparedType->isBuiltin()) { |
|
| 61 | 61 | /** @var ReflectionClass $comparedTypeReflectionClass */ |
| 62 | 62 | $comparedTypeReflectionClass = $comparedType->targetClass(); |
| 63 | 63 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Roave\ApiCompare\Comparator\Support; |
| 6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ?BetterReflectionType $reflectionType, |
| 33 | 33 | ClassReflector $classReflector |
| 34 | 34 | ) : ?self { |
| 35 | - if (! $reflectionType) { |
|
| 35 | + if (!$reflectionType) { |
|
| 36 | 36 | return null; |
| 37 | 37 | } |
| 38 | 38 | |