Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.25 |
1 | <?php |
||
37 | 204 | public function getClass($name = null) |
|
38 | { |
||
39 | 204 | if (is_null($name)) { |
|
40 | 204 | if (version_compare(Client::VERSION, '6.0.0', '>=')) { |
|
41 | 204 | $name = 'guzzle6'; |
|
42 | } else { |
||
43 | $name = 'guzzle5'; |
||
44 | } |
||
45 | } |
||
46 | 204 | if (isset($this->adapters[$name])) { |
|
47 | 204 | return $this->adapters[$name]; |
|
48 | } |
||
49 | |||
50 | throw new InvalidArgumentException(); |
||
51 | } |
||
52 | } |
||
53 |