Sylius\Bundle\CoreBundle\Command\SetupCommand::getPasswordQuestionValidator PHP Method

getPasswordQuestionValidator() private method

private getPasswordQuestionValidator ( Symfony\Component\Console\Output\OutputInterface $output ) : Closure
$output Symfony\Component\Console\Output\OutputInterface
return Closure
    private function getPasswordQuestionValidator(OutputInterface $output)
    {
        return function ($value) use($output) {
            /** @var ConstraintViolationListInterface $errors */
            $errors = $this->get('validator')->validate($value, [new NotBlank()]);
            foreach ($errors as $error) {
                throw new \DomainException($error->getMessage());
            }
            return $value;
        };
    }