Modules   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A modulesConfig() 0 25 3
1
<?php
2
/**
3
 * @copyright Copyright (c) 2011 - 2014 Oleksandr Torosh (http://wezoom.net)
4
 * @author Oleksandr Torosh <[email protected]>
5
 */
6
7
namespace Application\Loader;
8
9
use Phalcon\Text;
10
11
class Modules
12
{
13
14
    public function modulesConfig($modules_list)
15
    {
16
        $namespaces = array();
17
        $modules = array();
18
19
        if (!empty($modules_list)) {
20
            foreach ($modules_list as $module) {
21
                $namespaces[$module] = APPLICATION_PATH . '/modules/' . $module;
22
                $simple = Text::uncamelize($module);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $simple is correct as \Phalcon\Text::uncamelize($module) (which targets Phalcon\Text::uncamelize()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
23
                $simple = str_replace('_', '-', $simple);
24
                $modules[$simple] = array(
25
                    'className' => $module . '\Module',
26
                    'path' => APPLICATION_PATH . '/modules/' . $module . '/Module.php'
27
                );
28
            }
29
        }
30
        $modules_array = array(
31
            'loader' => array(
32
                'namespaces' => $namespaces,
33
            ),
34
            'modules' => $modules,
35
        );
36
37
        return $modules_array;
38
    }
39
40
}