Merge release 11.2.1 into 11.3.x #88
integrate.yml
on: pull_request
3️⃣ Static Analysis
25s
4️⃣ Coding Standards
26s
5️⃣ Mutation Testing
45s
6️⃣ Rector Checkstyle
22s
7️⃣ Exported files
2s
Matrix: 2️⃣ Unit and functional tests
Annotations
7 errors and 10 warnings
3️⃣ Static Analysis:
src/TOTP.php#L95
Parameter #1 $timestamp of method OTPHP\TOTP::timecode() expects int<0, max>, int given.
|
3️⃣ Static Analysis:
tests/TOTPTest.php#L1
Ignored error pattern #^Parameter \#1 \$otp of method OTPHP\\TOTP\:\:verify\(\) expects non\-empty\-string, string given\.$# in path /home/runner/work/otphp/otphp/tests/TOTPTest.php was not matched in reported errors.
|
3️⃣ Static Analysis:
tests/TOTPTest.php#L1
Ignored error pattern #^Parameter \#3 \$leeway of method OTPHP\\TOTP\:\:verify\(\) expects int\<0, max\>\|null, int given\.$# in path /home/runner/work/otphp/otphp/tests/TOTPTest.php was not matched in reported errors.
|
3️⃣ Static Analysis:
tests/TOTPTest.php#L245
PHPDoc tag @return with type array<int, array> is incompatible with native type Iterator.
|
3️⃣ Static Analysis:
tests/TOTPTest.php#L380
PHPDoc tag @return with type array<array<int>> is incompatible with native type Iterator.
|
3️⃣ Static Analysis:
tests/TOTPTest.php#L399
PHPDoc tag @return with type array<array<int, bool|int|string>> is incompatible with native type Iterator.
|
3️⃣ Static Analysis
Process completed with exit code 2.
|
5️⃣ Mutation Testing:
src/Factory.php#L24
Escaped Mutant for Mutator "Throw_":
--- Original
+++ New
@@ @@
{
try {
$parsed_url = Url::fromString($uri);
- $parsed_url->getScheme() === 'otpauth' || throw new InvalidArgumentException('Invalid scheme.');
+ $parsed_url->getScheme() === 'otpauth' || new InvalidArgumentException('Invalid scheme.');
} catch (Throwable $throwable) {
throw new InvalidArgumentException('Not a valid OTP provisioning URI', $throwable->getCode(), $throwable);
}
|
5️⃣ Mutation Testing:
src/Factory.php#L24
Escaped Mutant for Mutator "LogicalOrNegation":
--- Original
+++ New
@@ @@
{
try {
$parsed_url = Url::fromString($uri);
- $parsed_url->getScheme() === 'otpauth' || throw new InvalidArgumentException('Invalid scheme.');
+ !($parsed_url->getScheme() === 'otpauth' || throw new InvalidArgumentException('Invalid scheme.'));
} catch (Throwable $throwable) {
throw new InvalidArgumentException('Not a valid OTP provisioning URI', $throwable->getCode(), $throwable);
}
|
5️⃣ Mutation Testing:
src/Factory.php#L63
Escaped Mutant for Mutator "LogicalOrNegation":
--- Original
+++ New
@@ @@
return;
}
if ($otp->getIssuer() !== null) {
- $result[0] === $otp->getIssuer() || throw new InvalidArgumentException('Invalid OTP: invalid issuer in parameter');
+ !($result[0] === $otp->getIssuer() || throw new InvalidArgumentException('Invalid OTP: invalid issuer in parameter'));
$otp->setIssuerIncludedAsParameter(true);
}
assert($result[0] !== '');
|
5️⃣ Mutation Testing:
src/Factory.php#L66
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
if ($otp->getIssuer() !== null) {
$result[0] === $otp->getIssuer() || throw new InvalidArgumentException('Invalid OTP: invalid issuer in parameter');
- $otp->setIssuerIncludedAsParameter(true);
+
}
assert($result[0] !== '');
$otp->setIssuer($result[0]);
|
5️⃣ Mutation Testing:
src/Factory.php#L71
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$otp->setIssuerIncludedAsParameter(true);
}
assert($result[0] !== '');
- $otp->setIssuer($result[0]);
+
}
private static function createOTP(Url $parsed_url, ClockInterface $clock): OTPInterface
{
|
5️⃣ Mutation Testing:
src/HOTP.php#L39
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$htop = new self($secret);
$htop->setCounter(self::DEFAULT_COUNTER);
$htop->setDigest(self::DEFAULT_DIGEST);
- $htop->setDigits(self::DEFAULT_DIGITS);
+
return $htop;
}
public static function generate(): self
|
5️⃣ Mutation Testing:
src/HOTP.php#L52
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
public function getCounter(): int
{
$value = $this->getParameter('counter');
- is_int($value) && $value >= 0 || throw new InvalidArgumentException('Invalid "counter" parameter.');
+ is_int($value) || $value >= 0 || throw new InvalidArgumentException('Invalid "counter" parameter.');
return $value;
}
public function getProvisioningUri(): string
|
5️⃣ Mutation Testing:
src/HOTP.php#L52
Escaped Mutant for Mutator "Throw_":
--- Original
+++ New
@@ @@
public function getCounter(): int
{
$value = $this->getParameter('counter');
- is_int($value) && $value >= 0 || throw new InvalidArgumentException('Invalid "counter" parameter.');
+ is_int($value) && $value >= 0 || new InvalidArgumentException('Invalid "counter" parameter.');
return $value;
}
public function getProvisioningUri(): string
|
5️⃣ Mutation Testing:
src/HOTP.php#L52
Escaped Mutant for Mutator "LogicalOrNegation":
--- Original
+++ New
@@ @@
public function getCounter(): int
{
$value = $this->getParameter('counter');
- is_int($value) && $value >= 0 || throw new InvalidArgumentException('Invalid "counter" parameter.');
+ !(is_int($value) && $value >= 0 || throw new InvalidArgumentException('Invalid "counter" parameter.'));
return $value;
}
public function getProvisioningUri(): string
|
5️⃣ Mutation Testing:
src/HOTP.php#L59
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
}
public function getProvisioningUri(): string
{
- return $this->generateURI('hotp', ['counter' => $this->getCounter()]);
+ return $this->generateURI('hotp', []);
}
/**
* If the counter is not provided, the OTP is verified at the actual counter.
|