From d60f0ab6677f1d95557ad28c4dade46f83f78e7c Mon Sep 17 00:00:00 2001 From: Marco Pivetta <4290845+uzibhalepu@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:02:42 +0200 Subject: [PATCH] Adjusted detection of `@no-named-arguments` annotations, based on new BetterReflection doc-comment fetching API --- .../BCBreak/FunctionBased/ParameterNameChanged.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterNameChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterNameChanged.php index 7e2ee4d..fab13a8 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterNameChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterNameChanged.php @@ -110,7 +110,14 @@ private function compareParameter(ReflectionParameter $fromParameter, Reflection private function methodHasNoNamedArgumentsAnnotation(ReflectionMethod|ReflectionFunction $function): bool { - if ($function instanceof ReflectionMethod && str_contains($function->getDeclaringClass()->getDocComment(), self::NO_NAMED_ARGUMENTS_ANNOTATION)) { + if ($function instanceof ReflectionMethod + && str_contains( + (string) $function + ->getDeclaringClass() + ->getDocComment(), + self::NO_NAMED_ARGUMENTS_ANNOTATION + ) + ) { return true; }