![]() 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/Command/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Payment\Gateway\Command; use Magento\Framework\ObjectManager\TMap; use Magento\Payment\Gateway\CommandInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\ObjectManager\TMapFactory; /** * Class CommandPool * @api * @since 100.0.2 */ class CommandPool implements CommandPoolInterface { /** * @var CommandInterface[] | TMap */ private $commands; /** * @param TMapFactory $tmapFactory * @param array $commands */ public function __construct( TMapFactory $tmapFactory, array $commands = [] ) { $this->commands = $tmapFactory->create( [ 'array' => $commands, 'type' => CommandInterface::class ] ); } /** * Retrieves operation * * @param string $commandCode * @return CommandInterface * @throws NotFoundException */ public function get($commandCode) { if (!isset($this->commands[$commandCode])) { throw new NotFoundException( __('The "%1" command doesn\'t exist. Verify the command and try again.', $commandCode) ); } return $this->commands[$commandCode]; } }