| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function run(Request $request, Response $response, array $args) : Response |
||
| 22 | { |
||
| 23 | // load all cards |
||
| 24 | /* @var Card[] $cards */ |
||
| 25 | $cards = Card::query()->get(); |
||
| 26 | |||
| 27 | $counts = []; |
||
| 28 | foreach ($cards as $card) { |
||
| 29 | /** @noinspection PhpUndefinedMethodInspection */ |
||
| 30 | $counts[] = [ |
||
| 31 | 'card' => $card->id, |
||
| 32 | 'count' => Task::query()->where('cardId', '=', $card->id)->count() |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | return $response->withJson($counts); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |