You are here

protected function FeaturesAssigner::cleanup in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/FeaturesAssigner.php \Drupal\features\FeaturesAssigner::cleanup()

Clean up the package list after all config has been assigned.

1 call to FeaturesAssigner::cleanup()
FeaturesAssigner::assignConfigPackages in src/FeaturesAssigner.php
Apply all enabled package assignment methods.

File

src/FeaturesAssigner.php, line 148

Class

FeaturesAssigner
Class responsible for performing package assignment.

Namespace

Drupal\features

Code

protected function cleanup() {
  $packages = $this->featuresManager
    ->getPackages();
  foreach ($packages as $index => $package) {
    if ($package
      ->getStatus() === FeaturesManagerInterface::STATUS_NO_EXPORT && empty($package
      ->getConfig()) && empty($package
      ->getConfigOrig())) {
      unset($packages[$index]);
    }
  }
  $this->featuresManager
    ->setPackages($packages);
}