本文整理汇总了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());
}