1
0
Fork 0

Also mark @putenv and @php deprecated/forbidden as script names to avoid clashes

pull/10309/head
Jordi Boggiano 2021-11-24 22:30:57 +01:00
parent 1b5b5c48bf
commit cc3b53bc2e
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 2 deletions

View File

@ -252,8 +252,10 @@ class ArrayLoader implements LoaderInterface
foreach ($config['scripts'] as $event => $listeners) { foreach ($config['scripts'] as $event => $listeners) {
$config['scripts'][$event] = (array) $listeners; $config['scripts'][$event] = (array) $listeners;
} }
if (isset($config['scripts']['composer'])) { foreach (array('composer', 'php', 'putenv') as $reserved) {
trigger_error('The `composer` script name is reserved for internal use, please avoid defining it', E_USER_DEPRECATED); 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']); $package->setScripts($config['scripts']);
} }