Completed
Push — master ( 8c968a...c71f44 )
by Rougin
04:50
created

EntityRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 12 2
1
<?php
2
3
namespace Rougin\Credo;
4
5
use Doctrine\Common\Util\Inflector;
6
use Doctrine\ORM\EntityRepository as BaseEntityRepository;
7
8
/**
9
 * Entity Repository
10
 *
11
 * @package Credo
12
 * @author  Rougin Royce Gutib <[email protected]>
13
 */
14
class EntityRepository extends BaseEntityRepository
15
{
16
    /**
17
     * Calls methods from EntityRepository in underscore case.
18
     *
19
     * @param  string $method
20
     * @param  mixed  $parameters
21
     * @return mixed
22
     */
23 6
    public function __call($method, $parameters)
24
    {
25 6
        $method = Inflector::camelize($method);
26
27 6
        if (method_exists($this, $method)) {
28 6
            $class = [$this, $method];
29
            
30 6
            return call_user_func_array($class, $parameters);
31
        }
32
33
        return $this;
34
    }
35
}
36