leeway/window Migration path clarification #64
Annotations
10 warnings
Execute Infection:
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);
}
|
Execute Infection:
src/Factory.php#L28
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
} catch (Throwable $throwable) {
throw new InvalidArgumentException('Not a valid OTP provisioning URI', $throwable->getCode(), $throwable);
}
- if ($clock === null) {
+ if ($clock !== null) {
trigger_deprecation('spomky-labs/otphp', '11.3.0', 'The parameter "$clock" will become mandatory in 12.0.0. Please set a valid PSR Clock implementation instead of "null".');
$clock = new InternalClock();
}
|
Execute Infection:
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] !== '');
|
Execute Infection:
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]);
|
Execute Infection:
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
{
|
Execute Infection:
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
|
Execute Infection:
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
|
Execute Infection:
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
|
Execute Infection:
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.
|
Execute Infection:
src/HOTP.php#L69
Escaped Mutant for Mutator "LogicalOrNegation":
--- Original
+++ New
@@ @@
*/
public function verify(string $otp, null|int $counter = null, null|int $window = null) : bool
{
- $counter >= 0 || throw new InvalidArgumentException('The counter must be at least 0.');
+ !($counter >= 0 || throw new InvalidArgumentException('The counter must be at least 0.'));
if ($counter === null) {
$counter = $this->getCounter();
} elseif ($counter < $this->getCounter()) {
|
The logs for this run have expired and are no longer available.
Loading