From d36852a25b531eb0f56e215d1a239ad1e01aa2cc Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Fri, 11 Jun 2021 15:28:55 +0200 Subject: [PATCH] Allow empty array shape --- composer.json | 2 +- composer.lock | 19 +++++++++---------- .../Analyser/NodeScopeResolverTest.php | 1 + .../Analyser/data/empty-array-shape.php | 16 ++++++++++++++++ 4 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 tests/PHPStan/Analyser/data/empty-array-shape.php diff --git a/composer.json b/composer.json index 718c0c84d4..19a1da5630 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/composer.lock b/composer.lock index 0363ca4e10..dd31477934 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a295c7beb6eaef75beb1a6e48e98fdde", + "content-hash": "555ef6253ee7fba140aa2dd9aac9f62c", "packages": [ { "name": "clue/block-react", @@ -2176,28 +2176,27 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "0.5.4", + "version": "0.5.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9" + "reference": "ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e352d065af1ae9b41c12d1dfd309e90f7b1f55c9", - "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c", + "reference": "ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "phing/phing": "^2.16.3", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.60", + "phpstan/phpstan": "^0.12.87", "phpstan/phpstan-strict-rules": "^0.12.5", - "phpunit/phpunit": "^7.5.20", + "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, "type": "library", @@ -2220,9 +2219,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.4" + "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.5" }, - "time": "2021-04-03T14:46:19+00:00" + "time": "2021-06-11T13:24:46+00:00" }, { "name": "psr/container", diff --git a/tests/PHPStan/Analyser/NodeScopeResolverTest.php b/tests/PHPStan/Analyser/NodeScopeResolverTest.php index 50b7028fcb..82beff8116 100644 --- a/tests/PHPStan/Analyser/NodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/NodeScopeResolverTest.php @@ -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'); } /** diff --git a/tests/PHPStan/Analyser/data/empty-array-shape.php b/tests/PHPStan/Analyser/data/empty-array-shape.php new file mode 100644 index 0000000000..4a19bf0f59 --- /dev/null +++ b/tests/PHPStan/Analyser/data/empty-array-shape.php @@ -0,0 +1,16 @@ +