You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possible Solution
Could you adjust your code, to also work for php-parser ^5.0 ?
After a quick test, it looks like it could be as simple as adjusting the ParserTombstoneProvider::create()-function as follows:
// OLD:
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
// NEW:
if (method_exists(ParserFactory::class, 'create')) {
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7, new Lexer());
else {
$parser = (new ParserFactory())->createForVersion(PhpVersion::getHostVersion());
}
The text was updated successfully, but these errors were encountered:
Package version: 1.7.0
Description
I tried to use the
tombstone-analyzer
and got the following error:Call to undefined method PhpParser\ParserFactory::create()
While investigating I found that the
tombstone-analyzer
allowsnikic/php-parser
in the versions^4.0|^5.0
, but theParceFactory::create()
-Method was removed in version5.0.0
Unfortunately I need the
php-parser
in a version ^5.1, so I can't just use ^4.To Reproduce
composer require --dev phpstan/phpstan-webmozart-assert
composer require scheb/tombstone-logger
composer require scheb/tombstone-analyzer --dev
vendor/bin/tombstone-analyzer
Possible Solution
Could you adjust your code, to also work for
php-parser ^5.0
?After a quick test, it looks like it could be as simple as adjusting the
ParserTombstoneProvider::create()
-function as follows:The text was updated successfully, but these errors were encountered: