Remove unreachable code #99
build.yaml
on: push
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Annotations
6 warnings
Mutation tests (8.3, highest):
src/CronBuilder.php#L70
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
/**
* @param iterable<string|\SplFileInfo> $files
*/
- public function addFiles(iterable $files) : self
+ protected function addFiles(iterable $files) : self
{
foreach ($files as $file) {
$this->addFile($file);
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L123
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
}
public static function merge(string $existingCron, self $cronBuilder) : string
{
- $existingCron = trim($existingCron);
+ $existingCron = $existingCron;
$cron = $cronBuilder->build();
if ('' === $existingCron) {
return $cron;
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L133
Escaped Mutant for Mutator "PregQuote":
--- Original
+++ New
@@ @@
if ('' === $existingCron) {
return $cron;
}
- $replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -1, $replacements);
+ $replacedCron = preg_replace(sprintf('/%s.*%s/ms', $cronBuilder->getParsedDelimiter('begin'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -1, $replacements);
if (0 === $replacements) {
return $existingCron . "\n\n" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L134
Escaped Mutant for Mutator "PregQuote":
--- Original
+++ New
@@ @@
if ('' === $existingCron) {
return $cron;
}
- $replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -1, $replacements);
+ $replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), $cronBuilder->getParsedDelimiter('end')), $cron, $existingCron, -1, $replacements);
if (0 === $replacements) {
return $existingCron . "\n\n" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L138
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
if ('' === $existingCron) {
return $cron;
}
- $replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -1, $replacements);
+ $replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -2, $replacements);
if (0 === $replacements) {
return $existingCron . "\n\n" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronJob.php#L29
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
}
public function toString() : string
{
- return sprintf('%s %s%s', (string) $this->schedule, $this->command, $this->description === null ? '' : ' # ' . $this->description);
+ return sprintf('%s %s%s', $this->schedule, $this->command, $this->description === null ? '' : ' # ' . $this->description);
}
public function __toString() : string
{
|