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\RedirectBundle\Controller; |
||
4 | |||
5 | use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface; |
||
6 | use Kunstmaan\AdminListBundle\Controller\AdminListController; |
||
7 | use Kunstmaan\RedirectBundle\AdminList\RedirectAdminListConfigurator; |
||
8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
||
9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
||
10 | use Symfony\Component\HttpFoundation\Request; |
||
11 | use Symfony\Component\HttpFoundation\Response; |
||
12 | |||
13 | class RedirectAdminListController extends AdminListController |
||
14 | { |
||
15 | /** |
||
16 | * @var AdminListConfiguratorInterface |
||
17 | */ |
||
18 | private $configurator; |
||
19 | |||
20 | /** |
||
21 | * @return AdminListConfiguratorInterface |
||
22 | */ |
||
23 | public function getAdminListConfigurator() |
||
24 | { |
||
25 | if (!isset($this->configurator)) { |
||
26 | $this->configurator = new RedirectAdminListConfigurator($this->getEntityManager(), null, $this->get('kunstmaan_admin.domain_configuration')); |
||
27 | } |
||
28 | |||
29 | return $this->configurator; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * The index action |
||
34 | * |
||
35 | * @Route("/", name="kunstmaanredirectbundle_admin_redirect") |
||
36 | */ |
||
37 | public function indexAction(Request $request) |
||
38 | { |
||
39 | return parent::doIndexAction($this->getAdminListConfigurator(), $request); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * The add action |
||
44 | * |
||
45 | * @Route("/add", name="kunstmaanredirectbundle_admin_redirect_add") |
||
46 | * @Method({"GET", "POST"}) |
||
47 | * |
||
48 | * @return Response |
||
49 | */ |
||
50 | public function addAction(Request $request) |
||
51 | { |
||
52 | return parent::doAddAction($this->getAdminListConfigurator(), null, $request); |
||
0 ignored issues
–
show
|
|||
53 | } |
||
54 | |||
55 | /** |
||
56 | * The edit action |
||
57 | * |
||
58 | * @param int $id |
||
59 | * |
||
60 | * @Route("/{id}", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_edit") |
||
61 | * @Method({"GET", "POST"}) |
||
62 | * |
||
63 | * @return Response |
||
64 | */ |
||
65 | public function editAction(Request $request, $id) |
||
66 | { |
||
67 | return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * The delete action |
||
72 | * |
||
73 | * @param int $id |
||
74 | * |
||
75 | * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_delete") |
||
76 | * @Method({"GET", "POST"}) |
||
77 | * |
||
78 | * @return Response |
||
79 | */ |
||
80 | public function deleteAction(Request $request, $id) |
||
81 | { |
||
82 | return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * The export action |
||
87 | * |
||
88 | * @param string $_format |
||
89 | * |
||
90 | * @Route("/export.{_format}", requirements={"_format" = "csv|xlsx|ods"}, name="kunstmaanredirectbundle_admin_redirect_export") |
||
91 | * @Method({"GET", "POST"}) |
||
92 | * |
||
93 | * @return Response |
||
94 | */ |
||
95 | public function exportAction(Request $request, $_format) |
||
96 | { |
||
97 | return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request); |
||
98 | } |
||
99 | } |
||
100 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.