Skip to content

Commit 727887d

Browse files
committed
Stricter check in RenderCallbackRule for $matches (#831)
(cherry picked from commit a461737)
1 parent b030814 commit 727887d

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
@@ -302,7 +302,7 @@ private function getType(Node\Expr $node, Scope $scope): Type
302302
}
303303
// @see \PHPStan\Type\Constant\ConstantStringType::isCallable
304304
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);
305-
if (count($matches) > 0) {
305+
if (count($matches) === 3) {
306306
return new ConstantArrayType(
307307
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
308308
[

0 commit comments

Comments
 (0)