ClientFactory::makeWith()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 11
cts 11
cp 1
rs 9.7666
c 0
b 0
f 0
cc 4
nc 6
nop 2
crap 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