Fix PHPStan errors detected with PHP 8.4 and Symfony 7.4#3007
Open
GromNaN wants to merge 2 commits into
Open
Conversation
- Remove dead code guard in GraphLookup::fromReference() and Lookup::fromReference() that could never be reached since from() already checks hasReference() - Fix XmlDriver using class_exists() instead of interface_exists() for autoload trigger since ClassMetadata is a class, not an interface - Ignore false-positive PHPStan error on ReflectionClass::markLazyObjectAsInitialized() for proxy classes whose lazy nature is only known at runtime
019ee49 to
001072e
Compare
…y composer security advisor
683cb71 to
792eac8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove dead code guard in
GraphLookup::fromReference()andLookup::fromReference()— the check! $this->class->hasReference($fieldName)can never be true sincefrom()already verifieshasReference()before callingfromReference().Fix
XmlDriverusingclass_exists()instead ofinterface_exists()to trigger autoloading ofClassMetadata, which is a class not an interface.Ignore false-positive PHPStan error on
ReflectionClass::markLazyObjectAsInitialized()for proxy classes whose lazy nature is only known at runtime (PHP 8.4).Quote the
symfony-versionmatrix values with a caret (^7.4instead of7.4). A bareSYMFONY_REQUIRE=7.4makes Flex pin symfony/* to exactly 7.4.0, which is affected by the symfony/cache advisory PKSA-z7t6-zt6p-wtng and gets blocked by Composer 2.10'spolicy.advisories.block. The caret keeps the full 7.4.x range so the resolver picks an unaffected patch.