Skip to content

Remove psalm in favor of phpstan #1403

Remove psalm in favor of phpstan

Remove psalm in favor of phpstan #1403

Triggered via pull request February 7, 2025 06:54
Status Failure
Total duration 9m 54s
Artifacts

continuous-integration.yml

on: pull_request
run  /  Generate test matrix
3s
run / Generate test matrix
Matrix: run / Code Coverage
Matrix: run / Coding Standards
Matrix: run / Lint composer.json
Matrix: run / Mutation Tests
Matrix: run / Static Code Analysis
Matrix: run / tests
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 10 warnings
run / Coding Standards (8.3)
Process completed with exit code 2.
run / Static Code Analysis (8.3)
Process completed with exit code 2.
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L50
Escaped Mutant for Mutator "CatchBlockRemoval": @@ @@ throw $e; } catch (Exception $e) { throw new ApiException('Technical error occurred.', 500, $e); - } catch (ClientExceptionInterface $e) { - throw new ApiException('Technical error occurred.', 500, $e); } } /**
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L54
Escaped Mutant for Mutator "Catch_": @@ @@ try { $response = $this->client->sendRequest($request); return $this->parseResponse($response); - } catch (ApiException|NotFoundException $e) { + } catch (ApiException $e) { throw $e; } catch (Exception $e) { throw new ApiException('Technical error occurred.', 500, $e);
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L57
Escaped Mutant for Mutator "DecrementInteger": @@ @@ } catch (ApiException|NotFoundException $e) { throw $e; } catch (Exception $e) { - throw new ApiException('Technical error occurred.', 500, $e); + throw new ApiException('Technical error occurred.', 499, $e); } catch (ClientExceptionInterface $e) { throw new ApiException('Technical error occurred.', 500, $e); }
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L57
Escaped Mutant for Mutator "IncrementInteger": @@ @@ } catch (ApiException|NotFoundException $e) { throw $e; } catch (Exception $e) { - throw new ApiException('Technical error occurred.', 500, $e); + throw new ApiException('Technical error occurred.', 501, $e); } catch (ClientExceptionInterface $e) { throw new ApiException('Technical error occurred.', 500, $e); }
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L76
Escaped Mutant for Mutator "DecrementInteger": @@ @@ if (JSON_ERROR_NONE !== json_last_error()) { throw new ApiException('Server did not reply with a valid response.', $response->getStatusCode()); } - if (404 === $response->getStatusCode()) { + if (403 === $response->getStatusCode()) { throw new NotFoundException('Server did not find any entity for the request.'); } if ($response->getStatusCode() >= 400) {
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L76
Escaped Mutant for Mutator "IncrementInteger": @@ @@ if (JSON_ERROR_NONE !== json_last_error()) { throw new ApiException('Server did not reply with a valid response.', $response->getStatusCode()); } - if (404 === $response->getStatusCode()) { + if (405 === $response->getStatusCode()) { throw new NotFoundException('Server did not find any entity for the request.'); } if ($response->getStatusCode() >= 400) {
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L80
Escaped Mutant for Mutator "GreaterThanOrEqualTo": @@ @@ if (404 === $response->getStatusCode()) { throw new NotFoundException('Server did not find any entity for the request.'); } - if ($response->getStatusCode() >= 400) { + if ($response->getStatusCode() > 400) { throw new ApiException('Technical error occurred.', $response->getStatusCode()); } return $array;
run / Mutation Tests (8.3): src/Connection/PsrClientConnection.php#L84
Escaped Mutant for Mutator "ArrayOneItem": @@ @@ if ($response->getStatusCode() >= 400) { throw new ApiException('Technical error occurred.', $response->getStatusCode()); } - return $array; + return count($array) > 1 ? array_slice($array, 0, 1, true) : $array; } private function buildRequest(string $method, array $params, string $requestMethod): RequestInterface {
run / Mutation Tests (8.3): src/Model/ArtistSearchResult.php#L84
Escaped Mutant for Mutator "UnwrapArrayMap": @@ @@ } public static function fromApi(array $response): self { - return new self(array_map(static function (array $data): Artist { - return Artist::fromApi($data); - }, $response['artist']), (int) $response['page'], (int) $response['itemsPerPage'], (int) $response['total']); + return new self($response['artist'], (int) $response['page'], (int) $response['itemsPerPage'], (int) $response['total']); } }
run / Mutation Tests (8.3): src/Model/ArtistSearchResult.php#L90
Escaped Mutant for Mutator "CastInt": @@ @@ { return new self(array_map(static function (array $data): Artist { return Artist::fromApi($data); - }, $response['artist']), (int) $response['page'], (int) $response['itemsPerPage'], (int) $response['total']); + }, $response['artist']), $response['page'], (int) $response['itemsPerPage'], (int) $response['total']); } }