@@ -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 { |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class UnableToCreateRequestException |
7 | 7 | * @package LunixREST\RequestFactory\Exceptions |
8 | 8 | */ |
9 | -class UnableToCreateRequestException extends \Exception |
|
10 | -{ |
|
9 | +class UnableToCreateRequestException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |