1
0
Fork 0

`require` command: allow `—fixed` option for library dev dependencies

pull/11063/head
Gregor Harlan 2022-09-05 16:54:24 +02:00 committed by Jordi Boggiano
parent ec8bbe9056
commit fc75efd711
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 2 deletions

View File

@ -173,8 +173,8 @@ EOT
/** /**
* @see https://github.com/composer/composer/pull/8313#issuecomment-532637955 * @see https://github.com/composer/composer/pull/8313#issuecomment-532637955
*/ */
if ($packageType !== 'project') { if ($packageType !== 'project' && !$input->getOption('dev')) {
$io->writeError('<error>The "--fixed" option is only allowed for packages with a "project" type to prevent possible misuses.</error>'); $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'])) { 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>'); $io->writeError('<error>If your package is not a library, you can explicitly specify the "type" by using "composer config type project".</error>');