Skip to content

Commit d36852a

Browse files
committed
Allow empty array shape
1 parent 7acf7ca commit d36852a

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"ondram/ci-detector": "^3.4.0",
2626
"ondrejmirtes/better-reflection": "4.3.58",
2727
"phpstan/php-8-stubs": "^0.1.21",
28-
"phpstan/phpdoc-parser": "^0.5.4",
28+
"phpstan/phpdoc-parser": "^0.5.5",
2929
"react/child-process": "^0.6.1",
3030
"react/event-loop": "^1.1",
3131
"react/http": "^1.1",

composer.lock

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ public function dataFileAsserts(): iterable
408408
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5000.php');
409409
yield from $this->gatherAssertTypes(__DIR__ . '/data/number_format.php');
410410
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5140.php');
411+
yield from $this->gatherAssertTypes(__DIR__ . '/data/empty-array-shape.php');
411412
}
412413

413414
/**
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace EmptyArrayShape;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo
8+
{
9+
10+
/** @param array{} $array */
11+
public function doFoo(array $array): void
12+
{
13+
assertType('array()', $array);
14+
}
15+
16+
}

0 commit comments

Comments
 (0)