@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * @param MIMEProvider|null $MIMEProvider |
33 | 33 | * @throws InvalidRegexPatternException |
34 | 34 | */ |
35 | - public function __construct(string $pattern, ?MIMEProvider $MIMEProvider = null) |
|
35 | + public function __construct(string $pattern, ? MIMEProvider $MIMEProvider = null) |
|
36 | 36 | { |
37 | 37 | $this->pattern = $pattern; |
38 | 38 | |
39 | - if(@preg_match($pattern, null) === false) { |
|
39 | + if (@preg_match($pattern, null) === false) { |
|
40 | 40 | throw new InvalidRegexPatternException("Unable to parse regex pattern", preg_last_error()); |
41 | 41 | } |
42 | 42 | $this->MIMEProvider = $MIMEProvider; |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | public function parse(UriInterface $uri): ParsedURL |
52 | 52 | { |
53 | 53 | $matches = []; |
54 | - if(preg_match($this->pattern, $uri->getPath(), $matches) === 0) { |
|
54 | + if (preg_match($this->pattern, $uri->getPath(), $matches) === 0) { |
|
55 | 55 | throw new InvalidRequestURLException("Unable to parse request path: did not match regex"); |
56 | 56 | } |
57 | - if(!($endpoint = $matches["endpoint"] ?? null)) { |
|
57 | + if (!($endpoint = $matches["endpoint"] ?? null)) { |
|
58 | 58 | throw new InvalidRequestURLException("Unable to match endpoint in url"); |
59 | 59 | } |
60 | 60 | $element = $matches["element"] ?? null; |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $apiKey = $matches["apiKey"] ?? null; |
63 | 63 | |
64 | 64 | $acceptableMimeTypes = []; |
65 | - if(($acceptableExtension = $matches["acceptableExtension"] ?? null)) { |
|
66 | - if(!$this->MIMEProvider) { |
|
65 | + if (($acceptableExtension = $matches["acceptableExtension"] ?? null)) { |
|
66 | + if (!$this->MIMEProvider) { |
|
67 | 67 | throw new InvalidRequestURLException("Unable to accept acceptable extensions"); |
68 | 68 | } else { |
69 | 69 | try { |