Completed
Push — dev-master ( 5b442c...963dd7 )
by Derek Stephen
07:05 queued 10s
created

IndexController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Controller;
4
5
use Bone\Mvc\View\ViewEngine;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
use Zend\Diactoros\Response\HtmlResponse;
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 1
 *
15
 * @package App\Controller
16 1
 */
17 1
class IndexController
18 1
{
19
20 2
    /** @var ViewEngine $view */
21
    private $view;
22 2
23 1
    /**
24
     * DragonController constructor.
25 2
     */
26
    public function __construct(ViewEngine $view)
27 1
    {
28
        $this->view = $view;
29
    }
30 1
31
    /**
32 1
     * @param ServerRequestInterface $request
33
     * @param array $args
34
     * @return ResponseInterface
35
     */
36 1
    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...
37
    {
38
        $body = $this->view->render('index/index');
39 1
40 1
        return new HtmlResponse($body);
41
    }
42
43
    /**
44
     * @param ServerRequestInterface $request
45
     * @param array $args
46
     * @return ResponseInterface
47
     */
48
    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...
49
    {
50
        $body = $this->view->render('index/learn');
51
52
        return new HtmlResponse($body);
53
    }
54
}
55