function UploadedFileValidator::getValidator

Same name in other branches
  1. 10 core/modules/file/src/Validation/UploadedFileValidator.php \Drupal\file\Validation\UploadedFileValidator::getValidator()

Get the Symfony validator instance.

Return value

\Symfony\Component\Validator\Validator\ValidatorInterface The Symfony validator.

File

core/modules/file/src/Validation/UploadedFileValidator.php, line 49

Class

UploadedFileValidator
Validator for uploaded files.

Namespace

Drupal\file\Validation

Code

protected function getValidator() : ValidatorInterface {
    if (!isset($this->validator)) {
        $this->validator = $this->validatorFactory
            ->createValidator();
    }
    return $this->validator;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.