| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function GetPositions(Application $app, Request $request) { |
||
| 13 | $draft_sport = $request->get('draft_sport'); |
||
| 14 | |||
| 15 | $validity = $app['phpdraft.DepthChartPositionValidator']->IsDraftSportValid($draft_sport); |
||
| 16 | |||
| 17 | if (!$validity->success) { |
||
| 18 | return $app->json($validity, Response::HTTP_BAD_REQUEST); |
||
| 19 | } |
||
| 20 | |||
| 21 | $response = $app['phpdraft.ResponseFactory'](true, array()); |
||
| 22 | $response->positions = array(); |
||
| 23 | $response->positions = $app['phpdraft.DraftDataRepository']->GetPositions($draft_sport); |
||
| 24 | |||
| 25 | return $app->json($response); |
||
| 26 | } |
||
| 27 | } |