From daee0943b7ab52b93ffce6d23a5064e66368f341 Mon Sep 17 00:00:00 2001 From: christopher Date: Mon, 22 Sep 2025 15:03:44 +0200 Subject: [PATCH] Implement PHPStan up to level 1 --- phpstan.neon | 7 +++++++ src/Connection/ImapConnection.php | 4 ++-- src/Support/ForwardsCalls.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..ebf7637 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + level: 1 + ignoreErrors: + - + identifier: new.static + paths: + - src \ No newline at end of file diff --git a/src/Connection/ImapConnection.php b/src/Connection/ImapConnection.php index 80c4f9e..172629c 100644 --- a/src/Connection/ImapConnection.php +++ b/src/Connection/ImapConnection.php @@ -719,7 +719,7 @@ protected function assertTaggedResponse(string $tag, ?callable $exception = null * * @template T of Response * - * @param callable(Response): bool $filter + * @param callable(T): bool $filter * @return T */ protected function assertNextResponse(callable $filter, callable $assertion, callable $exception): Response @@ -740,7 +740,7 @@ protected function assertNextResponse(callable $filter, callable $assertion, cal * * @template T of Response * - * @param callable(Response): bool $filter + * @param callable(T): bool $filter * @return T */ protected function nextResponse(callable $filter): Response diff --git a/src/Support/ForwardsCalls.php b/src/Support/ForwardsCalls.php index 377eeec..1552309 100644 --- a/src/Support/ForwardsCalls.php +++ b/src/Support/ForwardsCalls.php @@ -33,7 +33,7 @@ protected function forwardCallTo(object $object, string $method, array $paramete /** * Throw a bad method call exception for the given method. */ - protected static function throwBadMethodCallException(string $method) + protected static function throwBadMethodCallException(string $method): never { throw new BadMethodCallException(sprintf( 'Call to undefined method %s::%s()', static::class, $method