Completed
Push — master ( 770316...74fc07 )
by Jeroen
09:08 queued 02:44
created

Controller/RedirectAdminListController.php (4 issues)

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\RedirectBundle\Controller;
4
5
use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface;
6
use Kunstmaan\AdminListBundle\Controller\AdminListController;
7
use Kunstmaan\RedirectBundle\AdminList\RedirectAdminListConfigurator;
8
use Symfony\Component\Routing\Annotation\Route;
9
use Symfony\Component\HttpFoundation\Request;
10
use Symfony\Component\HttpFoundation\Response;
11
12
class RedirectAdminListController extends AdminListController
13
{
14
    /**
15
     * @var AdminListConfiguratorInterface
16
     */
17
    private $configurator;
18
19
    /**
20
     * @return AdminListConfiguratorInterface
21
     */
22
    public function getAdminListConfigurator()
23
    {
24
        if (!isset($this->configurator)) {
25
            $this->configurator = new RedirectAdminListConfigurator($this->getEntityManager(), null, $this->container->get('kunstmaan_admin.domain_configuration'));
26
        }
27
28
        return $this->configurator;
29
    }
30
31
    /**
32
     * The index action
33
     *
34
     * @Route("/", name="kunstmaanredirectbundle_admin_redirect")
35
     */
36
    public function indexAction(Request $request)
37
    {
38
        return parent::doIndexAction($this->getAdminListConfigurator(), $request);
39
    }
40
41
    /**
42
     * The add action
43
     *
44
     * @Route("/add", name="kunstmaanredirectbundle_admin_redirect_add", methods={"GET", "POST"})
45
     *
46
     * @return Response
47
     */
48
    public function addAction(Request $request)
49
    {
50
        return parent::doAddAction($this->getAdminListConfigurator(), null, $request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (doAddAction() instead of addAction()). Are you sure this is correct? If so, you might want to change this to $this->doAddAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
51
    }
52
53
    /**
54
     * The edit action
55
     *
56
     * @param int $id
57
     *
58
     * @Route("/{id}", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_edit", methods={"GET", "POST"})
59
     *
60
     * @return Response
61
     */
62
    public function editAction(Request $request, $id)
63
    {
64
        return parent::doEditAction($this->getAdminListConfigurator(), $id, $request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (doEditAction() instead of editAction()). Are you sure this is correct? If so, you might want to change this to $this->doEditAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
65
    }
66
67
    /**
68
     * The delete action
69
     *
70
     * @param int $id
71
     *
72
     * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_delete", methods={"GET", "POST"})
73
     *
74
     * @return Response
75
     */
76
    public function deleteAction(Request $request, $id)
77
    {
78
        return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (doDeleteAction() instead of deleteAction()). Are you sure this is correct? If so, you might want to change this to $this->doDeleteAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
79
    }
80
81
    /**
82
     * The export action
83
     *
84
     * @param string $_format
85
     *
86
     * @Route("/export.{_format}", requirements={"_format" = "csv|xlsx|ods"}, name="kunstmaanredirectbundle_admin_redirect_export", methods={"GET", "POST"})
87
     *
88
     * @return Response
89
     */
90
    public function exportAction(Request $request, $_format)
91
    {
92
        return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (doExportAction() instead of exportAction()). Are you sure this is correct? If so, you might want to change this to $this->doExportAction().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
93
    }
94
}
95