[Validator] simplified some code

This commit is contained in:
Fabien Potencier 2015-01-26 16:51:09 +01:00
parent 6cd28737f6
commit cca8905518
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ 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'))) {
if (!$this instanceof MemberMetadata && !$this instanceof ClassMetadata) {
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);
}
}