Skip to content

Fix config merger

Fix config merger #700

Triggered via pull request December 25, 2023 09:06
@vjikvjik
synchronize #163
fix-merger
Status Success
Total duration 4m 21s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation / PHP 8.2-ubuntu-latest: src/Command/CopyCommand.php#L59
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $builder = new PackageFilesProcess($this->getComposer(), [$package]); $filesystem = new Filesystem(); $targetPath = $builder->paths()->absolute(trim($target, '\\/')); - $filesystem->ensureDirectoryExists($targetPath); + $prefix = str_replace('/', '-', $package); foreach ($this->prepareFiles($builder->files(), $selectedFileNames) as $file) { $filename = str_replace('/', '-', $file->filename());
mutation / PHP 8.2-ubuntu-latest: src/Command/CopyCommand.php#L67
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ $filename = str_replace('/', '-', $file->filename()); $filesystem->copy($file->absolutePath(), "{$targetPath}/{$prefix}-{$filename}"); } - return 0; + return 1; } /** * @param PackageFile[] $packageFiles
mutation / PHP 8.2-ubuntu-latest: src/Command/CopyCommand.php#L79
Escaped Mutant for Mutator "ArrayOneItem": --- Original +++ New @@ @@ private function prepareFiles(array $packageFiles, array $selectedFileNames) : array { if (empty($selectedFileNames)) { - return $packageFiles; + return count($packageFiles) > 1 ? array_slice($packageFiles, 0, 1, true) : $packageFiles; } $files = []; foreach ($selectedFileNames as $selectedFileName) {
mutation / PHP 8.2-ubuntu-latest: src/Command/RebuildCommand.php#L33
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ * @psalm-suppress DeprecatedMethod */ new MergePlanProcess($this->getComposer()); - return 0; + return -1; } }
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L67
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ $isOptional = false; if (Options::isOptional($file)) { $isOptional = true; - $file = substr($file, 1); + $file = substr($file, 0); } if (Options::isVariable($file)) { $this->mergePlan->add($file, $packageName, $group);
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L67
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ $isOptional = false; if (Options::isOptional($file)) { $isOptional = true; - $file = substr($file, 1); + $file = substr($file, 2); } if (Options::isVariable($file)) { $this->mergePlan->add($file, $packageName, $group);
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L67
Escaped Mutant for Mutator "UnwrapSubstr": --- Original +++ New @@ @@ $isOptional = false; if (Options::isOptional($file)) { $isOptional = true; - $file = substr($file, 1); + $file = $file; } if (Options::isVariable($file)) { $this->mergePlan->add($file, $packageName, $group);
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L72
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ } if (Options::isVariable($file)) { $this->mergePlan->add($file, $packageName, $group); - continue; + break; } $absoluteFilePath = $this->helper->getAbsolutePackageFilePath($package, $options, $file); if (Options::containsWildcard($file)) {
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L77
Escaped Mutant for Mutator "IfNegation": --- Original +++ New @@ @@ continue; } $absoluteFilePath = $this->helper->getAbsolutePackageFilePath($package, $options, $file); - if (Options::containsWildcard($file)) { + if (!Options::containsWildcard($file)) { $matches = glob($absoluteFilePath); if (empty($matches)) { continue;
mutation / PHP 8.2-ubuntu-latest: src/Composer/MergePlanProcess.php#L81
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ if (Options::containsWildcard($file)) { $matches = glob($absoluteFilePath); if (empty($matches)) { - continue; + break; } foreach ($matches as $match) { $this->mergePlan->add($this->normalizePackageFilePath($package, $match, $isVendorOverrideLayer), $packageName, $group);