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

Modules   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
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