validators = $tmapFactory->create( [ 'array' => $validators, 'type' => ValidatorInterface::class ] ); } /** * Returns configured validator * * @param string $code * @return ValidatorInterface * @throws NotFoundException */ public function get($code) { if (!isset($this->validators[$code])) { throw new NotFoundException(__('The validator for the "%1" field doesn\'t exist.', $code)); } return $this->validators[$code]; } }