Issues (8)

src/Loader.php (2 issues)

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
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
$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