ClientFactory   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 18
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeWith() 0 15 4
1
<?php namespace Stevenmaguire\Yelp;
2
3
class ClientFactory
4
{
5 8
    public static function makeWith(array $options = array(), $version = null)
6
    {
7 8
        if (is_null($version)) {
8 2
            $version = Version::TWO;
9 1
        }
10
11
        switch ($version) {
12 8
            case Version::TWO:
13 4
                return new v2\Client($options);
14 4
            case Version::THREE:
15 2
                return new v3\Client($options);
16 1
            default:
17 2
                throw new Exception\InvalidVersionException;
18 1
        }
19
    }
20
}
21