TestController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Example;
4
5
use Zapheus\Renderer\RendererInterface;
6
7
/**
8
 * Test Controller
9
 *
10
 * @package App
11
 * @author  Rougin Gutib <[email protected]>
12
 */
13
class TestController
14
{
15
    /**
16
     * @var \Zapheus\Renderer\RendererInterface
17
     */
18
    protected $renderer;
19
20
    /**
21
     * Initializes the HTTP controller instance.
22
     *
23
     * @param \Zapheus\Renderer\RendererInterface $renderer
24
     */
25 3
    public function __construct(RendererInterface $renderer)
26
    {
27 3
        $this->renderer = $renderer;
28 3
    }
29
30
    /**
31
     * Greets you with a "lorem ipsum" text.
32
     *
33
     * @return string
34
     */
35 3
    public function greet()
36
    {
37 3
        return $this->renderer->render('sample.test');
38
    }
39
}
40