Test Failed
Push — master ( 1c8415...9f6059 )
by Julien
04:01
created

Modules::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the Zemit Framework.
4
 *
5
 * (c) Zemit Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE.txt
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zemit\Bootstrap;
12
13
use Phalcon\Application\AbstractApplication;
14
15
/**
16
 * Class Modules
17
 * Registering a list of module
18
 *
19
 * @author Julien Turbide <[email protected]>
20
 * @copyright Zemit Team <[email protected]>
21
 *
22
 * @since 1.0
23
 * @version 1.0
24
 *
25
 * @package Zemit\Bootstrap
26
 */
27
class Modules
28
{
29
    public $modulesDir;
30
    
31
    public function __construct(AbstractApplication $application = null)
32
    {
33
        /**
34
         * Register application modules
35
         */
36
        $config = $application->getDI()->get('config');
0 ignored issues
show
Bug introduced by
The method getDI() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        $config = $application->/** @scrutinizer ignore-call */ getDI()->get('config');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
        $application->registerModules($config->modules->toArray());
38
        $application->setDefaultModule($config->router->defaults->module);
39
    }
40
}
41