@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function createClient(array $config = []): HttpClient |
29 | 29 | { |
30 | - if (! class_exists(Client::class)) { |
|
30 | + if (!class_exists(Client::class)) { |
|
31 | 31 | throw new LogicException('To use the Socket client you need to install the "php-http/socket-client" package.'); |
32 | 32 | } |
33 | 33 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function createClient(array $config = []): HttpClient |
28 | 28 | { |
29 | - if (! class_exists(FileGetContents::class)) { |
|
29 | + if (!class_exists(FileGetContents::class)) { |
|
30 | 30 | throw new \LogicException('To use the Buzz adapter you need to install the "kriswallsmith/buzz: ^1.0" package.'); |
31 | 31 | } |
32 | 32 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function createClient(array $config = []): HttpClient |
30 | 30 | { |
31 | - if (! class_exists('Http\Adapter\Guzzle5\Client')) { |
|
31 | + if (!class_exists('Http\Adapter\Guzzle5\Client')) { |
|
32 | 32 | throw new LogicException('To use the Guzzle5 adapter you need to install the "php-http/guzzle5-adapter" package.'); |
33 | 33 | } |
34 | 34 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function createClient(array $config = []): HttpClient |
20 | 20 | { |
21 | - if (! class_exists(Client::class)) { |
|
21 | + if (!class_exists(Client::class)) { |
|
22 | 22 | throw new LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.'); |
23 | 23 | } |
24 | 24 |
@@ -39,14 +39,14 @@ |
||
39 | 39 | */ |
40 | 40 | public function createClient(array $config = []): HttpClient |
41 | 41 | { |
42 | - if (! class_exists(Client::class)) { |
|
42 | + if (!class_exists(Client::class)) { |
|
43 | 43 | throw new LogicException('To use the Curl client you need to install the "php-http/curl-client" package.'); |
44 | 44 | } |
45 | 45 | |
46 | 46 | // Try to resolve curl constant names |
47 | 47 | foreach ($config as $key => $value) { |
48 | 48 | // If the $key is a string we assume it is a constant |
49 | - if (! is_string($key)) { |
|
49 | + if (!is_string($key)) { |
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function canCreate(ContainerInterface $container, $requestedName): bool |
35 | 35 | { |
36 | - if (! preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
36 | + if (!preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null): HttpClient |
61 | 61 | { |
62 | - if (! preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
62 | + if (!preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
63 | 63 | throw new InvalidArgumentException('Invalid service name'); |
64 | 64 | } |
65 | 65 | |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | |
68 | 68 | $config = $container->get('config')['httplug']['clients'][$clientName] ?? null; |
69 | 69 | |
70 | - if (! is_array($config)) { |
|
70 | + if (!is_array($config)) { |
|
71 | 71 | throw new InvalidArgumentException('Invalid service name'); |
72 | 72 | } |
73 | 73 | |
74 | - if (! empty($config['service'])) { |
|
74 | + if (!empty($config['service'])) { |
|
75 | 75 | $client = $container->get($config['service']); |
76 | 76 | } else { |
77 | 77 | /** @var ClientFactory $factory */ |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | continue; |
111 | 111 | } |
112 | 112 | |
113 | - if (! is_array($nameOrConfig) || ! is_string($nameOrConfig['name'] ?? null)) { |
|
113 | + if (!is_array($nameOrConfig) || !is_string($nameOrConfig['name'] ?? null)) { |
|
114 | 114 | throw new InvalidArgumentException('Invalid client plugin'); |
115 | 115 | } |
116 | 116 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function createPlugin(array $config = []): Plugin |
19 | 19 | { |
20 | - if (! class_exists(RecordPlugin::class)) { |
|
20 | + if (!class_exists(RecordPlugin::class)) { |
|
21 | 21 | throw new LogicException('To use the vcr record plugin you need to install the "php-http/vcr-plugin" package.'); |
22 | 22 | } |
23 | 23 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function createPlugin(array $config = []): Plugin |
30 | 30 | { |
31 | - if (! class_exists(CachePlugin::class)) { |
|
31 | + if (!class_exists(CachePlugin::class)) { |
|
32 | 32 | throw new \LogicException('To use the cache plugin you need to install the "php-http/cache-plugin" package.'); |
33 | 33 | } |
34 | 34 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function createPlugin(array $config = []): Plugin |
28 | 28 | { |
29 | - if (! class_exists(CachePlugin::class)) { |
|
29 | + if (!class_exists(CachePlugin::class)) { |
|
30 | 30 | throw new \LogicException('To use the stopwatch plugin you need to install the "php-http/stopwatch-plugin" package.'); |
31 | 31 | } |
32 | 32 |