当前位置: 首页>>代码示例>>PHP>>正文


PHP ServiceDescription::getOperation方法代码示例

本文整理汇总了PHP中Guzzle\Service\Description\ServiceDescription::getOperation方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceDescription::getOperation方法的具体用法?PHP ServiceDescription::getOperation怎么用?PHP ServiceDescription::getOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Guzzle\Service\Description\ServiceDescription的用法示例。


在下文中一共展示了ServiceDescription::getOperation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: factory

 /**
  * {@inheritdoc}
  */
 public function factory($name, array $args = array())
 {
     $command = $this->description->getOperation($name);
     // If an inflector was passed, then attempt to get the command using snake_case inflection
     if (!$command && $this->inflector) {
         $command = $this->description->getOperation($this->inflector->snake($name));
     }
     if ($command) {
         $class = $command->getClass();
         return new $class($args, $command, $this->description);
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:15,代码来源:ServiceDescriptionFactory.php

示例2: testAllowsRawResponses

 public function testAllowsRawResponses()
 {
     $description = new ServiceDescription(array('operations' => array('foo' => array('responseClass' => 'bar', 'responseType' => 'model')), 'models' => array('bar' => array())));
     $op = new OperationCommand(array(OperationCommand::RESPONSE_PROCESSING => OperationCommand::TYPE_RAW), $description->getOperation('foo'));
     $op->setClient(new Client());
     $request = $op->prepare();
     $response = new Response(200, array('Content-Type' => 'application/xml'), '<Foo><Baz>Bar</Baz></Foo>');
     $request->setResponse($response, true);
     $this->assertSame($response, $op->execute());
 }
开发者ID:jorjoh,项目名称:Varden,代码行数:10,代码来源:OperationCommandTest.php

示例3: registerCommandClass

 /**
  * Apply a bespoke operation command class to a given method, or all methods
  * @param string name of command using this class, or "" for all.
  * @param string full class name for operation class field
  * @return Swizzle
  * @throws \Exception
  */
 public function registerCommandClass($name, $class)
 {
     $this->commandClasses[$name] = $class;
     // set retrospectively if method already encountered
     if ($this->service) {
         if ($name) {
             $op = $this->service->getOperation($name) and $op->setClass($class);
         } else {
             throw new \Exception('Too late to register a global command class');
         }
     }
     return $this;
 }
开发者ID:rodsouto,项目名称:swizzle,代码行数:20,代码来源:Swizzle.php

示例4: testReturnsNullWhenRetrievingMissingOperation

 public function testReturnsNullWhenRetrievingMissingOperation()
 {
     $s = new ServiceDescription(array());
     $this->assertNull($s->getOperation('foo'));
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:5,代码来源:ServiceDescriptionTest.php


注:本文中的Guzzle\Service\Description\ServiceDescription::getOperation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。