From f72567fdae2f80d629e5a35abea9b73b4b5ee329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 1 Dec 2024 18:02:49 +0100 Subject: [PATCH] Fix: Use more generic return type declaration --- src/Methods/NoParameterWithContainerTypeDeclarationRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Methods/NoParameterWithContainerTypeDeclarationRule.php b/src/Methods/NoParameterWithContainerTypeDeclarationRule.php index 397914d6..0e282050 100644 --- a/src/Methods/NoParameterWithContainerTypeDeclarationRule.php +++ b/src/Methods/NoParameterWithContainerTypeDeclarationRule.php @@ -150,7 +150,7 @@ private static function createError( string $methodName, string $parameterName, Reflection\ClassReflection $classUsedInTypeDeclaration - ): Rules\IdentifierRuleError { + ): Rules\RuleError { if ($classReflection->isAnonymous()) { $ruleErrorBuilder = Rules\RuleErrorBuilder::message(\sprintf( 'Method %s() in anonymous class has a parameter $%s with a type declaration of %s, but containers should not be injected.',