Completed
Push — master ( 446046...611444 )
by Patrick
03:18
created

Provider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMethodByName() 0 12 3
1
<?php
2
3
class Provider extends Singleton
4
{
5
    /** The methods loaded by the provider */
6
    protected $methods;
7
8
    /**
9
     * Get the method object corresponding to the name
10
     *
11
     * @param string $methodName The class name of the method to get the instance for
12
     *
13
     * @return boolean|stdClass The specified method class instance or false if it is not loaded
14
     */
15
    public function getMethodByName($methodName)
16
    {
17
        $count = count($this->methods);
18
        for($i = 0; $i < $count; $i++)
19
        {
20
            if(strcasecmp(get_class($this->methods[$i]), $methodName) === 0)
21
            {
22
                return $this->methods[$i];
23
            }
24
        }
25
        return false;
26
    }
27
}
28
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
29