Added support for TypedNoDefaultReflectionProperty class to RuntimeReflectionService#90
Closed
sspat wants to merge 5 commits intodoctrine:masterfrom
Closed
Conversation
Author
|
Also updated phpunit config to allow running tests with php 7.4 syntax. |
greg0ire
reviewed
Jan 9, 2020
| script: ./vendor/bin/phpcs | ||
|
|
||
| - stage: Code Quality | ||
| php: 7.4snapshot |
Member
There was a problem hiding this comment.
A stable image is out
Suggested change
| php: 7.4snapshot | |
| php: 7.4 |
alcaeus
reviewed
Jan 10, 2020
| "doctrine/collections": "^1.0", | ||
| "doctrine/event-manager": "^1.0", | ||
| "doctrine/reflection": "^1.0" | ||
| "doctrine/reflection": "^1.1" |
Member
There was a problem hiding this comment.
With the dependency change, this will only be in 1.4 which will not be released until we've fixed the deprecation warnings in ORM and other libraries. See my other comment for a suggestion on how to fix this.
| $reflectionProperty = new ReflectionProperty($class, $property); | ||
|
|
||
| if ($reflectionProperty->isPublic()) { | ||
| if (! array_key_exists($property, $this->getClass($class)->getDefaultProperties())) { |
Member
There was a problem hiding this comment.
With this change, you can avoid the dependency bump and target 1.3 to fix this bug in a patch release:
Suggested change
| if (! array_key_exists($property, $this->getClass($class)->getDefaultProperties())) { | |
| if (class_exists(TypedNoDefaultReflectionProperty::class) && ! array_key_exists($property, $this->getClass($class)->getDefaultProperties())) { |
Member
|
Closed in favor of #94 |
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.
Implementation for issue #89
See discussion in doctrine/orm#7857
As suggested by @beberlei, the
Doctrine\Common\Reflection\TypedNoDefaultReflectionPropertyclass was introduced and theDoctrine\Persistence\Mapping\RuntimeReflectionService::getAccessiblePropertyreturns an instance of this class if the property is typed and has no default value.