Skip to content

Commit a461737

Browse files
authored
Stricter check in RenderCallbackRule for $matches (#831)
1 parent cd9c8b9 commit a461737

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/Drupal/RenderCallbackRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private function getType(Node\Expr $node, Scope $scope): Type
324324
}
325325
// @see \PHPStan\Type\Constant\ConstantStringType::isCallable
326326
preg_match('#^([a-zA-Z_\\x7f-\\xff\\\\][a-zA-Z0-9_\\x7f-\\xff\\\\]*)::([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)\\z#', $type->getValue(), $matches);
327-
if (count($matches) > 0) {
327+
if (count($matches) === 3) {
328328
return new ConstantArrayType(
329329
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
330330
[

0 commit comments

Comments
 (0)