Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"justinrainbow/json-schema": "^5.2.1",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpdoc-parser": "^1.13",
"phpstan/phpdoc-parser": "^1.13|^2.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use PHPStan\PhpDocParser\Parser\PhpDocParser;
use PHPStan\PhpDocParser\Parser\TokenIterator;
use PHPStan\PhpDocParser\Parser\TypeParser;
use PHPStan\PhpDocParser\ParserConfig;

/**
* Extracts descriptions from PHPDoc.
Expand Down Expand Up @@ -58,9 +59,13 @@
}
$phpDocParser = null;
$lexer = null;
if (class_exists(PhpDocParser::class)) {
if (class_exists(PhpDocParser::class) && class_exists(ParserConfig::class)) {
$config = new ParserConfig([]);
$phpDocParser = new PhpDocParser($config, new TypeParser($config, new ConstExprParser($config)), new ConstExprParser($config));
$lexer = new Lexer($config);
} elseif (class_exists(PhpDocParser::class)) {
$phpDocParser = new PhpDocParser(new TypeParser(new ConstExprParser()), new ConstExprParser());

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Class PHPStan\PhpDocParser\Parser\ConstExprParser constructor invoked with 0 parameters, 1 required.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Class PHPStan\PhpDocParser\Parser\ConstExprParser constructor invoked with 0 parameters, 1 required.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Class PHPStan\PhpDocParser\Parser\PhpDocParser constructor invoked with 2 parameters, 3 required.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Class PHPStan\PhpDocParser\Parser\TypeParser constructor invoked with 1 parameter, 2 required.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Parameter #1 $config of class PHPStan\PhpDocParser\Parser\PhpDocParser constructor expects PHPStan\PhpDocParser\ParserConfig, PHPStan\PhpDocParser\Parser\TypeParser given.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Parameter #1 $config of class PHPStan\PhpDocParser\Parser\TypeParser constructor expects PHPStan\PhpDocParser\ParserConfig, PHPStan\PhpDocParser\Parser\ConstExprParser given.

Check failure on line 67 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Parameter #2 $typeParser of class PHPStan\PhpDocParser\Parser\PhpDocParser constructor expects PHPStan\PhpDocParser\Parser\TypeParser, PHPStan\PhpDocParser\Parser\ConstExprParser given.
$lexer = new Lexer();

Check failure on line 68 in src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.3)

Class PHPStan\PhpDocParser\Lexer\Lexer constructor invoked with 0 parameters, 1 required.
}
$this->phpDocParser = $phpDocParser;
$this->lexer = $lexer;
Expand Down
Loading