Completed
Push — master ( 198a3e...84e362 )
by Rougin
10:23
created

MethodHelper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A call() 0 8 1
1
<?php
2
3
namespace Rougin\Credo\Helpers;
4
5
use Doctrine\Common\Util\Inflector;
6
7
/**
8
 * Method Helper
9
 *
10
 * @package Credo
11
 * @author  Rougin Royce Gutib <[email protected]>
12
 */
13
class MethodHelper
14
{
15
    /**
16
     * Calls methods from the specified object in underscore case.
17
     *
18
     * @param  object $object
19
     * @param  string $method
20
     * @param  mixed  $parameters
21
     * @return mixed
22
     */
23
    public static function call($object, $method, $parameters)
24
    {
25
        $method = Inflector::camelize((string) $method);
26
27
        $instance = (array) array($object, (string) $method);
28
29
        return call_user_func_array($instance, $parameters);
30
    }
31
}
32