Server IP : 172.67.158.161 / Your IP : 18.226.164.216 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/duplicator-pro/aws/Guzzle/Service/Command/ |
Upload File : |
<?php namespace DuplicatorPro\Guzzle\Service\Command; use DuplicatorPro\Guzzle\Common\Exception\InvalidArgumentException; use DuplicatorPro\Guzzle\Common\Exception\UnexpectedValueException; use DuplicatorPro\Guzzle\Http\Message\RequestInterface; /** * A ClosureCommand is a command that allows dynamic commands to be created at runtime using a closure to prepare the * request. A closure key and \Closure value must be passed to the command in the constructor. The closure must * accept the command object as an argument. */ class ClosureCommand extends AbstractCommand { /** * {@inheritdoc} * @throws InvalidArgumentException if a closure was not passed */ protected function init() { if (!$this['closure']) { throw new InvalidArgumentException('A closure must be passed in the parameters array'); } } /** * {@inheritdoc} * @throws UnexpectedValueException If the closure does not return a request */ protected function build() { $closure = $this['closure']; /** @var $closure \Closure */ $this->request = $closure($this, $this->operation); if (!$this->request || !$this->request instanceof RequestInterface) { throw new UnexpectedValueException('Closure command did not return a RequestInterface object'); } } }