Server IP : 172.67.158.161 / Your IP : 3.17.110.113 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/LocationVisitor/Request/ |
Upload File : |
<?php namespace DuplicatorPro\Guzzle\Service\Command\LocationVisitor\Request; use DuplicatorPro\Guzzle\Service\Command\CommandInterface; use DuplicatorPro\Guzzle\Http\Message\RequestInterface; use DuplicatorPro\Guzzle\Service\Description\Parameter; abstract class AbstractRequestVisitor implements RequestVisitorInterface { /** * @codeCoverageIgnore */ public function after(CommandInterface $command, RequestInterface $request) {} /** * @codeCoverageIgnore */ public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value) {} /** * Prepare (filter and set desired name for request item) the value for request. * * @param mixed $value * @param \Guzzle\Service\Description\Parameter $param * * @return array|mixed */ protected function prepareValue($value, Parameter $param) { return is_array($value) ? $this->resolveRecursively($value, $param) : $param->filter($value); } /** * Map nested parameters into the location_key based parameters * * @param array $value Value to map * @param Parameter $param Parameter that holds information about the current key * * @return array Returns the mapped array */ protected function resolveRecursively(array $value, Parameter $param) { foreach ($value as $name => &$v) { switch ($param->getType()) { case 'object': if ($subParam = $param->getProperty($name)) { $key = $subParam->getWireName(); $value[$key] = $this->prepareValue($v, $subParam); if ($name != $key) { unset($value[$name]); } } elseif ($param->getAdditionalProperties() instanceof Parameter) { $v = $this->prepareValue($v, $param->getAdditionalProperties()); } break; case 'array': if ($items = $param->getItems()) { $v = $this->prepareValue($v, $items); } break; } } return $param->filter($value); } }