Skip to content

Commit f44ee58

Browse files
committed
Fix property generics replacement.
1 parent ce18b20 commit f44ee58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PhpCollective/Sniffs/Commenting/DisallowArrayTypeHintSyntaxSniff.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ public function process(File $phpcsFile, $docCommentOpenPointer): void
145145
new IdentifierTypeNode($genericIdentifier),
146146
[$this->fixArrayNode($arrayTypeNode->type)],
147147
);
148-
149148
$this->fixAnnotation($phpcsFile, $annotation, $genericTypeNode);
150149

151150
continue;
@@ -177,6 +176,8 @@ protected function fixAnnotation(File $phpcsFile, Annotation $annotation, string
177176
$parameterName = $value->parameterName ?? '';
178177
$variableName = $value->variableName ?? '';
179178
$description = $value->description ?? '';
179+
$propertyName = $value->propertyName ?? '';
180+
180181
/** @var string $methodName */
181182
$methodName = $value->methodName ?? '';
182183
if ($methodName) {
@@ -188,7 +189,7 @@ protected function fixAnnotation(File $phpcsFile, Annotation $annotation, string
188189
$methodName .= '(' . implode(', ', $list) . ')';
189190
}
190191

191-
$fixedAnnotation = sprintf('%s %s %s %s %s', $fixedAnnotation, $parameterName, $variableName, $description, $methodName);
192+
$fixedAnnotation = sprintf('%s %s %s %s %s %s', $fixedAnnotation, $parameterName, $variableName, $description, $methodName, $propertyName);
192193
/** @var string $fixedAnnotation */
193194
$fixedAnnotation = preg_replace('/\s+/', ' ', trim($fixedAnnotation));
194195

0 commit comments

Comments
 (0)