![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-payment/Gateway/Validator/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Payment\Gateway\Validator; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\ObjectManager\TMap; use Magento\Framework\ObjectManager\TMapFactory; /** * Class ValidatorPool * @package Magento\Payment\Gateway\Validator * @api * @since 100.0.2 */ class ValidatorPool implements \Magento\Payment\Gateway\Validator\ValidatorPoolInterface { /** * @var ValidatorInterface[] | TMap */ private $validators; /** * @param TMapFactory $tmapFactory * @param array $validators */ public function __construct( TMapFactory $tmapFactory, array $validators = [] ) { $this->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]; } }