Add infection configuration file #86
build.yaml
on: push
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Annotations
1 error and 10 warnings
Mutation tests (8.3, highest)
Process completed with exit code 1.
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L27
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
private readonly Context $context;
public function __construct(Environment $twig = null)
{
- $this->twig = $twig ?? new Environment(new ArrayLoader());
+ $this->twig = new Environment(new ArrayLoader()) ?? $twig;
$this->context = new Context();
}
/**
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L34
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
/**
* @param 'begin'|'end' $type
*/
- public function getParsedDelimiter(string $type) : string
+ protected function getParsedDelimiter(string $type) : string
{
if ('begin' === $type) {
return $this->parse('###> ' . $this->delimiter . ' ###');
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L53
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
$this->delimiter = $delimiter;
return $this;
}
- public function addFile(string|\SplFileInfo $file) : self
+ protected function addFile(string|\SplFileInfo $file) : self
{
if ($file instanceof \SplFileInfo) {
$file = $file->getPathname();
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L55
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
}
public function addFile(string|\SplFileInfo $file) : self
{
- if ($file instanceof \SplFileInfo) {
+ if (true) {
$file = $file->getPathname();
}
if (!file_exists($file)) {
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L136
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
if (!is_object($cronjob)) {
throw new \InvalidArgumentException(sprintf('The cron job must be an object, got %s', gettype($cronjob)));
}
- if (!$cronjob instanceof CronJob) {
+ if (!true) {
throw new \InvalidArgumentException(sprintf('The cron job must be an instance of %s, got %s', CronJob::class, $cronjob::class));
}
$crontab .= $this->parse($cronjob->toString()) . "\n";
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L149
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
}
public static function merge(string $existingCron, self $cronBuilder) : string
{
- $existingCron = trim($existingCron);
+ $existingCron = $existingCron;
if ('' === $existingCron) {
return $cronBuilder->build();
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L160
Escaped Mutant for Mutator "PregQuote":
--- Original
+++ New
@@ @@
return $cronBuilder->build();
}
$cron = $cronBuilder->build();
- $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" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L161
Escaped Mutant for Mutator "PregQuote":
--- Original
+++ New
@@ @@
return $cronBuilder->build();
}
$cron = $cronBuilder->build();
- $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" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L165
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
return $cronBuilder->build();
}
$cron = $cronBuilder->build();
- $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" . $cron;
}
|
Mutation tests (8.3, highest):
src/CronBuilder.php#L169
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
}
$cron = $cronBuilder->build();
$replacedCron = preg_replace(sprintf('/%s.*%s/ms', preg_quote($cronBuilder->getParsedDelimiter('begin'), '/'), preg_quote($cronBuilder->getParsedDelimiter('end'), '/')), $cron, $existingCron, -1, $replacements);
- if (0 === $replacements) {
+ if (-1 === $replacements) {
return $existingCron . "\n" . $cron;
}
if (1 === $replacements) {
|