function RootComposer::checkRootPackage
Checks that the composer content exists in the root package.
Parameters
string $composer_content: The root composer content.
\Composer\Package\RootPackageInterface $root_package: The root package.
Return value
bool TRUE if the composer content and root package match, FALSE if not.
1 call to RootComposer::checkRootPackage()
- RootComposer::writeFiles in composer/
Plugin/ RecipeUnpack/ RootComposer.php - Writes the root composer files.
File
-
composer/
Plugin/ RecipeUnpack/ RootComposer.php, line 156
Class
- RootComposer
- Provides access to and manipulation of the root composer files.
Namespace
Drupal\Composer\Plugin\RecipeUnpackCode
private static function checkRootPackage(string $composer_content, RootPackageInterface $root_package) : bool {
$composer = JsonFile::parseJson($composer_content);
return empty(array_diff_key($composer['require'] ?? [], $root_package->getRequires())) && empty(array_diff_key($composer['require-dev'] ?? [], $root_package->getDevRequires()));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.