function InstalledPackagesList::getPackagesNotIn

Same name and namespace in other branches
  1. 11.x core/modules/package_manager/src/InstalledPackagesList.php \Drupal\package_manager\InstalledPackagesList::getPackagesNotIn()

Returns the packages that are in this list, but not in another.

Parameters

self $other: Another list of installed packages.

Return value

static A list of packages which are in this list but not the other one, keyed by name.

File

core/modules/package_manager/src/InstalledPackagesList.php, line 70

Class

InstalledPackagesList
Defines a class to list installed Composer packages.

Namespace

Drupal\package_manager

Code

public function getPackagesNotIn(self $other) : static {
  $packages = array_diff_key($this->getArrayCopy(), $other->getArrayCopy());
  return new static($packages);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.