Skip to content

Commit

Permalink
fix error when phpdoc param has no type
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Dec 17, 2024
1 parent f4e68e7 commit 86bf119
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CakePHP/Sniffs/Commenting/TypeHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\TypelessParamTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\ArrayShapeNode;
use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode;
Expand Down Expand Up @@ -97,7 +98,7 @@ public function process(File $phpcsFile, $stackPtr)

$tagComment = $phpcsFile->fixer->getTokenContent($tag + 2);
$valueNode = self::getValueNode($tokens[$tag]['content'], $tagComment);
if ($valueNode instanceof InvalidTagValueNode) {
if ($valueNode instanceof InvalidTagValueNode || $valueNode instanceof TypelessParamTagValueNode) {
continue;
}

Expand Down

0 comments on commit 86bf119

Please sign in to comment.