@@ -90,7 +90,7 @@ |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | $body = $response->getBody(); |
93 | - while(!$body->eof()) { |
|
93 | + while (!$body->eof()) { |
|
94 | 94 | echo $body->read(1024); |
95 | 95 | } |
96 | 96 | } |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | * @param MIMEProvider|null $MIMEProvider |
34 | 34 | * @throws InvalidRegexPatternException |
35 | 35 | */ |
36 | - public function __construct(string $pattern, ?MIMEProvider $MIMEProvider = null) |
|
36 | + public function __construct(string $pattern, ? MIMEProvider $MIMEProvider = null) |
|
37 | 37 | { |
38 | 38 | $this->pattern = $pattern; |
39 | 39 | |
40 | - if(@preg_match($pattern, null) === false) { |
|
40 | + if (@preg_match($pattern, null) === false) { |
|
41 | 41 | throw new InvalidRegexPatternException("Unable to parse regex pattern", preg_last_error()); |
42 | 42 | } |
43 | 43 | $this->MIMEProvider = $MIMEProvider; |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | public function parse(UriInterface $uri): ParsedURL |
54 | 54 | { |
55 | 55 | $matches = []; |
56 | - if(preg_match($this->pattern, $uri->getPath(), $matches) === 0) { |
|
56 | + if (preg_match($this->pattern, $uri->getPath(), $matches) === 0) { |
|
57 | 57 | throw new InvalidRequestURLException("Unable to parse request path: did not match regex"); |
58 | 58 | } |
59 | - if(!($endpoint = $matches["endpoint"] ?? null)) { |
|
59 | + if (!($endpoint = $matches["endpoint"] ?? null)) { |
|
60 | 60 | throw new InvalidRequestURLException("Unable to match endpoint in url"); |
61 | 61 | } |
62 | 62 | $element = $matches["element"] ?? null; |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | $apiKey = $matches["apiKey"] ?? null; |
65 | 65 | |
66 | 66 | $acceptableMimeTypes = []; |
67 | - if(($acceptableExtension = $matches["acceptableExtension"] ?? null)) { |
|
68 | - if(!$this->MIMEProvider) { |
|
67 | + if (($acceptableExtension = $matches["acceptableExtension"] ?? null)) { |
|
68 | + if (!$this->MIMEProvider) { |
|
69 | 69 | throw new UnableToParseURLException("Unable to accept acceptable extensions"); |
70 | 70 | } else { |
71 | 71 | try { |
@@ -18,9 +18,9 @@ |
||
18 | 18 | public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') |
19 | 19 | { |
20 | 20 | $keys = []; |
21 | - if($config->has($configKey, $namespace)){ |
|
21 | + if ($config->has($configKey, $namespace)) { |
|
22 | 22 | $configKeys = $config->get($configKey, $namespace); |
23 | - if(is_array($configKeys)) { |
|
23 | + if (is_array($configKeys)) { |
|
24 | 24 | $keys = $configKeys; |
25 | 25 | } |
26 | 26 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function findKey(string $key): KeyMeta |
33 | 33 | { |
34 | - if($this->hasKey($key)) { |
|
34 | + if ($this->hasKey($key)) { |
|
35 | 35 | return new KeyMeta($key); |
36 | 36 | } else { |
37 | 37 | throw new UnableToFindKeyException("Unable to find API key in array."); |