From cc3b53bc2e3ea3a497961982a6f155ba0bbc19d9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 24 Nov 2021 22:30:57 +0100 Subject: [PATCH] Also mark @putenv and @php deprecated/forbidden as script names to avoid clashes --- src/Composer/Package/Loader/ArrayLoader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index f45dfb472..7e91cdac0 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -252,8 +252,10 @@ class ArrayLoader implements LoaderInterface foreach ($config['scripts'] as $event => $listeners) { $config['scripts'][$event] = (array) $listeners; } - if (isset($config['scripts']['composer'])) { - trigger_error('The `composer` script name is reserved for internal use, please avoid defining it', E_USER_DEPRECATED); + foreach (array('composer', 'php', 'putenv') as $reserved) { + if (isset($config['scripts'][$reserved])) { + trigger_error('The `'.$reserved.'` script name is reserved for internal use, please avoid defining it', E_USER_DEPRECATED); + } } $package->setScripts($config['scripts']); }