-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] deprecate member metadata accessors #11703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…property metadata accessors add changelog for deprecations fix test
@@ -264,10 +266,14 @@ protected function guess($class, $property, \Closure $closure, $defaultValue = n | |||
$guesses = array(); | |||
$classMetadata = $this->metadataFactory->getMetadataFor($class); | |||
|
|||
if ($classMetadata->hasMemberMetadatas($property)) { | |||
$memberMetadatas = $classMetadata->getMemberMetadatas($property); | |||
if ($classMetadata instanceof ClassMetadataInterface && $classMetadata->hasPropertyMetadata($property)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the metadata for a class should always be a ClassMetadataInterface so I don't think this check is necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's necessary because the interface only says it returns an MetadataInterface. Everything else is implementation detail we cannot trust.
bd5f345
to
14d3f97
Compare
👍 |
1 similar comment
👍 |
Thank you @Tobion. |
This PR was merged into the 2.6-dev branch. Discussion ---------- [Validator] deprecate member metadata accessors | Q | A | ------------- | --- | Bug fix? | sort of | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony/pull/11614/files#r16385109 | License | MIT | Doc PR | deprecate member metadata accessors in favor of existing property metadata accessors Commits ------- 14d3f97 [Validator] add getConstraints to MetadataInterface 04eb61b [Validator] deprecate member metadata accessors in favor of existing property metadata accessors
deprecate member metadata accessors in favor of existing property metadata accessors