| Conditions | 4 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | #[Route('/', name: 'app_home')] |
||
| 23 | public function index(): Response |
||
| 24 | { |
||
| 25 | $json = $this->quoteService->getAssadsQuote()->getContent(); |
||
| 26 | if ($json === false || $json === null || $json === '') { |
||
|
|
|||
| 27 | return new Response('Failed to get quote data.'); |
||
| 28 | } |
||
| 29 | $quote = json_decode( |
||
| 30 | $json, |
||
| 31 | true |
||
| 32 | ); |
||
| 33 | |||
| 34 | $data = [ |
||
| 35 | 'quoteData' => [ |
||
| 36 | 'quote' => $quote['quote'], |
||
| 37 | 'explanation' => $quote['explanation'] |
||
| 38 | ] |
||
| 39 | ]; |
||
| 40 | |||
| 41 | return $this->render('index.html.twig', $data); |
||
| 42 | } |
||
| 44 |