CloudFrameworkApp   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 50%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 1
cbo 4
dl 0
loc 34
ccs 5
cts 10
cp 0.5
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A run() 0 6 1
1
<?php
2
namespace CloudFramework;
3
use CloudFramework\Tool\ConfigLoader;
4
use CloudFramework\Tool\RequestParser;
5
use CloudFramework\Tool\Performance;
6
use CloudFramework\Patterns\Singleton;
7
8
/**
9
 * Class CloudFramework
10
 * @package CloudFramework\Core
11
 */
12
class CloudFrameworkApp extends Singleton
13
{
14
15
    /**
16
     * @var string
17
     */
18
    private $app_name;
19
20
    /**
21
     * @var \CloudFramework\Tool\ConfigLoader $config
22
     */
23
    protected $config;
24
25
    /**
26
     * @var \CloudFramework\Tool\Performance $performance
27
     */
28
    protected $perfomance;
29
30 1
    public function __construct($name = 'CloudFramework', $configFile = '')
31
    {
32 1
        $this->performance = new Performance();
0 ignored issues
show
Bug introduced by
The property performance does not seem to exist. Did you mean perfomance?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
33
34 1
        $this->app_name = $name;
35 1
        $this->config = ConfigLoader::getInstance($configFile);
36
37 1
    }
38
39
    public function run()
40
    {
41
        echo "Hello " . RequestParser::getQueryParam('name') . '<br>' . $this . "<pre>";
42
        $this->config->setConf('a','b');
43
        echo $this->config->getConf('a').' '.ConfigLoader::getConfParam('a');
44
    }
45
}
46