Skip to content

Commit

Permalink
require command: allow —fixed option for library dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan authored and emahorvat52 committed Jan 18, 2023
1 parent dc8fe2b commit fd618f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Composer/Command/RequireCommand.php
Expand Up @@ -173,8 +173,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
/**
* @see https://github.com/composer/composer/pull/8313#issuecomment-532637955
*/
if ($packageType !== 'project') {
$io->writeError('<error>The "--fixed" option is only allowed for packages with a "project" type to prevent possible misuses.</error>');
if ($packageType !== 'project' && !$input->getOption('dev')) {
$io->writeError('<error>The "--fixed" option is only allowed for packages with a "project" type or for dev dependencies to prevent possible misuses.</error>');

if (!isset($config['type'])) {
$io->writeError('<error>If your package is not a library, you can explicitly specify the "type" by using "composer config type project".</error>');
Expand Down

0 comments on commit fd618f7

Please sign in to comment.