private function validate($element)
    {
        $violationList = $this->validator->validate($element, null, ['Generator']);
        if (0 < $violationList->count()) {
            $this->output->writeln('<error>Invalid element</error>');
            /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
            foreach ($violationList as $violation) {
                $this->output->writeln(sprintf('<error>%s : %s</error>', $violation->getPropertyPath(), $violation->getMessage()));
            }

            return false;
        }

        return true;
    }
private function validate($element)
    {
        $violationList = $this->validator->validate($element, null, ['Generator']);
        if (0 < $violationList->count()) {
            $this->output->writeln('<error>Invalid element</error>');
            /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
            foreach ($violationList as $violation) {
                $this->output->writeln(sprintf('<error>%s : %s</error>', $violation->getPropertyPath(), $violation->getMessage()));
            }

            return false;
        }

        return true;
    }
private function validate ( $ element ) { $ violationList = $ this -> validator -> validate ( $ element , null , [ 'Generator' ] ) ; if ( 0 < $ violationList -> count ( ) ) { $ this -> output -> writeln ( '<error>Invalid element</error>' ) ; /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */ foreach ( $ violationList as $ violation ) { $ this -> output -> writeln ( sprintf ( '<error>%s : %s</error>' , $ violation -> getPropertyPath ( ) , $ violation -> getMessage ( ) ) ) ; } return false ; } return true ; }
Validates the element.

@param object $element

@return bool
Validates the element .