[generateValidator description]
@return [type] [description]
555987
public function generateValidator($objField, $table)
    {

        // Get Field Type
        $funcType = function () use ($objField) {

            switch ($objField->type) {
                case 'int':
                    $type = 'integer';
                    break;

                case 'char':
                case 'varchar':
                case 'text':
                case 'enum':
                    $type = 'string';
                    break;

                default:
                    $type = $objField->type;
            }

            return $type;
        };

        // Get PK name
        foreach ($table->fields as $f) {
            if ($f->pk) {
                $pk = $f->name;
            }
        }

        $validator = $funcType();
        $validator .= $objField->type === 'enum' ? '|in:' . $objField->inTypes : '';
        $validator .= $objField->size && in_array($objField->type, ['char','varchar','text'])
                        ? '|max:' . $objField->size
                        : '';
        $validator .= strpos($objField->name, 'email') !== false ? '|email' : '';
        $validator .= $objField->unique ? '|unique:' . $table->name . ',' . $pk : '';
        $validator .= $objField->required ? '|required' : '';

        return $validator;

    }
469667
public function getValidator()
    {
        if (!$this->validator) {
            $this->validator = new Validator($this);
        }
        return $this->validator->onEntity();
    }
25158
protected function getFlattenedValidationErrorMessage()
    {
        $outputMessage = 'Validation failed while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;
        $logMessage = $outputMessage;

        foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {
            foreach ($errors as $error) {
                $logMessage .= 'Error for ' . $propertyPath . ':  ' . $error->render() . PHP_EOL;
            }
        }
        $this->logger->error($logMessage, LogEnvironment::fromMethodName(__METHOD__));

        return $outputMessage;
    }
176218
protected function getValidatorInstance(): Validator
    {
        $factory = $this->container->make(ValidationFactory::class);

        if (method_exists($this, 'validator')) {
            $validator = $this->container->call([$this, 'validator'], compact('factory'));
        } else {
            $validator = $this->createDefaultValidator($factory);
        }

        if (method_exists($this, 'withValidator')) {
            $this->withValidator($validator);
        }

        return $validator;
    }
44364
public function getJsonValidator()
    {
        if (!$this->jsonValidator) {
            $uriRetriever = new UriRetriever();

            // Load puli.io schemas from the schema/ directory
            $uriRetriever->setUriRetriever(new LocalUriRetriever());

            $this->jsonValidator = new JsonValidator(null, $uriRetriever);
        }

        return $this->jsonValidator;
    }
485539
protected function getDefaultValidator(): ValidatorInterface
    {
        $loaders = [new StaticMethodLoader()];

        if (class_exists(AnnotationReader::class) && class_exists(ArrayCache::class)) {
            AnnotationRegistry::registerUniqueLoader('class_exists');
            $loaders[] = new AnnotationLoader(new CachedReader(new AnnotationReader(), new ArrayCache()));
        }

        return (new ValidatorBuilder())
            ->setMetadataFactory(
                new LazyLoadingMetadataFactory(
                    new LoaderChain($loaders)
                )
            )
            ->getValidator();
    }
113080
public function buildEntityDataValidator(): EntityDataValidatorInterface
    {
        $builder = Validation::createValidatorBuilder();
        $builder->addMethodMapping(self::METHOD_LOAD_VALIDATOR_META_DATA);
        $builder->setMetadataCache($this->doctrineCache);
        $builder->setConstraintValidatorFactory($this->factory);
        $builder->addObjectInitializer($this->initialiser);
        $validator = $builder->getValidator();

        return new EntityDataValidator($validator);
    }
1342614
public static function getConstraintsValidator()
    {
        if (self::$constraintsValidator === null) {
            self::$constraintsValidator = Validation::createValidatorBuilder()
                ->enableAnnotationMapping(self::getAnnotationReader())
                ->getValidator();
        }

        return self::$constraintsValidator;
    }
501389
protected function getValidatorInstance()
    {
        $this->setupValidationScenario();
        $this->setupValidationParameters();

        $this->validationFactory = $this->container->make(ValidationContract::class);
        $this->validationDispatcher = $this->container->make(DispatcherContract::class);

        return $this->runValidation($this->all(), [], $this->messages());
    }
1058030
public function getValidationRules()
    {
        $rules = $this->getOption('rules', []);
        $name = $this->getNameKey();
        $messages = $this->getOption('error_messages', []);
        $formName = $this->formHelper->transformToDotSyntax($this->parent->getName());

        if ($messages && $formName) {
            $newMessages = [];
            foreach ($messages as $messageKey => $message) {
                $messageKey = sprintf('%s.%s', $formName, $messageKey);
                $newMessages[$messageKey] = $message;
            }
            $messages = $newMessages;
        }

        if (!$rules) {
            return (new Rules([]))->setFieldName($this->getNameKey());
        }

        if (is_array($rules)) {
            $rules = array_map(function ($rule) use ($name) {
                if ($rule instanceof \Closure) {
                    return $rule($name);
                }

                return $rule;
            }, $rules);
        }

        return (new Rules(
            [$name => $rules],
            [$name => $this->getOption('label')],
            $messages
        ))->setFieldName($this->getNameKey());
    }
571293
public function getPaymentValidator()
    {
        if (is_null($this->paymentValidator)) {
            $this->setPaymentValidator(oxNew(\OxidEsales\PayPalModule\Model\PaymentValidator::class));
        }

        return $this->paymentValidator;
    }
491426
private function bootValidators()
    {
        Validator::extend('enum_key', function($attribute, $value, $parameters, $validator) {
            $enum = $parameters[0] ?? null;

            return (new EnumKey($enum))->passes($attribute, $value);
        });

        Validator::extend('enum_value', function($attribute, $value, $parameters, $validator) {
            $enum = $parameters[0] ?? null;

            $strict = $parameters[1] ?? null;

            if (! $strict) {
                return (new EnumValue($enum))->passes($attribute, $value);
            }

            $strict = !! json_decode(strtolower($strict));

            return (new EnumValue($enum, $strict))->passes($attribute, $value);
        });
    }
89773
public function getIPNRequestValidator()
    {
        if ($this->ipnRequestValidator === null) {
            $this->ipnRequestValidator = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestValidator::class);
        }

        return $this->ipnRequestValidator;
    }
510687
public function runValidators()
	{
		$filelistValidator = new FileListValidator($this->input, $this->output);

		$validateFiles = $filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)
			->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)
			->setPhpbbVersion($this->phpbbVersion)
			->setDebug($this->debug)
			->setSafeMode($this->safeMode)
			->validate();

		if (empty($validateFiles))
		{
			$this->output->writelnIfDebug('');
			$this->output->writelnIfDebug("<fatal>No files found for validation.</fatal>");
			return;
		}

		$pluralRule = $this->guessPluralRule();
		$this->output->writelnIfDebug("<notice>Using plural rule #$pluralRule for validation.</notice>");
		$this->output->writelnIfDebug('');

		$this->output->writelnIfDebug("Validating file list:");
		$this->printErrorLevel($this->output);

		$this->maxProgress = sizeof($validateFiles) + 1;
		$this->progressLength = 11 + strlen($this->maxProgress) * 2;

		$filelistValidator = new FileValidator($this->input, $this->output);
		$filelistValidator->setSource($this->sourceIso, $this->sourcePath, $this->sourceLanguagePath)
			->setOrigin($this->originIso, $this->originPath, $this->originLanguagePath)
			->setPhpbbVersion($this->phpbbVersion)
			->setPluralRule($pluralRule)
			->setDebug($this->debug)
			->setSafeMode($this->safeMode);

		foreach ($validateFiles as $sourceFile => $originFile)
		{
			$this->output->writelnIfDebug('');
			$this->output->writelnIfDebug("Validating file: $originFile");
			$filelistValidator->validate($sourceFile, $originFile);
			$this->printErrorLevel($this->output);

			usleep(31250);//125000);
		}

		$this->output->writeln('.');
	}
987546
public function getMessageValidator(): ValidateMessage
    {
        $messageValidator = new ValidateMessageImplementation(
            [
                new CapitalizeTheSubjectLineValidator(),
                new DoNotEndTheSubjectLineWithAPeriodValidator(),
                new LimitTheBodyWrapLengthTo72CharactersValidator(),
                new LimitTheTitleLengthTo69CharactersValidator(),
                new SeparateSubjectFromBodyWithABlankLineValidator(),
                new SoftLimitTheTitleLengthTo50CharactersValidator(),
            ]
        );

        return $messageValidator;
    }
890492
public function validateRules()
    {
        $input = request()->all();
        $rules = [];
        $messages = [];

        if ($this->formRequest) {
            $this->formRequest = new $this->formRequest;
            $rules = $this->formRequest->rules();
            $messages = $this->formRequest->messages();
        }

        return Validator::make($input, $rules, $messages);
    }
27563
public function getValidator()
    {
        if (!$this->validator) {
            $this->setValidator(
                $this->validatorFactory->createValidator($this->form)
            );
        }

        return $this->validator;
    }