@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Tomaj\NetteApi\Component; |
| 4 | 4 | |
| 5 | +use Closure; |
|
| 6 | +use Exception; |
|
| 5 | 7 | use Nette\Application\UI\Control; |
| 6 | 8 | use Nette\ComponentModel\IContainer; |
| 7 | 9 | use Tomaj\NetteApi\ApiDecider; |
| 8 | -use Closure; |
|
| 9 | -use Exception; |
|
| 10 | 10 | |
| 11 | 11 | class ApiListingControl extends Control |
| 12 | 12 | { |
@@ -2,6 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Tomaj\NetteApi\Presenters; |
| 4 | 4 | |
| 5 | +use Exception; |
|
| 5 | 6 | use Nette\Application\Responses\JsonResponse; |
| 6 | 7 | use Nette\Application\UI\Presenter; |
| 7 | 8 | use Nette\Http\Response; |
@@ -9,7 +10,6 @@ discard block |
||
| 9 | 10 | use Tomaj\NetteApi\ApiResponse; |
| 10 | 11 | use Tomaj\NetteApi\Misc\IpDetectorInterface; |
| 11 | 12 | use Tomaj\NetteApi\Params\ParamsProcessor; |
| 12 | -use Exception; |
|
| 13 | 13 | |
| 14 | 14 | class ApiPresenter extends Presenter |
| 15 | 15 | { |
@@ -7,20 +7,20 @@ |
||
| 7 | 7 | |
| 8 | 8 | class EchoHandler extends BaseHandler |
| 9 | 9 | { |
| 10 | - public function params() |
|
| 11 | - { |
|
| 12 | - return [ |
|
| 13 | - new InputParam(InputParam::TYPE_GET, 'status', InputParam::REQUIRED, ['ok', 'error']), |
|
| 14 | - new InputParam(InputParam::TYPE_GET, 'message'), |
|
| 15 | - ]; |
|
| 16 | - } |
|
| 10 | + public function params() |
|
| 11 | + { |
|
| 12 | + return [ |
|
| 13 | + new InputParam(InputParam::TYPE_GET, 'status', InputParam::REQUIRED, ['ok', 'error']), |
|
| 14 | + new InputParam(InputParam::TYPE_GET, 'message'), |
|
| 15 | + ]; |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * {@inheritdoc} |
| 20 | 20 | */ |
| 21 | 21 | public function handle($params) |
| 22 | 22 | { |
| 23 | - $status = $params['status']; |
|
| 23 | + $status = $params['status']; |
|
| 24 | 24 | return new ApiResponse(200, ['status' => $status, 'params' => $params]); |
| 25 | 25 | } |
| 26 | 26 | } |