Passed
Push — develop ( 218858...622854 )
by BENARD
04:57
created

PlayerAdminController::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\PlayerRankingHandler;
7
8
/**
9
 * Class PlayerAdminController
10
 */
11
class PlayerAdminController extends CRUDController
12
{
13
    private PlayerRankingHandler $playerRankingHandler;
14
15
    public function __construct(PlayerRankingHandler $playerRankingHandler)
16
    {
17
        $this->playerRankingHandler = $playerRankingHandler;
18
    }
19
20
    /**
21
     * @param $id
22
     * @return RedirectResponse
23
     */
24
    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

24
    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...
25
    {
26
        $this->playerRankingHandler->handle($this->admin->getSubject());
27
        $this->addFlash('sonata_flash_success', 'Player maj successfully');
28
        return new RedirectResponse($this->admin->generateUrl('list'));
29
    }
30
}
31