Issues (9)

src/Controller/ApiController.php (2 issues)

Severity
1
<?php
2
3
namespace App\Controller;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Slim\Container;
7
use Slim\Http\Request;
8
use Slim\Http\Response;
9
use Slim\Router;
10
11
/**
12
 * Class ApiController.
13
 */
14
class ApiController extends AppController
15
{
16
    /**
17
     * @var Router
18
     */
19
    protected $router;
20
21
    /**
22
     * ApiController constructor.
23
     *
24
     * @param Container $container
25
     */
26 2
    public function __construct(Container $container)
27
    {
28 2
        parent::__construct($container);
29 2
        $this->router = $container->get('router');
30 2
    }
31
32
    /**
33
     * Index action.
34
     *
35
     * @param Request $request
36
     * @param Response $response
37
     *
38
     * @return ResponseInterface
39
     */
40 1
    public function indexAction(Request $request, Response $response): ResponseInterface
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

40
    public function indexAction(/** @scrutinizer ignore-unused */ Request $request, Response $response): ResponseInterface

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...
41
    {
42 1
        return $this->json($response, ['message' => 'Hello World']);
43
    }
44
45
    /**
46
     * Redirect to home.
47
     *
48
     * @param Request $request
49
     * @param Response $response
50
     *
51
     * @return ResponseInterface
52
     */
53 1
    public function redirectToHomeAction(Request $request, Response $response): ResponseInterface
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

53
    public function redirectToHomeAction(/** @scrutinizer ignore-unused */ Request $request, Response $response): ResponseInterface

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...
54
    {
55 1
        return $this->redirect($response, $this->router->pathFor('root'));
56
    }
57
}
58