/** * Adds a single operation. * Note that only operations with the same operation name can be added. * First operation which is added will be the reference and the instance will let you only add * other operations with the same operation name. * * @param OperationInterface $operation * * @return void */ public function addOperation(OperationInterface $operation) { if (null === $this->operationName) { $this->operationName = $operation->getName(); } if ($this->operationName !== $operation->getName()) { return; } $this->operations[] = $operation; }
/** * Add a operation to the service description * * @param OperationInterface $operation Operation to add * * @return self */ public function addOperation(OperationInterface $operation) { $this->operations[$operation->getName()] = $operation->setServiceDescription($this); return $this; }