Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan PHPDocParser missing constructor attribute #6795

Closed
dbotezat opened this issue Nov 14, 2024 · 2 comments
Closed

PHPStan PHPDocParser missing constructor attribute #6795

dbotezat opened this issue Nov 14, 2024 · 2 comments

Comments

@dbotezat
Copy link

dbotezat commented Nov 14, 2024

API Platform version(s) affected: 4.0.8

Description

[critical] Uncaught Error: Too few arguments to function PHPStan\PhpDocParser\Parser\ConstExprParser::__construct(), 0 passed in /DriversCheck/dev/projects/beed-backend/vendor/api-platform/core/src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php on line 62 and exactly 1 expected

currently using phptan v1.12

How to reproduce

create new ymfony project usinc smyfony cli
add api platform via composer

Possible Solution

repalce with
$phpDocParser = new PhpDocParser(new ParserConfig(),new TypeParser(new ConstExprParser()), new ConstExprParser());
Additional Context

Error screenshot
image

Composer requirements screenshot
image

@dbotezat
Copy link
Author

dbotezat commented Nov 14, 2024

this fixed the issue

if (class_exists(PhpDocParser::class)) {
$config = new ParserConfig([]);
$phpDocParser = new PhpDocParser($config,new TypeParser($config,new ConstExprParser($config)), new
ConstExprParser($config));
$lexer = new Lexer($config);
}

what exactly should i use as an array param in new ParserConfig(???) ... i did not research

@soyuka
Copy link
Member

soyuka commented Nov 15, 2024

it's going to be fixed by #6789

@soyuka soyuka closed this as completed Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants