function InstalledPackagesList::offsetGet

File

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

Class

InstalledPackagesList
Defines a class to list installed Composer packages.

Namespace

Drupal\package_manager

Code

public function offsetGet(mixed $key) : ?InstalledPackage {
    // Overridden to provide a clearer return type hint and compatibility with
    // the null-safe operator.
    if ($this->offsetExists($key)) {
        return parent::offsetGet($key);
    }
    return NULL;
}

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