CloudFrameworkApp::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
crap 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