BaseControllerWithUtilityMethods::hello()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Nip\Controllers\Tests\Fixtures\Controllers;
4
5
use Nip\Controllers\Traits\BaseControllerTrait;
6
7
/**
8
 * Class BaseControllerWithUtilityMethods
9
 * @package Nip\Controllers\Tests\Fixtures
10
 */
11
class BaseControllerWithUtilityMethods
12
{
13
    use BaseControllerTrait;
14
15
    public function beforeAction()
16
    {
17
        $this->getResponse(true)->headers->set('beforeAction', 'value');
18
    }
19
20
    public function index()
21
    {
22
    }
23
24
    /**
25
     * @param string $name
26
     * @return string
27
     */
28
    public function hello($name = '')
29
    {
30
        return 'hello'
31
            .(!empty($name) ? ' '.$name : '');
32
    }
33
34
    public function afterAction()
35
    {
36
        $this->getResponse()->headers->set('afterAction', 'value');
37
    }
38
}
39