Controller   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 20%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
eloc 9
c 2
b 0
f 1
dl 0
loc 43
rs 10
ccs 2
cts 10
cp 0.2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __call() 0 7 2
A getRootNamespace() 0 3 1
A getApplication() 0 3 1
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