Neos\Flow\Package\PackageManager::unregisterPackage PHP Method

unregisterPackage() protected method

Unregisters a package from the list of available packages
protected unregisterPackage ( Neos\Flow\Package\PackageInterface $package ) : void
$package Neos\Flow\Package\PackageInterface The package to be unregistered
return void
    protected function unregisterPackage(PackageInterface $package)
    {
        $packageKey = $package->getPackageKey();
        if (!$this->isPackageAvailable($packageKey)) {
            throw new Exception\InvalidPackageStateException('Package "' . $packageKey . '" is not registered.', 1338996142);
        }
        if (!isset($this->packages[$packageKey])) {
            return;
        }
        $composerName = $package->getComposerName();
        unset($this->packages[$packageKey], $this->packageKeys[strtolower($packageKey)], $this->packageStatesConfiguration['packages'][$composerName]);
        $this->sortAndSavePackageStates($this->packageStatesConfiguration);
    }