Completed
Push — master ( c7315e...9f7a59 )
by Derek Stephen
02:49
created

IndexController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Bone\App\Controller;
4
5
use Bone\Controller\Controller;
6
use Laminas\Diactoros\Response\HtmlResponse;
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * Class IndexController
12
 *
13
 * If you need to create a constructor, edit the package to set up automatically via dependency injection
14
 *
15
 * @package App\Controller
16
 */
17
class IndexController extends Controller
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: getSiteConfig, getTranslator, getView, setSiteConfig, setTranslator, setView
Loading history...
18
{
19
    /**
20
     * @param ServerRequestInterface $request
21
     * @param array $args
22
     * @return ResponseInterface
23
     */
24
    public function indexAction(ServerRequestInterface $request, array $args) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        $body = $this->view->render('index/index');
0 ignored issues
show
Bug introduced by
The property view does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
27
28
        return new HtmlResponse($body);
29
    }
30
31
    /**
32
     * @param ServerRequestInterface $request
33
     * @param array $args
34
     * @return ResponseInterface
35
     */
36
    public function learnAction(ServerRequestInterface $request, array $args) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38
        $body = $this->view->render('index/learn');
39
40
        return new HtmlResponse($body);
41
    }
42
}
43