@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function createPlugin(array $config = []): Plugin |
29 | 29 | { |
30 | - if (! class_exists(CachePlugin::class)) { |
|
30 | + if (!class_exists(CachePlugin::class)) { |
|
31 | 31 | throw new \LogicException('To use the logger plugin you need to install the "php-http/logger-plugin" package.'); |
32 | 32 | } |
33 | 33 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | public function createClient(array $config = []): ClientInterface |
16 | 16 | { |
17 | - if (! class_exists(Client::class)) { |
|
17 | + if (!class_exists(Client::class)) { |
|
18 | 18 | throw new LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.'); |
19 | 19 | } |
20 | 20 |
@@ -29,14 +29,14 @@ |
||
29 | 29 | |
30 | 30 | public function createClient(array $config = []): ClientInterface |
31 | 31 | { |
32 | - if (! class_exists(Client::class)) { |
|
32 | + if (!class_exists(Client::class)) { |
|
33 | 33 | throw new LogicException('To use the Curl client you need to install the "php-http/curl-client" package.'); |
34 | 34 | } |
35 | 35 | |
36 | 36 | // Try to resolve curl constant names |
37 | 37 | foreach ($config as $key => $value) { |
38 | 38 | // If the $key is a string we assume it is a constant |
39 | - if (! is_string($key)) { |
|
39 | + if (!is_string($key)) { |
|
40 | 40 | continue; |
41 | 41 | } |
42 | 42 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public function __construct(ClientInterface $client = null) |
18 | 18 | { |
19 | - if (! class_exists(Client::class)) { |
|
19 | + if (!class_exists(Client::class)) { |
|
20 | 20 | throw new LogicException('To use the mock adapter you need to install the "php-http/mock-client" package.'); |
21 | 21 | } |
22 | 22 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public function createClient(array $config = []): ClientInterface |
18 | 18 | { |
19 | - if (! class_exists(Client::class)) { |
|
19 | + if (!class_exists(Client::class)) { |
|
20 | 20 | throw new LogicException('To use the React adapter you need to install the "php-http/react-adapter" package.'); |
21 | 21 | } |
22 | 22 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function createClient(array $config = []): ClientInterface |
23 | 23 | { |
24 | - if (! class_exists(FileGetContents::class)) { |
|
24 | + if (!class_exists(FileGetContents::class)) { |
|
25 | 25 | throw new \LogicException('To use the Buzz adapter you need to install the "kriswallsmith/buzz: ^1.0" package.'); |
26 | 26 | } |
27 | 27 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | public function createClient(array $config = []): ClientInterface |
16 | 16 | { |
17 | - if (! class_exists(Client::class)) { |
|
17 | + if (!class_exists(Client::class)) { |
|
18 | 18 | throw new LogicException('To use the Socket client you need to install the "php-http/socket-client" package.'); |
19 | 19 | } |
20 | 20 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function canCreate(ContainerInterface $container, $requestedName): bool |
28 | 28 | { |
29 | - if (! preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
29 | + if (!preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null): ClientInterface |
51 | 51 | { |
52 | - if (! preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
52 | + if (!preg_match('/^httplug\.clients\.[^.]+$/', $requestedName)) { |
|
53 | 53 | throw new InvalidArgumentException('Invalid service name'); |
54 | 54 | } |
55 | 55 | |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | |
58 | 58 | $config = $container->get('config')['httplug']['clients'][$clientName] ?? null; |
59 | 59 | |
60 | - if (! is_array($config)) { |
|
60 | + if (!is_array($config)) { |
|
61 | 61 | throw new InvalidArgumentException('Invalid service name'); |
62 | 62 | } |
63 | 63 | |
64 | - if (! empty($config['service'])) { |
|
64 | + if (!empty($config['service'])) { |
|
65 | 65 | $client = $container->get($config['service']); |
66 | 66 | } else { |
67 | 67 | /** @var ClientFactory $factory */ |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | |
102 | - if (! is_array($nameOrConfig) || ! is_string($nameOrConfig['name'] ?? null)) { |
|
102 | + if (!is_array($nameOrConfig) || !is_string($nameOrConfig['name'] ?? null)) { |
|
103 | 103 | throw new InvalidArgumentException('Invalid client plugin'); |
104 | 104 | } |
105 | 105 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function getPluginConfig(ContainerInterface $container, string $requestedName): ?array |
34 | 34 | { |
35 | - if (! str_starts_with($requestedName, 'httplug.plugins.')) { |
|
35 | + if (!str_starts_with($requestedName, 'httplug.plugins.')) { |
|
36 | 36 | return null; |
37 | 37 | } |
38 | 38 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $config = $container->get('config')['httplug']['plugins'][$pluginName][$serviceName] ?? null; |
48 | 48 | |
49 | - if (! is_array($config)) { |
|
49 | + if (!is_array($config)) { |
|
50 | 50 | return null; |
51 | 51 | } |
52 | 52 |