| @@ 459-468 (lines=10) @@ | ||
| 456 | * @return null|string |
|
| 457 | * @throws RetrofitException |
|
| 458 | */ |
|
| 459 | public function getCallback() |
|
| 460 | { |
|
| 461 | $callback = $this->getCallbackParameter(); |
|
| 462 | ||
| 463 | if (null === $callback) { |
|
| 464 | return null; |
|
| 465 | } |
|
| 466 | ||
| 467 | return '$' . $callback->getName(); |
|
| 468 | } |
|
| 469 | ||
| 470 | /** |
|
| 471 | * Returns if the callback is optional |
|
| @@ 477-486 (lines=10) @@ | ||
| 474 | * @throws LogicException |
|
| 475 | * @throws RetrofitException |
|
| 476 | */ |
|
| 477 | public function isCallbackOptional() |
|
| 478 | { |
|
| 479 | $callback = $this->getCallbackParameter(); |
|
| 480 | ||
| 481 | if (null === $callback) { |
|
| 482 | throw new LogicException('Callback does not exist'); |
|
| 483 | } |
|
| 484 | ||
| 485 | return $callback->isOptional(); |
|
| 486 | } |
|
| 487 | ||
| 488 | /** |
|
| 489 | * Get the request annotation |
|