We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class InputValidatorFactory |
||
| 13 | { |
||
| 14 | private ValidatorInterface $defaultValidator; |
||
| 15 | private ConstraintValidatorFactoryInterface $constraintValidatorFactory; |
||
| 16 | private ?TranslatorInterface $defaultTranslator; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * InputValidatorFactory constructor. |
||
| 20 | */ |
||
| 21 | public function __construct( |
||
| 22 | ConstraintValidatorFactoryInterface $constraintValidatorFactory, |
||
| 23 | ?ValidatorInterface $validator, |
||
| 24 | ?TranslatorInterface $translator |
||
| 25 | ) { |
||
| 26 | if (null === $validator) { |
||
| 27 | throw new ServiceNotFoundException("The 'validator' service is not found. To use the 'InputValidator' you need to install the Symfony Validator Component first. See: 'https://symfony.com/doc/current/validation.html'"); |
||
| 28 | } |
||
| 29 | |||
| 30 | $this->defaultValidator = $validator; |
||
| 31 | $this->defaultTranslator = $translator; |
||
| 32 | $this->constraintValidatorFactory = $constraintValidatorFactory; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function create(array $resolverArgs): InputValidator |
||
| 42 | ); |
||
| 43 | } |
||
| 45 |