Loader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 23
ccs 9
cts 9
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A repository() 0 15 2
1
<?php
2
3
namespace Rougin\Credo;
4
5
/**
6
 * Loader
7
 *
8
 * @package Credo
9
 * @author  Rougin Gutib <[email protected]>
10
 */
11
class Loader extends \CI_Loader
12
{
13
    /**
14
     * Loads and instantiates Doctrine-based repositories.
15
     *
16
     * @param  string|array $repository
17
     * @return self
18
     */
19 3
    public function repository($repository)
20
    {
21 3
        $repositories = (array) $repository;
22
23 3
        $path = APPPATH . 'repositories/';
0 ignored issues
show
Bug introduced by
The constant Rougin\Credo\APPPATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
24
25 3
        foreach ($repositories as $repository) {
0 ignored issues
show
introduced by
$repository is overwriting one of the parameters of this function.
Loading history...
26 3
            $file = ucfirst($repository);
27
28 3
            $suffix = '_repository.php';
29
30 3
            require $path . $file . $suffix;
31 2
        }
32
33 3
        return $this;
34
    }
35
}
36