Remove bundle from kernal.

@param string $bundle
509228
public function removeBundle($bundle)
    {
        $bundles = $this->getBundles();
        if (($key = array_search($this->getBundleString($bundle), $bundles)) !== false) {
            unset($bundles[$key]);
            $this->setBundles($bundles);
        }
    }
1159876
public function remove()
	{
		$package = $this->arguments->getOpt('package');
		if (empty($package))
		{
			$this->output->error('A package name is required');
		}

		Composer::removePackage($package);
		$this->output->addLine("Done. $package has been removed.");
	}
608765
@Override
    public void removedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
        removeWebJarLibs(webJarLibs);
    }
375224
def bundle(context, yes, bundle_name):
    """"""
    bundle_obj = context.obj['store'].bundle(bundle_name)
    if bundle_obj is None:
        click.echo(click.style('bundle not found', fg='red'))
        context.abort()
    version_obj = bundle_obj.versions[0]
    if version_obj.included_at:
        question = f"remove bundle version from file system and database: {version_obj.full_path}"
    else:
        question = f"remove bundle version from database: {version_obj.created_at.date()}"
    if yes or click.confirm(question):
        if version_obj.included_at:
            shutil.rmtree(version_obj.full_path, ignore_errors=True)
        version_obj.delete()
        context.obj['store'].commit()
        click.echo(f"version deleted: {version_obj.full_path}")
270672
public function bundleExists($bundle)
    {
        $kernelBundles = $this->getConfigurationPool()->getContainer()->getParameter('kernel.bundles');
        if (array_key_exists($bundle, $kernelBundles)) {
            return true;
        }
        if (in_array($bundle, $kernelBundles)) {
            return true;
        }

        return false;
    }
1371663
public function addBundle($bundle)
    {
        $bundle = $this->getBundleString($bundle);
        // not root bundle
        if (strpos($this->getKernal(), $bundle) === false) {
            $bundles = $this->getBundles();
            if (!in_array($bundle, $bundles)) {
                $bundles[] = $bundle;
                $this->setBundles($bundles);
            }
        }
    }
648745
public function pushBundle(string $name, string $bundle): self
    {
        if (!class_exists($bundle))
        {
            throw new Invalid('Processor ' . $bundle . ' not found');
        }

        $this->bundles[$name] = $bundle;

        return $this;
    }
977376
public synchronized void removeMetadataForModelsIn(Bundle bundle) {
        if (bundle == null) {
            throw new IllegalArgumentException("method parameter bundle must not be null");
        }

        Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache();
        Iterator<Map.Entry<Class<?>, ResourceModelMetadataHolder>> it = newCache.entrySet().iterator();
        while (it.hasNext()) {
            OsgiModelSource<?> source = it.next().getValue().source;
            if (source.getBundleId() == bundle.getBundleId()) {
                it.remove();
            }
        }
        this.cache = newCache;
    }
31007
@SuppressWarnings("PMD.UseVarargs")
    public void disableBundle(final Class<? extends GuiceyBundle>[] bundles) {
        for (Class<? extends GuiceyBundle> bundle : bundles) {
            registerDisable(ConfigItem.Bundle, bundle);
        }
    }
915233
public function removeType(string $type)
    {
        if (!$this->removing && Type::hasType($type)) {
            $this->removing = true;
            Type::overrideType($type, null);
        }

        $this->removing = false;
        unset($this->types[$type]);
    }
410691
public function cleanUp($serial)
    {
        $resourceFile = $this->getResource($serial);
        $file = new \core_kernel_classes_Resource($resourceFile);

        return $file->delete();
    }
1097742
public function dropColumn($name, $bundle = null)
    {
        $attr = TableRegistry::get('Eav.EavAttributes')->find()
            ->where([
                'name' => $name,
                'table_alias' => $this->_table->table(),
                'bundle IS' => $bundle,
            ])
            ->limit(1)
            ->first();

        Cache::clear(false, 'eav_table_attrs');
        if ($attr) {
            return (bool)TableRegistry::get('Eav.EavAttributes')->delete($attr);
        }

        return false;
    }
929391
public function remove($alias)
    {
        unset($this->definitions[$alias]);
        unset($this->sharedDefinitions[$alias]);
        unset($this->shared[$alias]);
    }
985823
public static function unregisterApp(?string $app = null): void
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (self::isAppRegistered($app)) {
            unset(self::$repositories[$app]);
        }
    }
1012276
protected function removePackageVendorSymlink(PackageInterface $package)
    {
        if (
            $this->config->isSymlinkEnabled()
            && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))
        ) {
            $this->io->write(array(
                '  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> '
                . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)',
                ''
            ));

            $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package));
            $this->filesystem->removeEmptyDirectory($symlinkParentDirectory);
        }
    }
428529
protected function removeStandards(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $srcStandards = $this->getSourceStandards($package);
        $dstStandards = $this->getDestinationStandards($repo);
        $this->io->writeError('    Removing PHP-CodeSniffer Standards:', false);
        foreach ($srcStandards as $srcStandard) {
            if (! $dstStandards->hasStandard($srcStandard)) {
                continue;
            }
            $this->io->writeError(sprintf(' <info>%s</info>', $srcStandard->getName()));
            $dstStandard = $dstStandards->getStandard($srcStandard);

            $this->filesystem->removeDirectory($dstStandard->getPath());
        }
    }
1009542
public static function exists($bundle)
		{
			return $bundle == DEFAULT_BUNDLE or Arrays::in(Inflector::lower($bundle), static::names());
		}