public function validate($descriptor)
    {
        $violations = $this->validator->validate($descriptor);
        $errors = new Collection();

        /** @var ConstraintViolation $violation */
        foreach ($violations as $violation) {
            $errors->add(
                new Error(
                    $this->mapCodeToSeverity($violation->getCode()),
                    $violation->getMessageTemplate(),
                    $descriptor->getLine(),
                    $violation->getMessageParameters() + array($descriptor->getFullyQualifiedStructuralElementName())
                )
            );
        }

        return $errors;
    }
public function validate($descriptor)
    {
        $violations = $this->validator->validate($descriptor);
        $errors = new Collection();

        /** @var ConstraintViolation $violation */
        foreach ($violations as $violation) {
            $errors->add(
                new Error(
                    $this->mapCodeToSeverity($violation->getCode()),
                    $violation->getMessageTemplate(),
                    $descriptor->getLine(),
                    $violation->getMessageParameters() + array($descriptor->getFullyQualifiedStructuralElementName())
                )
            );
        }

        return $errors;
    }
public function validate ( $ descriptor ) { $ violations = $ this -> validator -> validate ( $ descriptor ) ; $ errors = new Collection ( ) ; /** @var ConstraintViolation $violation */ foreach ( $ violations as $ violation ) { $ errors -> add ( new Error ( $ this -> mapCodeToSeverity ( $ violation -> getCode ( ) ) , $ violation -> getMessageTemplate ( ) , $ descriptor -> getLine ( ) , $ violation -> getMessageParameters ( ) + array ( $ descriptor -> getFullyQualifiedStructuralElementName ( ) ) ) ) ; } return $ errors ; }
Validates the contents of the Descriptor and outputs warnings and error if something is amiss.

@param DescriptorAbstract $descriptor

@return Collection
Validates the contents of the Descriptor and outputs warnings and error if something is amiss .