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

VideoAdminController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
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 20
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\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