| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php namespace Stevenmaguire\Yelp; |
||
| 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 |