8000 minor #13461 [Validator] fixed deprecation notice for ElementMetadata… · symfony/symfony@26323bc · GitHub
[go: up one dir, main page]

Skip to content

Commit 26323bc

Browse files
committed
minor #13461 [Validator] fixed deprecation notice for ElementMetadata (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
2 parents 339afca + 2606a6d commit 26323bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Validator/Mapping/ElementMetadata.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\Validator\Mapping;
1313

14-
trigger_error('The '.__NAMESPACE__.'\ElementMetadata class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\GenericMetadata class instead.', E_USER_DEPRECATED);
15-
1614
/**
1715
* Contains the metadata of a structural element.
1816
*
@@ -23,4 +21,10 @@
2321
*/
2422
abstract class ElementMetadata extends GenericMetadata
2523
{
24+
public function __construct()
25+
{
26+
if (__CLASS__ === get_class($this) || !in_array(get_parent_class($this), array('Symfony\Component\Validator\Mapping\MemberMetadata', 'Symfony\Component\Validator\Mapping\ClassMetadata'))) {
27+
trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\GenericMetadata class instead.', E_USER_DEPRECATED);
28+
}
29+
}
2630
}

0 commit comments

Comments
 (0)
0