From 041d3141900541decdff0a9b88ccfd871d3d34a9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 5 Aug 2021 20:11:58 +0100 Subject: [PATCH] HandlerListManager: apply class-string type for getListFor() parameter --- src/event/HandlerListManager.php | 3 +++ tests/phpstan/configs/impossible-generics.neon | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/event/HandlerListManager.php b/src/event/HandlerListManager.php index 942b79467..3bed7631c 100644 --- a/src/event/HandlerListManager.php +++ b/src/event/HandlerListManager.php @@ -84,6 +84,9 @@ class HandlerListManager{ * * Calling this method also lazily initializes the $classMap inheritance tree of handler lists. * + * @phpstan-template TEvent of Event + * @phpstan-param class-string $event + * * @throws \ReflectionException * @throws \InvalidArgumentException */ diff --git a/tests/phpstan/configs/impossible-generics.neon b/tests/phpstan/configs/impossible-generics.neon index 93ca7da79..0281bcd7f 100644 --- a/tests/phpstan/configs/impossible-generics.neon +++ b/tests/phpstan/configs/impossible-generics.neon @@ -1,15 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Parameter \\#1 \\$class of static method pocketmine\\\\event\\\\HandlerListManager\\:\\:isValidClass\\(\\) expects ReflectionClass\\, ReflectionClass\\ given\\.$#" - count: 1 - path: ../../../src/event/HandlerListManager.php - - - - message: "#^Parameter \\#1 \\$class of static method pocketmine\\\\event\\\\HandlerListManager\\:\\:resolveNearestHandleableParent\\(\\) expects ReflectionClass\\, ReflectionClass\\ given\\.$#" - count: 1 - path: ../../../src/event/HandlerListManager.php - - message: "#^Method pocketmine\\\\event\\\\RegisteredListener\\:\\:__construct\\(\\) has parameter \\$handler with no signature specified for Closure\\.$#" count: 1