8000 [Validator] fixed deprecation notice for ElementMetadata by fabpot · Pull Request #13461 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] fixed deprecation notice for ElementMetadata #13461

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 1 commit into from
Jan 20, 2015

Conversation

fabpot
Copy link
Member
@fabpot fabpot commented Jan 20, 2015
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

@fabpot fabpot merged commit 2606a6d into symfony:2.7 Jan 20, 2015
fabpot added a commit that referenced this pull request Jan 20, 2015
… (fabpot)

This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] fixed deprecation notice for ElementMetadata

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

2606a6d [Validator] fixed deprecation notice for ElementMetadata
@@ -23,4 +21,10 @@
*/
abstract class ElementMetadata extends GenericMetadata
{
public function __construct()
{
if (__CLASS__ === get_class($this) || !in_array(get_parent_class($this), array('Symfony\Component\Validator\Mapping\MemberMetadata', 'Symfony\Component\Validator\Mapping\ClassMetadata'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__CLASS__ === get_class($this) is impossible as the class is abstract

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And instead of !in_array(get_parent_class($this), array('Symfony\Component\Validator\Mapping\MemberMetadata', 'Symfony\Component\Validator\Mapping\ClassMetadata')), you could use !$this instanceof MemberMetadata && !his instanceof ClassMetadata

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in cca8905

@fabpot fabpot deleted the metadata-deprecations branch February 12, 2015 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0