8000 [Validator] deprecate member metadata accessors by Tobion · Pull Request #11703 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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

Merged
merged 2 commits into from
Aug 31, 2014

Conversation

Tobion
Copy link
Contributor
@Tobion Tobion commented Aug 19, 2014
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

…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)) {
Copy link
Member

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

Copy link
Contributor Author

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.

@Tobion Tobion force-pushed the validator-member-metadata branch from bd5f345 to 14d3f97 Compare August 20, 2014 14:23
@fabpot
Copy link
Member
fabpot commented Aug 28, 2014

👍

1 similar comment
@stof
Copy link
Member
stof commented Aug 28, 2014

👍

@fabpot
Copy link
Member
fabpot commented Aug 31, 2014

Thank you @Tobion.

@fabpot fabpot merged commit 14d3f97 into symfony:master Aug 31, 2014
fabpot added a commit that referenced this pull request Aug 31, 2014
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
@Tobion Tobion deleted the validator-member-metadata branch August 31, 2014 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0