[2.4] Skip public property validation if no reflection class instance present#1237
[2.4] Skip public property validation if no reflection class instance present#1237deeky666 wants to merge 1 commit intodoctrine:2.4from
Conversation
|
Hello, thank you for creating this pull request. However did not open it on the "master" Please open the pull request again for the "master" branch and close Nevertheless I have opened a Jira ticket for this Pull Request to track this http://www.doctrine-project.org/jira/browse/DDC-3474 We use Jira to track the state of pull requests and the versions they got |
|
See the discussion here: doctrine/DoctrineBundle#352 |
|
This looks invalid to me. Metadata should always be processed by the reflection service before being used. See https://github.com/doctrine/doctrine2/blob/52376929795d7537f725409c1150d1b76ecc32a0/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L643-L659 |
|
The tests that cause the error in DoctrineBundle are indeed invalid concerning that. But does it hurt to prevent the fatals if you pass an invalid |
|
Also something similar is done here: https://github.com/doctrine/doctrine2/blob/52376929795d7537f725409c1150d1b76ecc32a0/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L234-L237 |
The solution is to pass class metadata info instance through the static reflection service before using it. |
|
I totally get that. It's just hard to mock that stuff then I suppose. If this one is not acceptable then I'm fine with it. Might loose some mocking capabilities in DoctrineBundle then I suppose. |
|
It's all in doctrine/common anyway as far as I know. |
The schema validator triggers a fatal error if you try to validate a class metadata that does not have the
ClassMetadataInfo::$reflClassset.This currently breaks the DoctrineBundle test suite. Therefore it's best to skip that validation part if the property is not set.