Controller::getRootNamespace()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
ccs 0
cts 1
cp 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Nip\Controllers;
4
5
use Nip\Controllers\Traits\BaseControllerTrait;
6
use Nip\Utility\Traits\CanBootTraitsTrait;
7
8
/**
9
 * Class Controller
10
 * @package Nip
11
 */
12
class Controller
13
{
14
    use BaseControllerTrait;
15
    use CanBootTraitsTrait;
16
17
    /**
18 3
     * Controller constructor.
19
     */
20
    public function __construct()
21 3
    {
22
        $this->bootTraits();
23
//        $this->inflectName();
24
    }
25
26
    /**
27
     * @param $name
28
     * @param $arguments
29
     * @return bool|mixed
30
     */
31
    public function __call($name, $arguments)
32
    {
33
        if ($name === ucfirst($name)) {
34
            return $this->getHelper($name);
35
        }
36
37
        return trigger_error("Call to undefined method [$name] in controller [{$this->getClassName()}]", E_USER_ERROR);
38
    }
39
40
41
    /**
42
     * @return string
43
     */
44
    public function getRootNamespace()
45
    {
46
        return $this->getApplication()->getRootNamespace();
47
    }
48
49
    /**
50
     * @return Application
0 ignored issues
show
Bug introduced by
The type Nip\Controllers\Application was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
     */
52
    public function getApplication()
53
    {
54
        return app('app');
55
    }
56
}
57