Completed
Push — master ( 91fdab...75a7b9 )
by
unknown
13:37
created

DashboardBundle/Controller/DashboardController.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\DashboardBundle\Controller;
4
5
use Kunstmaan\DashboardBundle\Manager\WidgetManager;
6
use Kunstmaan\DashboardBundle\Widget\DashboardWidget;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
9
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10
use Symfony\Component\HttpFoundation\Request;
11
12
class DashboardController extends Controller
13
{
14
15
    /**
16
     * The index action will render the main screen the users see when they log in in to the admin
17
     *
18
     * @Route("/", name="kunstmaan_dashboard")
19
     *
20
     * @param \Symfony\Component\HttpFoundation\Request $request
21
     * @return array
0 ignored issues
show
Should the return type not be \Symfony\Component\HttpFoundation\Response?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
22
     */
23
    public function indexAction(Request $request, $segmentId=null)
24
    {
25
        /** @var WidgetManager $widgetManager */
26
        $widgetManager = $this->get('kunstmaan_dashboard.manager.widgets');
27
        /** @var DashboardWidget[] $widgets */
28
        $widgets = $widgetManager->getWidgets();
29
        $segmentId = $request->query->get('segment');
30
        return $this->render('KunstmaanDashboardBundle:Dashboard:index.html.twig', array('widgets' => $widgets, 'id' => $segmentId));
31
    }
32
}
33