Check that a function or method returns the type specified in the @return annotation
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 Symfony\Component\Routing\Annotation\Route; |
||
8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
||
9 | use Symfony\Component\HttpFoundation\Request; |
||
10 | |||
11 | class DashboardController extends Controller |
||
12 | { |
||
13 | /** |
||
14 | * The index action will render the main screen the users see when they log in in to the admin |
||
15 | * |
||
16 | * @Route("/", name="kunstmaan_dashboard") |
||
17 | * |
||
18 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
19 | * |
||
20 | * @return array |
||
0 ignored issues
–
show
|
|||
21 | */ |
||
22 | public function indexAction(Request $request) |
||
23 | { |
||
24 | /** @var WidgetManager $widgetManager */ |
||
25 | $widgetManager = $this->get('kunstmaan_dashboard.manager.widgets'); |
||
26 | /** @var DashboardWidget[] $widgets */ |
||
27 | $widgets = $widgetManager->getWidgets(); |
||
28 | $segmentId = $request->query->get('segment'); |
||
29 | |||
30 | return $this->render('@KunstmaanDashboard/Dashboard/index.html.twig', array('widgets' => $widgets, 'id' => $segmentId)); |
||
31 | } |
||
32 | } |
||
33 |
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.