From fd618f7924ce17999a84fbc4d37e767f00096ae8 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Mon, 5 Sep 2022 16:54:24 +0200 Subject: [PATCH] =?UTF-8?q?`require`=20command:=20allow=20`=E2=80=94fixed`?= =?UTF-8?q?=20option=20for=20library=20dev=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Composer/Command/RequireCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 5b4e1e3decef..6ce7a0c69a16 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -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('The "--fixed" option is only allowed for packages with a "project" type to prevent possible misuses.'); + if ($packageType !== 'project' && !$input->getOption('dev')) { + $io->writeError('The "--fixed" option is only allowed for packages with a "project" type or for dev dependencies to prevent possible misuses.'); if (!isset($config['type'])) { $io->writeError('If your package is not a library, you can explicitly specify the "type" by using "composer config type project".');