Skip to content

Commit

Permalink
Fix uncaught LogicException from phpdoc-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 14, 2022
1 parent 5276c8b commit b95949a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -25,7 +25,7 @@
"ondram/ci-detector": "^3.4.0",
"ondrejmirtes/better-reflection": "5.3.0.3",
"phpstan/php-8-stubs": "0.1.52",
"phpstan/phpdoc-parser": "^1.4.3",
"phpstan/phpdoc-parser": "^1.4.4",
"react/child-process": "^0.6.4",
"react/event-loop": "^1.2",
"react/http": "^1.1",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

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

10 changes: 9 additions & 1 deletion tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Expand Up @@ -680,7 +680,15 @@ public function testBug6979(): void
$errors = $this->runAnalyse(__DIR__ . '/data/bug-6979.php');
$this->assertNoErrors($errors);
}


public function testBug7030(): void
{
$errors = $this->runAnalyse(__DIR__ . '/data/bug-7030.php');
$this->assertCount(1, $errors);
$this->assertSame('PHPDoc tag @method has invalid value (array getItemsForID($id, $quantity, $shippingPostCode = null, $wholesalerList = null, $shippingLatitude =
null, $shippingLongitude = null, $shippingNeutralShipping = null)): Unexpected token "\n * ", expected type at offset 193', $errors[0]->getMessage());
}

/**
* @param string[]|null $allAnalysedFiles
* @return Error[]
Expand Down
18 changes: 18 additions & 0 deletions tests/PHPStan/Analyser/data/bug-7030.php
@@ -0,0 +1,18 @@
<?php

namespace Bug7030;

/**
* Class Rest_DIContainer_Products
*
* @codingStandardsIgnoreStart
*
* @method array getItemsForID($id, $quantity, $shippingPostCode = null, $wholesalerList = null, $shippingLatitude =
* null, $shippingLongitude = null, $shippingNeutralShipping = null)
*
* @codingStandardsIgnoreEnd
*/
class Rest_DIContainer_Products
{

}

0 comments on commit b95949a

Please sign in to comment.