From 3eb8a095144a8c8f30844a9f061331a291b3d2c0 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Wed, 8 Jan 2025 19:04:11 +0300 Subject: [PATCH] refactor: Fix phpstan expr.resultUnused (#9385) --- tests/system/Cookie/CookieTest.php | 2 +- tests/system/Entity/EntityTest.php | 2 +- utils/phpstan-baseline/expr.resultUnused.neon | 13 ------------- utils/phpstan-baseline/loader.neon | 1 - 4 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 utils/phpstan-baseline/expr.resultUnused.neon diff --git a/tests/system/Cookie/CookieTest.php b/tests/system/Cookie/CookieTest.php index 51016ca0061e..f51ce668961f 100644 --- a/tests/system/Cookie/CookieTest.php +++ b/tests/system/Cookie/CookieTest.php @@ -303,7 +303,7 @@ public function testArrayAccessOfCookie(): void $this->assertSame($cookie['path'], $cookie->getPath()); $this->expectException('InvalidArgumentException'); - $cookie['expiry']; + $cookie['expiry']; // @phpstan-ignore expr.resultUnused } public function testCannotSetPropertyViaArrayAccess(): void diff --git a/tests/system/Entity/EntityTest.php b/tests/system/Entity/EntityTest.php index 8dd7ceac31fa..6998ea48898d 100644 --- a/tests/system/Entity/EntityTest.php +++ b/tests/system/Entity/EntityTest.php @@ -479,7 +479,7 @@ public function testCastTimestampException(): void $entity = $this->getCastEntity(); $entity->ninth = 'some string'; - $entity->ninth; + $entity->ninth; // @phpstan-ignore expr.resultUnused } public function testCastArray(): void diff --git a/utils/phpstan-baseline/expr.resultUnused.neon b/utils/phpstan-baseline/expr.resultUnused.neon deleted file mode 100644 index 84f784824617..000000000000 --- a/utils/phpstan-baseline/expr.resultUnused.neon +++ /dev/null @@ -1,13 +0,0 @@ -# total 2 errors - -parameters: - ignoreErrors: - - - message: '#^Expression "\$cookie\[''expiry''\]" on a separate line does not do anything\.$#' - count: 1 - path: ../../tests/system/Cookie/CookieTest.php - - - - message: '#^Expression "\$entity\-\>ninth" on a separate line does not do anything\.$#' - count: 1 - path: ../../tests/system/Entity/EntityTest.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index a80c14474bf8..355d8662498a 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -14,7 +14,6 @@ includes: - deadCode.unreachable.neon - empty.notAllowed.neon - empty.property.neon - - expr.resultUnused.neon - function.alreadyNarrowedType.neon - generator.valueType.neon - isset.offset.neon