Completed
Push — master ( e62357...459429 )
by Loïc
17s queued 11s
created

DashboardController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of monofony.
5
 *
6
 * (c) Mobizel
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace App\Controller;
15
16
use App\Dashboard\DashboardStatisticsProvider;
17
use Symfony\Component\HttpFoundation\Response;
18
use Symfony\Component\Templating\EngineInterface;
19
20
final class DashboardController
21
{
22
    /** @var DashboardStatisticsProvider */
23
    private $statisticsProvider;
24
25
    /** @var EngineInterface */
26
    private $templating;
27
28
    public function __construct(DashboardStatisticsProvider $statisticsProvider, EngineInterface $templating)
29
    {
30
        $this->statisticsProvider = $statisticsProvider;
31
        $this->templating = $templating;
32
    }
33
34
    public function indexAction(): Response
35
    {
36
        $statistics = $this->statisticsProvider->getStatistics();
37
        $content = $this->templating->render('backend/index.html.twig', ['statistics' => $statistics]);
38
39
        return new Response($content);
40
    }
41
}
42