From e54fece4cf23d986fa0b607c7aca78dfd3ab4d1d Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Thu, 26 Oct 2023 23:11:58 +0200 Subject: [PATCH 1/2] Stop suppressing UndefinedAttributeClass --- psalm.xml.dist | 6 ------ 1 file changed, 6 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index bf91b3145..63e41ba00 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -31,12 +31,6 @@ - - - - - - From 0007188a981010646a97e62fb70618920bdda99e Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Thu, 26 Oct 2023 23:13:03 +0200 Subject: [PATCH 2/2] PHPCS is now happy with new syntax --- phpcs.xml.dist | 4 ---- .../Tests/PersistentCollection/CollWithPHP80Types.php | 9 +++++---- .../Tests/PersistentCollection/CollWithPHP81Types.php | 8 ++------ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 863d0b434..58e6074d9 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -19,10 +19,6 @@ tests/Proxies* tests/Hydrators* tests/PersistentCollections* - - tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php - - tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php diff --git a/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php b/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php index 9e2a6325a..8c6bbeb5d 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP80Types.php @@ -14,26 +14,27 @@ */ class CollWithPHP80Types extends ArrayCollection { - public function mixed(mixed $param) : mixed + public function mixed(mixed $param): mixed { return $param; } /** * @param Collection|ArrayCollection $param + * * @return Collection|ArrayCollection */ - public function union(Collection|ArrayCollection $param) : Collection|ArrayCollection + public function union(Collection|ArrayCollection $param): Collection|ArrayCollection { return $param; } - public function static() : static + public function static(): static { return $this; } - public function nullableStatic() : ?static + public function nullableStatic(): ?static { return $this; } diff --git a/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php b/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php index dfb0dca20..e28338600 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/PersistentCollection/CollWithPHP81Types.php @@ -14,16 +14,12 @@ */ class CollWithPHP81Types extends ArrayCollection { - /** - * @param Collection&ArrayCollection $param - * @return Collection&ArrayCollection - */ - public function intersection(Collection&ArrayCollection $param) : Collection&ArrayCollection + public function intersection(Collection&ArrayCollection $param): Collection&ArrayCollection { return $param; } - public function never() : never + public function never(): never { die('You shall not pass'); }