Remove unnecessary code in PackagesListBuilder
+ Refactor tests
#661
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#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/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/EventHandler.php#L44
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
$this->runOnAutoloadDump = true;
}
}
- public function onPostAutoloadDump(Event $event) : void
+ protected function onPostAutoloadDump(Event $event) : void
{
if ($this->runOnAutoloadDump) {
$this->processConfigs($event->getComposer());
|
mutation / PHP 8.1-ubuntu-latest:
src/Composer/EventHandler.php#L53
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function onPostUpdateCommandDump(Event $event) : void
{
- $this->processConfigs($event->getComposer());
+
}
public function getCapabilities() : array
{
|
mutation / PHP 8.1-ubuntu-latest:
src/Composer/MergePlanProcess.php#L60
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$options = new Options($package->getExtra());
$packageName = $isVendorOverrideLayer ? Options::VENDOR_OVERRIDE_PACKAGE_NAME : $name;
foreach ($this->helper->getPackageConfig($package) as $group => $files) {
- $this->mergePlan->addGroup($group);
+
foreach ((array) $files as $file) {
$isOptional = false;
if (Options::isOptional($file)) {
|
mutation / PHP 8.1-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.1-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.1-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);
|