Completed
Push — 5.0 ( a48099...63af02 )
by
unknown
11:33
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
     * @Template()
20
     *
21
     * @param \Symfony\Component\HttpFoundation\Request $request
22
     * @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...
23
     */
24
    public function indexAction(Request $request, $segmentId=null)
25
    {
26
        /** @var WidgetManager $widgetManager */
27
        $widgetManager = $this->get('kunstmaan_dashboard.manager.widgets');
28
        /** @var DashboardWidget[] $widgets */
29
        $widgets = $widgetManager->getWidgets();
30
        $segmentId = $request->query->get('segment');
31
        return $this->render('KunstmaanDashboardBundle:Dashboard:index.html.twig', array('widgets' => $widgets, 'id' => $segmentId));
32
    }
33
}
34