Passed
Push — develop ( 6aacf8...6c0b7f )
by BENARD
11:52
created

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

26
    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...
27
    {
28
        $this->youtubeDataHandler->process($this->admin->getSubject());
29
        $this->addFlash('sonata_flash_success', 'Video data maj successfully');
30
        return new RedirectResponse($this->admin->generateUrl('list'));
31
    }
32
}
33