@@ -55,10 +55,10 @@ |
||
55 | 55 | public function __construct( |
56 | 56 | string $method, |
57 | 57 | string $endpoint, |
58 | - ?string $element, |
|
58 | + ? string $element, |
|
59 | 59 | array $acceptableMIMETypes, |
60 | - ?string $version, |
|
61 | - ?string $apiKey, |
|
60 | + ? string $version, |
|
61 | + ? string $apiKey, |
|
62 | 62 | array $queryData, |
63 | 63 | $data |
64 | 64 | ) { |
@@ -47,13 +47,13 @@ |
||
47 | 47 | $parsedHeaders = $this->headerParser->parse($serverRequest->getHeaders()); |
48 | 48 | |
49 | 49 | $urlQueryData = []; |
50 | - if($urlQueryString = $parsedURL->getQueryString()) |
|
50 | + if ($urlQueryString = $parsedURL->getQueryString()) |
|
51 | 51 | { |
52 | 52 | parse_str($parsedURL->getQueryString(), $urlQueryData); |
53 | 53 | } |
54 | 54 | |
55 | 55 | $apiKey = $parsedURL->getAPIKey(); |
56 | - if($apiKey === null) |
|
56 | + if ($apiKey === null) |
|
57 | 57 | { |
58 | 58 | $apiKey = $parsedHeaders->getAPIKey(); |
59 | 59 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * @param array $acceptableMIMETypes |
38 | 38 | * @param null|string $queryString |
39 | 39 | */ |
40 | - public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString) |
|
40 | + public function __construct(string $endpoint, ? string $element, ? string $version, ? string $apiKey, array $acceptableMIMETypes, ? string $queryString) |
|
41 | 41 | { |
42 | 42 | $this->endpoint = $endpoint; |
43 | 43 | $this->element = $element; |
@@ -47,13 +47,13 @@ |
||
47 | 47 | { |
48 | 48 | $method = $this->mapEndpointMethod($request); |
49 | 49 | if (!method_exists($endpoint, $method)) { |
50 | - throw new MethodNotFoundException("The endpoint method " . $method . " was not found"); |
|
50 | + throw new MethodNotFoundException("The endpoint method ".$method." was not found"); |
|
51 | 51 | } |
52 | 52 | return call_user_func([$endpoint, $method], $request); |
53 | 53 | } |
54 | 54 | |
55 | 55 | protected function mapEndpointMethod(APIRequest $request): string |
56 | 56 | { |
57 | - return strtolower($request->getMethod()) . ($request->getElement() ? 'All': ''); |
|
57 | + return strtolower($request->getMethod()).($request->getElement() ? 'All' : ''); |
|
58 | 58 | } |
59 | 59 | } |
@@ -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 | } |