Skip to content

Refactor: split merge plan class #643

Refactor: split merge plan class

Refactor: split merge plan class #643

Triggered via push December 7, 2023 13:50
Status Success
Total duration 1m 20s
Artifacts

mutation.yml

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

Annotations

10 warnings
mutation / PHP 8.1-ubuntu-latest: src/Command/CopyCommand.php#L53
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ * @psalm-suppress PossiblyNullArgument * @psalm-suppress DeprecatedMethod */ - $builder = new PackageFilesProcess($this->getComposer(), [$package]); + $builder = new PackageFilesProcess($this->getComposer(), []); $filesystem = new Filesystem(); $targetPath = $builder->paths()->absolute(trim($target, '\\/')); $filesystem->ensureDirectoryExists($targetPath);
mutation / PHP 8.1-ubuntu-latest: src/Command/CopyCommand.php#L58
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ */ $builder = new PackageFilesProcess($this->getComposer(), [$package]); $filesystem = new Filesystem(); - $targetPath = $builder->paths()->absolute(trim($target, '\\/')); + $targetPath = $builder->paths()->absolute($target); $filesystem->ensureDirectoryExists($targetPath); $prefix = str_replace('/', '-', $package); foreach ($this->prepareFiles($builder->files(), $selectedFileNames) as $file) {
mutation / PHP 8.1-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.1-ubuntu-latest: src/Command/CopyCommand.php#L67
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ $filename = str_replace('/', '-', $file->filename()); $filesystem->copy($file->absolutePath(), "{$targetPath}/{$prefix}-{$filename}"); } - return 0; + return -1; } /** * @param PackageFile[] $packageFiles
mutation / PHP 8.1-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.1-ubuntu-latest: src/Composer/MergePlanProcess.php#L66
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.1-ubuntu-latest: src/Composer/MergePlanProcess.php#L66
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.1-ubuntu-latest: src/Composer/MergePlanProcess.php#L66
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.1-ubuntu-latest: src/Composer/MergePlanProcess.php#L94
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } continue; } - if ($isOptional && !is_file($absoluteFilePath)) { + if ($isOptional || !is_file($absoluteFilePath)) { continue; } $this->mergePlan->add($this->normalizePackageFilePath($package, $absoluteFilePath, $isVendorOverrideLayer), $packageName, $group);
mutation / PHP 8.1-ubuntu-latest: src/Composer/MergePlanProcess.php#L95
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ continue; } if ($isOptional && !is_file($absoluteFilePath)) { - continue; + break; } $this->mergePlan->add($this->normalizePackageFilePath($package, $absoluteFilePath, $isVendorOverrideLayer), $packageName, $group); }