Exemple #1
0
 /**
  * Create a request for an operation with a uri merged onto a base URI
  */
 private function createCommandWithUri(Operation $operation, CommandInterface $command, ServiceClientInterface $client)
 {
     // Get the path values and use the client config settings
     $variables = [];
     foreach ($operation->getParams() as $name => $arg) {
         /* @var Parameter $arg */
         if ($arg->getLocation() == 'uri') {
             if (isset($command[$name])) {
                 $variables[$name] = $arg->filter($command[$name]);
                 if (!is_array($variables[$name])) {
                     $variables[$name] = (string) $variables[$name];
                 }
             }
         }
     }
     // Expand the URI template.
     $uri = Utils::uriTemplate($operation->getUri(), $variables);
     return $client->getHttpClient()->createRequest($operation->getHttpMethod(), $this->description->getBaseUrl()->combine($uri), $command['request_options'] ?: []);
 }