CAnaxDefault   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A loadRoutes() 0 8 2
1
<?php
2
3
namespace Anax\App;
4
5
/**
6
 * Anax base class for an application.
7
 *
8
 */
9
class CAnaxDefault
10
{
11
    use \Anax\DI\TInjectable,
12
        \Anax\TConfigure,
13
        \Anax\TLoadFile;
14
15
16
17
    /**
18
     * Construct.
19
     *
20
     * @param array $di dependency injection of service container.
21
     */
22
    public function __construct($di)
23
    {
24
        $this->di = $di;
25
        $this->configure("app.php");
26
    }
27
28
29
30
    /**
31
     * Load routes from files.
32
     *
33
     * @param array $di dependency injection of service container.
0 ignored issues
show
Bug introduced by
There is no parameter named $di. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
34
     *
35
     * @return $this for chaining.
36
     */
37
    public function loadRoutes()
38
    {
39
        $routeFiles = $this->config["routeFiles"];
40
        foreach ($routeFiles as $file) {
41
            $this->loadFile($file, ["app" => $this]);
42
        }
43
        return $this;
44
    }
45
}
46