@@ -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 { |