From 6da6b4f796b25873f0bd87dbd70a67117e183441 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 21 Apr 2024 18:33:31 +0200 Subject: [PATCH 1/4] Raise min phpcs version to 8.2 --- phpcs.xml.dist | 2 +- src/Reflection/Adapter/ReflectionIntersectionType.php | 1 - src/Reflection/ReflectionIntersectionType.php | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 6ae1e8221..e3c05ea90 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,6 +1,6 @@ - + diff --git a/src/Reflection/Adapter/ReflectionIntersectionType.php b/src/Reflection/Adapter/ReflectionIntersectionType.php index 1739671f4..17cbbff1d 100644 --- a/src/Reflection/Adapter/ReflectionIntersectionType.php +++ b/src/Reflection/Adapter/ReflectionIntersectionType.php @@ -35,7 +35,6 @@ public function __toString(): string return $this->betterReflectionType->__toString(); } - /** @return false */ public function allowsNull(): bool { return $this->betterReflectionType->allowsNull(); diff --git a/src/Reflection/ReflectionIntersectionType.php b/src/Reflection/ReflectionIntersectionType.php index 3fb768d19..acc820ec3 100644 --- a/src/Reflection/ReflectionIntersectionType.php +++ b/src/Reflection/ReflectionIntersectionType.php @@ -53,7 +53,6 @@ public function getTypes(): array return $this->types; } - /** @return false */ public function allowsNull(): bool { return false; From b2751edd1f62cd6f54bdc43b5e0b979a89dc23c4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 21 Apr 2024 18:44:13 +0200 Subject: [PATCH 2/4] Update psalm-baseline.xml --- psalm-baseline.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ebbe9d5a5..5628f7575 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,13 @@ + + + betterReflectionType->allowsNull()]]> + + + + + From fce3bdd2e32bf29cc0ca864656009ae7d2581a60 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 21 Apr 2024 20:00:56 +0200 Subject: [PATCH 3/4] use native types --- psalm-baseline.xml | 8 -------- src/Reflection/Adapter/ReflectionIntersectionType.php | 2 +- src/Reflection/ReflectionIntersectionType.php | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5628f7575..ebbe9d5a5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,13 +1,5 @@ - - - betterReflectionType->allowsNull()]]> - - - - - diff --git a/src/Reflection/Adapter/ReflectionIntersectionType.php b/src/Reflection/Adapter/ReflectionIntersectionType.php index 17cbbff1d..c8e4b4dd1 100644 --- a/src/Reflection/Adapter/ReflectionIntersectionType.php +++ b/src/Reflection/Adapter/ReflectionIntersectionType.php @@ -35,7 +35,7 @@ public function __toString(): string return $this->betterReflectionType->__toString(); } - public function allowsNull(): bool + public function allowsNull(): false { return $this->betterReflectionType->allowsNull(); } diff --git a/src/Reflection/ReflectionIntersectionType.php b/src/Reflection/ReflectionIntersectionType.php index acc820ec3..cd17fa3dd 100644 --- a/src/Reflection/ReflectionIntersectionType.php +++ b/src/Reflection/ReflectionIntersectionType.php @@ -53,7 +53,7 @@ public function getTypes(): array return $this->types; } - public function allowsNull(): bool + public function allowsNull(): false { return false; } From b33af20920a0bf3785c1e9a7d0fd9d9460a0ec50 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 21 Apr 2024 20:08:54 +0200 Subject: [PATCH 4/4] fix test --- test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php b/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php index 40d8d0e92..0cb2f62c3 100644 --- a/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php +++ b/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php @@ -43,7 +43,7 @@ public static function methodExpectationProvider(): array { return [ ['__toString', null, 'int|string', []], - ['allowsNull', null, true, []], + ['allowsNull', null, false, []], ['getTypes', null, [], []], ]; }