Skip to content

Commit ce2c705

Browse files
committed
Update phpdoc-parser in extractor
1 parent 474fb85 commit ce2c705

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

extractor/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"nikic/php-parser": "^5",
77
"phpstan/phpstan": "^2.1",
88
"phpstan/extension-installer": "^1.1",
9-
"phpstan/phpdoc-parser": "^1.4"
9+
"phpstan/phpdoc-parser": "^2.0"
1010
},
1111
"config": {
1212
"allow-plugins": {

extractor/composer.lock

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

extractor/extract.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use PHPStan\PhpDocParser\Parser\TokenIterator;
1313
use PHPStan\PhpDocParser\Parser\ConstExprParser;
1414
use PHPStan\PhpDocParser\Parser\TypeParser;
15+
use PHPStan\PhpDocParser\ParserConfig;
1516
use Symfony\Component\Console\Application;
1617
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\Console\Input\InputArgument;
@@ -50,11 +51,13 @@ public function __construct(
5051
parent::__construct();
5152
$this->parser = $parser;
5253
$this->printer = $printer;
53-
$this->phpDocLexer = new Lexer();
5454

55-
$constExprParser = new ConstExprParser();
56-
$typeParser = new TypeParser($constExprParser);
57-
$this->phpDocParser = new PhpDocParser($typeParser, $constExprParser);
55+
$config = new ParserConfig(usedAttributes: ['lines' => true, 'indexes' => true]);
56+
$this->phpDocLexer = new Lexer($config);
57+
58+
$constExprParser = new ConstExprParser($config);
59+
$typeParser = new TypeParser($config, $constExprParser);
60+
$this->phpDocParser = new PhpDocParser($config, $typeParser, $constExprParser);
5861
}
5962

6063
protected function configure(): void

0 commit comments

Comments
 (0)