Expand references #647
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
10 warnings
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#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/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.1-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.1-ubuntu-latest:
src/Command/RebuildCommand.php#L33
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @psalm-suppress DeprecatedMethod
*/
new MergePlanProcess($this->getComposer());
- return 0;
+ return 1;
}
}
|
mutation / PHP 8.1-ubuntu-latest:
src/Composer/MergePlanCollector.php#L153
Escaped Mutant for Mutator "UnwrapArrayMerge":
--- Original
+++ New
@@ @@
$result = [];
foreach ($items as $item) {
if ($item === $variable) {
- $result = array_merge($result, $files);
+ $result = $files;
} else {
$result[] = $item;
}
|
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);
|