original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Validates the contents of the Descriptor and outputs warnings and error if something is amiss.
  
  @param DescriptorAbstract $descriptor
  
  @return Collection
docstring_tokens: Validates the contents of the Descriptor and outputs warnings and error if something is amiss .