Docs: improve explanation of command parameters #131
Annotations
10 warnings
Infection PHP:
src/Command/ExplainCommand.php#L40
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
{
parent::__construct();
$this->scheduler = $scheduler;
- $this->explainer = $explainer ?? new DefaultCronExpressionExplainer();
+ $this->explainer = new DefaultCronExpressionExplainer() ?? $explainer;
$this->clock = $clock ?? new SystemClock();
}
public static function getDefaultName() : string
|
Infection PHP:
src/Command/ExplainCommand.php#L119
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$output->writeln("<error>Option --seconds expects an int<0, 59>, '{$seconds}' given.</error>");
}
if ($id !== null) {
- $hasErrors = true;
+ $hasErrors = false;
$output->writeln('<error>Option --seconds cannot be used with --id.</error>');
}
if ($expression === null) {
|
Infection PHP:
src/Command/ExplainCommand.php#L140
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
$timezone = new DateTimeZone($timezone);
}
if ($id !== null) {
- $hasErrors = true;
+ $hasErrors = false;
$output->writeln('<error>Option --timezone cannot be used with --id.</error>');
}
if ($expression === null) {
|
Infection PHP:
src/Command/ExplainCommand.php#L155
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
return null;
}
// Happens only when $hasErrors = true
- assert(!is_string($seconds) && $seconds >= 0 && $seconds <= 59);
+ assert((!is_string($seconds) || $seconds >= 0) && $seconds <= 59);
assert(!is_string($timezone));
return ['id' => $id, 'expression' => $expression, 'seconds' => $seconds, 'timezone' => $timezone];
}
|
Infection PHP:
src/Command/ExplainCommand.php#L155
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
return null;
}
// Happens only when $hasErrors = true
- assert(!is_string($seconds) && $seconds >= 0 && $seconds <= 59);
+ assert(!is_string($seconds) && $seconds >= 0 || $seconds <= 59);
assert(!is_string($timezone));
return ['id' => $id, 'expression' => $expression, 'seconds' => $seconds, 'timezone' => $timezone];
}
|
Infection PHP:
src/Command/ExplainCommand.php#L216
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
{
$timeZone = $jobSchedule->getTimeZone();
$clockTimeZone = $this->clock->now()->getTimezone();
- if ($timeZone === null && $renderedTimeZone->getName() !== $clockTimeZone->getName()) {
+ if ($timeZone !== null && $renderedTimeZone->getName() !== $clockTimeZone->getName()) {
$timeZone = $clockTimeZone;
}
if ($timeZone === null) {
|
Infection PHP:
src/Command/ExplainCommand.php#L216
Escaped Mutant for Mutator "NotIdentical":
--- Original
+++ New
@@ @@
{
$timeZone = $jobSchedule->getTimeZone();
$clockTimeZone = $this->clock->now()->getTimezone();
- if ($timeZone === null && $renderedTimeZone->getName() !== $clockTimeZone->getName()) {
+ if ($timeZone === null && $renderedTimeZone->getName() === $clockTimeZone->getName()) {
$timeZone = $clockTimeZone;
}
if ($timeZone === null) {
|
Infection PHP:
src/Command/ExplainCommand.php#L216
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
{
$timeZone = $jobSchedule->getTimeZone();
$clockTimeZone = $this->clock->now()->getTimezone();
- if ($timeZone === null && $renderedTimeZone->getName() !== $clockTimeZone->getName()) {
+ if ($timeZone === null || $renderedTimeZone->getName() !== $clockTimeZone->getName()) {
$timeZone = $clockTimeZone;
}
if ($timeZone === null) {
|
Infection PHP:
src/Command/ListCommand.php#L55
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
parent::__construct();
$this->scheduler = $scheduler;
$this->clock = $clock ?? new SystemClock();
- $this->explainer = $explainer ?? new DefaultCronExpressionExplainer();
+ $this->explainer = new DefaultCronExpressionExplainer() ?? $explainer;
}
public static function getDefaultName() : string
{
|
Infection PHP:
src/Command/ListCommand.php#L233
Escaped Mutant for Mutator "Break_":
--- Original
+++ New
@@ @@
$count = 0;
foreach ($jobSchedules as $key => $value) {
if ($count >= $next) {
- break;
+ continue;
}
$slicedJobs[$key] = $value;
$count++;
|
Loading