Do not fail if phpstan/phpdoc-parser is missing#7279
Conversation
|
@PicassoHouessou could you try this branch ? Does it solve your issue ? |
|
Hello @VincentLanglet. It solves my issue. |
maxhelias
left a comment
There was a problem hiding this comment.
It ok for me, as "phpstan/phpdoc-parser" is also a suggested package for metadata component : https://github.com/api-platform/core/blob/4.1/src/Metadata/composer.json#L52
|
Also, in Laravel, can you unconfigure the service if the dependency is not present? This would be better for performance, even if there is a cache on MetadataFactory services |
|
Thanks! @maxhelias yes we just need to not register the service in the first place but if I remember we're adding this dependency inside Laravel. |
|
@soyuka Since we’ve removed the |
Not fully sure about this one @soyuka but
core/src/Metadata/Resource/Factory/PhpDocResourceMetadataCollectionFactory.php
Line 141 in d3b98b5
So since phpDocParser/lexer will be null when PhpDocParser is not installed, a null check might be enough.