Issues (26)

src/AppBundle/Controller/HomeController.php (2 issues)

Severity
1
<?php
2
3
namespace AppBundle\Controller;
4
5
use AppBundle\Entity\Video;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\Filesystem\Filesystem;
8
use Symfony\Component\HttpFoundation\Request;
9
use Symfony\Component\HttpFoundation\Response;
10
11
class HomeController extends Controller
12
{
13
    public function indexAction(Request $request)
0 ignored issues
show
The parameter $request 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

13
    public function indexAction(/** @scrutinizer ignore-unused */ Request $request)

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...
14
    {
15
        $latestVideos = $this->getDoctrine()
16
            ->getRepository(Video::class)
17
            ->findLatest(getenv('APP_NUMBER_VIDEO_HOMEPAGE'));
18
        // replace this example code with whatever you need
19
        return $this->render('home/index.html.twig', [
20
            'latestVideos' => $latestVideos,
21
        ]);
22
    }
23
24
    public function versionAction(Request $request)
0 ignored issues
show
The parameter $request 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 versionAction(/** @scrutinizer ignore-unused */ Request $request)

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
        $fileSystem = new Filesystem();
27
        $buildFile = $this->get('kernel')->getRootDir() . '/../build.json';
28
        if ($fileSystem->exists($buildFile)) {
29
            $versionInfo = json_decode(file_get_contents($buildFile));
30
        }
31
        return $this->render('home/version.html.twig', [
32
            'versionInfo' => isset($versionInfo) ? $versionInfo : null,
33
        ]);
34
35
    }
36
}
37