Skip to content

Commit 1abf783

Browse files
committed
stanning
1 parent 05e9eed commit 1abf783

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

tests/PHPStan/Printer/PrinterTest.php

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function nowdoc(string $str): string
7777

7878
// take the ws from the first line and subtract them from all lines
7979
$matches = [];
80-
\preg_match('/(^[ \t]+)/', $lines[0], $matches);
80+
\preg_match('/(^[ \t]+)/', $lines[0] ?? '', $matches);
8181

8282
$numLines = \count($lines);
8383
for ($i = 0; $i < $numLines; ++$i) {
@@ -1010,31 +1010,6 @@ public function enterNode(Node $node)
10101010
*/'),
10111011
$addItemsToObjectShape,
10121012
];
1013-
$addCommentedItemsToMultilineObjectShape = new class extends AbstractNodeVisitor {
1014-
1015-
public function enterNode(Node $node)
1016-
{
1017-
if ($node instanceof ObjectShapeNode) {
1018-
$node = new ObjectShapeItemNode(new IdentifierTypeNode('foo'), false, new IdentifierTypeNode('int'));
1019-
$node->setAttribute(Attribute::COMMENTS, [new Comment('// bar')]);
1020-
$node->items[] = $node;
1021-
}
1022-
1023-
return $node;
1024-
}
1025-
};
1026-
1027-
yield [
1028-
'/**
1029-
* @return object{}
1030-
*/',
1031-
'/**
1032-
* @return object{foo: int}
1033-
*/',
1034-
$addCommentedItemsToMultilineObjectShape,
1035-
];
1036-
1037-
10381013

10391014
$addItemsToConstExprArray = new class extends AbstractNodeVisitor {
10401015

0 commit comments

Comments
 (0)