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

SerieAdminController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A majAction() 0 5 1
A __construct() 0 3 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