Conditions | 5 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 6.6 |
Changes | 0 |
1 | <?php |
||
39 | 79 | public function getClass($name = null) |
|
40 | { |
||
41 | 79 | if (is_null($name)) { |
|
42 | 79 | if (defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { |
|
43 | 79 | $name = 'guzzle6'; |
|
44 | } elseif (version_compare(Client::class . '::VERSION', '6.0.0', '>=')) { |
||
45 | $name = 'guzzle6'; |
||
46 | } else { |
||
47 | $name = 'guzzle5'; |
||
48 | } |
||
49 | } |
||
50 | 79 | if (isset($this->adapters[$name])) { |
|
51 | 79 | return $this->adapters[$name]; |
|
52 | } |
||
53 | |||
54 | throw new InvalidArgumentException(); |
||
55 | } |
||
70 |