Add defensive hash length check to VerifyTrait.php #20
Annotations
1 error and 10 warnings
|
Mutation Tests
Process completed with exit code 1.
|
|
Mutation Tests:
src/Features/VerifyTrait.php#L45
Escaped Mutant for Mutator "ConcatOperandRemoval":
@@ @@
if (!in_array($hashFunc, $this->getSupportedHashFunctions(), true)) {
throw new ClientException(
"Unsupported hash function: {$hashFunc}. " .
- "Supported: " . implode(', ', $this->getSupportedHashFunctions())
+ "Supported: "
);
}
}
|
|
Mutation Tests:
src/Features/VerifyTrait.php#L45
Escaped Mutant for Mutator "Concat":
@@ @@
{
if (!in_array($hashFunc, $this->getSupportedHashFunctions(), true)) {
throw new ClientException(
- "Unsupported hash function: {$hashFunc}. " .
- "Supported: " . implode(', ', $this->getSupportedHashFunctions())
+ "Unsupported hash function: {$hashFunc}. " . implode(', ', $this->getSupportedHashFunctions()) . "Supported: "
);
}
}
|
|
Mutation Tests:
src/Features/VerifyTrait.php#L45
Escaped Mutant for Mutator "ConcatOperandRemoval":
@@ @@
{
if (!in_array($hashFunc, $this->getSupportedHashFunctions(), true)) {
throw new ClientException(
- "Unsupported hash function: {$hashFunc}. " .
- "Supported: " . implode(', ', $this->getSupportedHashFunctions())
+ "Unsupported hash function: {$hashFunc}. " . implode(', ', $this->getSupportedHashFunctions())
);
}
}
|
|
Mutation Tests:
src/Features/VerifyTrait.php#L45
Escaped Mutant for Mutator "Concat":
@@ @@
{
if (!in_array($hashFunc, $this->getSupportedHashFunctions(), true)) {
throw new ClientException(
- "Unsupported hash function: {$hashFunc}. " .
- "Supported: " . implode(', ', $this->getSupportedHashFunctions())
+ "Supported: " . "Unsupported hash function: {$hashFunc}. " . implode(', ', $this->getSupportedHashFunctions())
);
}
}
|
|
Mutation Tests:
src/Features/PublishTrait.php#L235
Escaped Mutant for Mutator "NotIdentical":
@@ @@
*/
public function withRecentMerkleRoot(?string $recent): static
{
- if ($recent !== null) {
+ if ($recent === null) {
$prefix = 'pkd-mr-v1:';
if (!str_starts_with($recent, $prefix)) {
throw new ClientException(
|
|
Mutation Tests:
src/Features/ProtocolTrait.php#L262
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
private function preamble(): string
{
$this->assertSecretKeySet();
- $this->fetchServerInfo();
+
return $this->getRecentMerkleRoot();
}
}
|
|
Mutation Tests:
src/Features/ProtocolTrait.php#L261
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
*/
private function preamble(): string
{
- $this->assertSecretKeySet();
+
$this->fetchServerInfo();
return $this->getRecentMerkleRoot();
}
|
|
Mutation Tests:
src/Features/FetchTrait.php#L203
Escaped Mutant for Mutator "Catch_":
@@ @@
$body = $this->parseJsonResponse($auxDataResponse, 'fedi-e2ee:v1/api/actor/get-aux');
$this->assertKeysExist($body, ['aux-id', 'aux-type', 'aux-data', 'actor-id']);
$typeValidator = $this->registry->lookup($body['aux-type']);
- } catch (ClientException | ExtensionException) {
+ } catch (ClientException) {
return null;
}
if (!$typeValidator->isValid($body['aux-data'])) {
|
|
Mutation Tests:
src/Features/FetchTrait.php#L168
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
*/
public function fetchAuxDataByID(string $actor, string $auxDataTypeID): ?AuxData
{
- $this->ensureHttpClientConfigured();
+
$canonical = $this->canonicalize($actor);
return $this->fetchAuxDataInternal($canonical, $auxDataTypeID);
}
|
|
Mutation Tests:
src/Features/FetchTrait.php#L74
Escaped Mutant for Mutator "ArrayOneItem":
@@ @@
$pk->setMetadata($meta);
$publicKeys[] = $pk;
}
- return $publicKeys;
+ return count($publicKeys) > 1 ? array_slice($publicKeys, 0, 1, true) : $publicKeys;
}
/**
|
Loading