validate() публичный Метод

Every validator has to be valid, to make the whole conjunction valid.
public validate ( mixed $value ) : Neos\Error\Messages\Result
$value mixed The value that should be validated
Результат Neos\Error\Messages\Result
 /**
  * @test
  */
 public function validatorConjunctionReturnsErrorsIfOneValidatorReturnsErrors()
 {
     $validatorConjunction = new ConjunctionValidator([]);
     $validatorObject = $this->createMock(ValidatorInterface::class);
     $errors = new Error\Result();
     $errors->addError(new Error\Error('Error', 123));
     $validatorObject->expects($this->any())->method('validate')->will($this->returnValue($errors));
     $validatorConjunction->addValidator($validatorObject);
     $this->assertTrue($validatorConjunction->validate('some subject')->hasErrors());
 }
Пример #2
0
 /**
  * @param mixed $value
  * @return mixed
  */
 public function process($value)
 {
     if ($this->dataType !== null) {
         $value = $this->propertyMapper->convert($value, $this->dataType, $this->propertyMappingConfiguration);
         $messages = $this->propertyMapper->getMessages();
     } else {
         $messages = new \Neos\Error\Messages\Result();
     }
     $validationResult = $this->validator->validate($value);
     $messages->merge($validationResult);
     $this->processingMessages->merge($messages);
     return $value;
 }