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]; } }