本文整理匯總了PHP中Operation::getMethod方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operation::getMethod方法的具體用法?PHP Operation::getMethod怎麽用?PHP Operation::getMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operation
的用法示例。
在下文中一共展示了Operation::getMethod方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addOperation
/**
* @param Operation $operation
*
* @return self
*/
public function addOperation(Operation $operation)
{
$id = $operation->getMethod() . $operation->getPath();
$group = 0;
if ($operation->getOperation()->getOperationId()) {
$id = $operation->getOperation()->getOperationId();
}
if ($operation->getOperation()->getTags() !== null && count($operation->getOperation()->getTags()) > 0) {
$group = $operation->getOperation()->getTags()[0];
}
if (!isset($this[$group])) {
$this[$group] = [];
}
$this[$group][$id] = $operation;
return $this;
}
示例2: testIn
public function testIn()
{
$operation = new Operation('getEntry');
$operation->setMethod('GET');
$operation->setIn('void');
$operation->setOut('collection');
$this->assertEquals('getEntry', $operation->getName());
$this->assertEquals('GET', $operation->getMethod());
$this->assertEquals('void', $operation->getIn());
$this->assertTrue($operation->hasIn());
$this->assertEquals('collection', $operation->getOut());
$this->assertTrue($operation->hasOut());
$this->assertTrue($operation->hasOperation());
$this->assertFalse($operation->isInOnly());
$this->assertFalse($operation->isOutOnly());
$this->assertTrue($operation->isInOut());
}