You are here

protected function PackageManager::filterPlatformPackages in Composer Manager 8

Removes platform packages from the requirements.

Platform packages include 'php' and its various extensions ('ext-curl', 'ext-intl', etc). Drupal modules have their own methods for raising the PHP requirement ('php' key in $extension.info.yml) or requiring additional PHP extensions (hook_requirements()).

Parameters

array $requirements: The requirements.

Return value

array The filtered requirements array.

1 call to PackageManager::filterPlatformPackages()
PackageManager::buildMergedExtensionPackage in src/PackageManager.php
Builds a package containing the merged fields of all extension packages.

File

src/PackageManager.php, line 283

Class

PackageManager
Manages composer packages.

Namespace

Drupal\composer_manager

Code

protected function filterPlatformPackages($requirements) {
  foreach ($requirements as $package => $constraint) {
    if (strpos($package, '/') === FALSE) {
      unset($requirements[$package]);
    }
  }
  return $requirements;
}