Fix bagdes in README #1397
Annotations
11 warnings
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Run mutation tests with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L50
Escaped Mutant for Mutator "CatchBlockRemoval":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L54
Escaped Mutant for Mutator "Catch_":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L57
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
} 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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L57
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
} 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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L76
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L76
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L80
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Connection/PsrClientConnection.php#L84
Escaped Mutant for Mutator "ArrayOneItem":
--- Original
+++ New
@@ @@
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 with pcov and infection/infection:
src/Model/ArtistSearchResult.php#L86
Escaped Mutant for Mutator "UnwrapArrayMap":
--- Original
+++ New
@@ @@
}
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 with pcov and infection/infection:
src/Model/ArtistSearchResult.php#L92
Escaped Mutant for Mutator "CastInt":
--- Original
+++ New
@@ @@
{
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']);
}
}
|
Loading