@@ -705,4 +707,35 @@ class Stage implements LoggerAwareInterface {
return$this->t('Staged changes failed to apply, and the site is in an indeterminate state. It is strongly recommended to restore the code and database from a backup.');
}
/**
* Validates a set of package names.
*
* Package names are considered invalid if they look like Drupal project
* names. The only exceptions to this are `php` and `composer`, which Composer
* treats as legitimate requirements.
*
* @param string[] $package_versions
* A set of package names (with or without version constraints), as passed
* to ::require().
*
* @throws \InvalidArgumentException
* Thrown if any of the given package names are invalid.