Skip to content

Commit

Permalink
Allow empty array shape
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 11, 2021
1 parent 7acf7ca commit d36852a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -25,7 +25,7 @@
"ondram/ci-detector": "^3.4.0",
"ondrejmirtes/better-reflection": "4.3.58",
"phpstan/php-8-stubs": "^0.1.21",
"phpstan/phpdoc-parser": "^0.5.4",
"phpstan/phpdoc-parser": "^0.5.5",
"react/child-process": "^0.6.1",
"react/event-loop": "^1.1",
"react/http": "^1.1",
Expand Down
19 changes: 9 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Expand Up @@ -408,6 +408,7 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5000.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/number_format.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5140.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/empty-array-shape.php');
}

/**
Expand Down
16 changes: 16 additions & 0 deletions tests/PHPStan/Analyser/data/empty-array-shape.php
@@ -0,0 +1,16 @@
<?php

namespace EmptyArrayShape;

use function PHPStan\Testing\assertType;

class Foo
{

/** @param array{} $array */
public function doFoo(array $array): void
{
assertType('array()', $array);
}

}

0 comments on commit d36852a

Please sign in to comment.