當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。