Skip to content

Commit

Permalink
Respect --no-plugins and --no-scripts option value follow up
Browse files Browse the repository at this point in the history
CS fix

Fix CS
  • Loading branch information
mxr576 authored and localheinz committed Oct 9, 2023
1 parent 59ffb86 commit c01ddd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For a full diff see [`2.37.0...main`][2.37.0...main].
### Fixed

- Updated `composer/composer` ([#1188]), by [@localheinz]
- Adjusted `NormalizeCommand` to respect `--no-ansi`, `--no-plugins`, `--no-scripts` options ([#1184]), by [@mxr576]

## [`2.37.0`][2.37.0]

Expand Down
14 changes: 9 additions & 5 deletions src/Command/NormalizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,19 @@ private static function updateLockerInWorkingDirectory(
'--ignore-platform-reqs' => true,

Check warning on line 523 in src/Command/NormalizeCommand.php

View workflow job for this annotation

GitHub Actions / Mutation Tests (8.1, locked)

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ */ private static function updateLockerInWorkingDirectory(Console\Application $application, Console\Input\InputInterface $input, Console\Output\OutputInterface $output, string $workingDirectory) : int { - $parameters = ['command' => 'update', '--ignore-platform-reqs' => true, '--lock' => true, '--no-autoloader' => true, '--working-dir' => $workingDirectory]; + $parameters = ['command' => 'update', '--ignore-platform-reqs' => false, '--lock' => true, '--no-autoloader' => true, '--working-dir' => $workingDirectory]; if ($input->hasParameterOption('--no-ansi')) { $parameters[] = '--no-ansi'; }
'--lock' => true,

Check warning on line 524 in src/Command/NormalizeCommand.php

View workflow job for this annotation

GitHub Actions / Mutation Tests (8.1, locked)

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ */ private static function updateLockerInWorkingDirectory(Console\Application $application, Console\Input\InputInterface $input, Console\Output\OutputInterface $output, string $workingDirectory) : int { - $parameters = ['command' => 'update', '--ignore-platform-reqs' => true, '--lock' => true, '--no-autoloader' => true, '--working-dir' => $workingDirectory]; + $parameters = ['command' => 'update', '--ignore-platform-reqs' => true, '--lock' => false, '--no-autoloader' => true, '--working-dir' => $workingDirectory]; if ($input->hasParameterOption('--no-ansi')) { $parameters[] = '--no-ansi'; }
'--no-autoloader' => true,
'--no-plugins' => $input->getOption('no-plugins'),
'--no-scripts' => $input->getOption('no-scripts'),
'--working-dir' => $workingDirectory,
];

if ($input->hasParameterOption('--no-ansi')) {
$parameters = \array_merge($parameters, [
'--no-ansi' => true,
]);
$parameters[] = '--no-ansi';

Check warning on line 530 in src/Command/NormalizeCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/NormalizeCommand.php#L530

Added line #L530 was not covered by tests
}

if ($input->hasParameterOption('--no-plugins')) {
$parameters[] = '--no-plugins';

Check warning on line 534 in src/Command/NormalizeCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/NormalizeCommand.php#L534

Added line #L534 was not covered by tests
}

if ($input->hasParameterOption('--no-scripts')) {
$parameters[] = '--no-scripts';

Check warning on line 538 in src/Command/NormalizeCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/NormalizeCommand.php#L538

Added line #L538 was not covered by tests
}

return $application->run(
Expand Down

0 comments on commit c01ddd4

Please sign in to comment.