Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class AddMissingVarNameFixer extends AbstractDocBlockFixer
/**
* @see https://regex101.com/r/s1UkZs/1
*/
private const string VAR_WITHOUT_NAME_REGEX = '#^(?<open>\/\*\* @(?:psalm-|phpstan-)?var )(?<type>[\\\\\w\|-|]+)(?<close>\s+\*\/)$#';
private const string VAR_WITHOUT_NAME_REGEX = '#^(?<open>\/\*\* @(?:psalm-|phpstan-)?var )(?<type>[\\\\\w\|\[\]-]+)(?<close>\s+\*\/)$#';

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

function arrayItems()
{
/** @var int[] */
$values = [1000];
}

?>
-----
<?php

function arrayItems()
{
/** @var int[] $values */
$values = [1000];
}

?>
Loading