Passed
Push — develop ( d0b924...ef2058 )
by BENARD
05:41
created

SerieAdminController::majAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
namespace VideoGamesRecords\CoreBundle\Controller\Admin;
3
4
use Sonata\AdminBundle\Controller\CRUDController;
5
use Symfony\Component\HttpFoundation\RedirectResponse;
6
use VideoGamesRecords\CoreBundle\Ranking\Command\Player\PlayerSerieRankingHandler;
7
8
/**
9
 * Class GameAdminController
10
 */
11
class SerieAdminController extends CRUDController
12
{
13
14
    private PlayerSerieRankingHandler $rankingHandler;
15
16
    public function __construct(PlayerSerieRankingHandler $rankingHandler)
17
    {
18
        $this->rankingHandler = $rankingHandler;
19
    }
20
21
    /**
22
     * @param $id
23
     * @return RedirectResponse
24
     */
25
    public function majAction($id): RedirectResponse
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

25
    public function majAction(/** @scrutinizer ignore-unused */ $id): RedirectResponse

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        $this->rankingHandler->handle($this->admin->getSubject()->getId());
28
        $this->addFlash('sonata_flash_success', 'Serie maj successfully');
29
        return new RedirectResponse($this->admin->generateUrl('list'));
30
    }
31
}
32