diff --git a/src/Visitor.php b/src/Visitor.php index f8d1839..a85e8b4 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -676,7 +676,7 @@ private static function getTypeNameFromString(string $tagVariable): ?string { // PHPStan doesn't support typed array shapes (`int[]{...}`) so replace // typed arrays such as `int[]` with `array`. - $tagVariableType = preg_replace('#[a-zA-Z0-9_]+\[\]#', 'array', $tagVariable); + $tagVariableType = preg_replace('#[a-zA-Z0-9_]+(?:\[\])+#', 'array', $tagVariable); if ($tagVariableType === null) { return null; diff --git a/wordpress-stubs.php b/wordpress-stubs.php index c71fca8..ee9fee4 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -66299,7 +66299,7 @@ public function __construct() * @param array[][] $fonts Optional. The font-families and their font variations. * See {@see wp_print_font_faces()} for the supported fields. * Default empty array. - * @phpstan-param array[]