Skip to content

Commit 0349ca3

Browse files
committed
Fix inline sniff.
1 parent 56eb225 commit 0349ca3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

PhpCollective/Sniffs/Commenting/InlineDocBlockSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected function findErrors(File $phpCsFile, int $contentIndex, bool $isSingle
215215
$errors['space-before-end'] = 'Expected single space before ´*/´';
216216
}
217217

218-
if (!preg_match('|^\$[a-z0-9]+$|i', $contentMatches[3])) {
218+
if (!preg_match('|^\$[a-z0-9_]+$|i', $contentMatches[3])) {
219219
$errors['order'] = 'Expected `{Type} ${var}`, got `' . $contentMatches[1] . $contentMatches[2] . $contentMatches[3] . '`';
220220
}
221221

tests/_data/InlineDocBlock/after.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public function test()
2020
*/
2121
$foo = $_indices['x'];
2222

23+
/** @var \App\Model\Entity\LoginInstance[] $some_data */
24+
$some_data = $_indices;
25+
2326
/** @var string|null $bar */
2427
$bar = $_indices['y'];
2528

tests/_data/InlineDocBlock/before.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public function test()
2020
*/
2121
$foo = $_indices['x'];
2222

23+
/** @var \App\Model\Entity\LoginInstance[] $some_data */
24+
$some_data = $_indices;
25+
2326
/** @var string|null $bar */
2427
$bar = $_indices['y'];
2528

0 commit comments

Comments
 (0)