@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | private function getApiList(string $version): array |
| 57 | 57 | { |
| 58 | - $versionApis = array_filter($this->apiDecider->getApis(), function (Api $api) use ($version) { |
|
| 58 | + $versionApis = array_filter($this->apiDecider->getApis(), function(Api $api) use ($version) { |
|
| 59 | 59 | return $version === $api->getEndpoint()->getVersion(); |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | - return array_map(function (Api $api) { |
|
| 62 | + return array_map(function(Api $api) { |
|
| 63 | 63 | return [ |
| 64 | 64 | 'method' => $api->getEndpoint()->getMethod(), |
| 65 | 65 | 'version' => $api->getEndpoint()->getVersion(), |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | private function createParamsList(ApiHandlerInterface $handler): array |
| 83 | 83 | { |
| 84 | 84 | /** @phpstan-ignore-next-line */ |
| 85 | - return array_map(function (InputParam $param): array { |
|
| 85 | + return array_map(function(InputParam $param): array { |
|
| 86 | 86 | $parameter = [ |
| 87 | 87 | 'type' => $param->getType(), |
| 88 | 88 | 'key' => $param->getKey(), |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } elseif ($param->getType() === InputParam::TYPE_COOKIE) { |
| 187 | 187 | $cookieFields[$key][] = $valueData; |
| 188 | 188 | } else { |
| 189 | - $getFields[$key][] = urlencode((string)$valueData); |
|
| 189 | + $getFields[$key][] = urlencode((string) $valueData); |
|
| 190 | 190 | } |
| 191 | 191 | } else { |
| 192 | 192 | if (in_array($param->getType(), [InputParam::TYPE_POST, InputParam::TYPE_FILE], true)) { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } elseif ($param->getType() === InputParam::TYPE_COOKIE) { |
| 197 | 197 | $cookieFields[$key] = $valueData; |
| 198 | 198 | } else { |
| 199 | - $getFields[$key] = urlencode((string)$valueData); |
|
| 199 | + $getFields[$key] = urlencode((string) $valueData); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | { |
| 245 | 245 | $result = []; |
| 246 | 246 | foreach ($values as $key => $value) { |
| 247 | - if (!is_array($value)) { |
|
| 247 | + if ( ! is_array($value)) { |
|
| 248 | 248 | $result[$key] = $value; |
| 249 | 249 | continue; |
| 250 | 250 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct(string $status, array $errors = []) |
| 23 | 23 | { |
| 24 | - if (!in_array($status, [self::STATUS_OK, self::STATUS_ERROR], true)) { |
|
| 24 | + if ( ! in_array($status, [self::STATUS_OK, self::STATUS_ERROR], true)) { |
|
| 25 | 25 | throw new InvalidArgumentException($status . ' is not valid validation result status'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | return new ValidationResult(ValidationResult::STATUS_ERROR, ['missing data']); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if (!empty($this->rawInput) && json_last_error()) { |
|
| 49 | + if ( ! empty($this->rawInput) && json_last_error()) { |
|
| 50 | 50 | return new ValidationResult(ValidationResult::STATUS_ERROR, [json_last_error_msg()]); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (!$value && $this->isRequired() === self::OPTIONAL) { |
|
| 53 | + if ( ! $value && $this->isRequired() === self::OPTIONAL) { |
|
| 54 | 54 | return new ValidationResult(ValidationResult::STATUS_OK); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $fullSchema = json_decode($this->schema, true); |
| 70 | 70 | |
| 71 | - if (!empty($examples = $this->getExamples())) { |
|
| 71 | + if ( ! empty($examples = $this->getExamples())) { |
|
| 72 | 72 | if (count($examples) === 1) { |
| 73 | 73 | $fullSchema['example'] = is_array($this->getExample()) ? $this->getExample() : json_decode($this->getExample(), true); |
| 74 | 74 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if (!empty($fullSchema['examples'])) { |
|
| 82 | + if ( ! empty($fullSchema['examples'])) { |
|
| 83 | 83 | $this->description .= <<< HTML |
| 84 | 84 | <div> |
| 85 | 85 | Select Example: |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | { |
| 25 | 25 | foreach ($this->params as $param) { |
| 26 | 26 | $validationResult = $param->validate(); |
| 27 | - if (!$validationResult->isOk()) { |
|
| 27 | + if ( ! $validationResult->isOk()) { |
|
| 28 | 28 | $this->errors[$param->getKey()] = $validationResult->getErrors(); |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | - return !empty($this->errors); |
|
| 31 | + return ! empty($this->errors); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | /** |
| 128 | 128 | * @param mixed[] $values |
| 129 | 129 | * @return mixed[] |
| 130 | - */ |
|
| 130 | + */ |
|
| 131 | 131 | private function filterFormValues(array $values): array |
| 132 | 132 | { |
| 133 | 133 | foreach ($this->handler->params() as $param) { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | return $this->code; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function getExpiration(): DateTimeInterface|false|null |
|
| 47 | + public function getExpiration(): DateTimeInterface | false | null |
|
| 48 | 48 | { |
| 49 | 49 | return $this->expiration; |
| 50 | 50 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * @return array<mixed>|JsonSerializable |
| 56 | 56 | */ |
| 57 | - public function getPayload(): array|JsonSerializable |
|
| 57 | + public function getPayload(): array | JsonSerializable |
|
| 58 | 58 | { |
| 59 | 59 | return $this->payload; |
| 60 | 60 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return $this->charset; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function getExpiration(): DateTimeInterface|false|null |
|
| 72 | + public function getExpiration(): DateTimeInterface | false | null |
|
| 73 | 73 | { |
| 74 | 74 | return $this->expiration; |
| 75 | 75 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function validate(ResponseInterface $response): ValidationResultInterface |
| 24 | 24 | { |
| 25 | - if (!$response instanceof JsonApiResponse) { |
|
| 25 | + if ( ! $response instanceof JsonApiResponse) { |
|
| 26 | 26 | return new ValidationResult(ValidationResult::STATUS_ERROR); |
| 27 | 27 | } |
| 28 | 28 | |