getArrayCopy(); foreach ($class_loader->getPrefixesPsr4() as $prefix => $paths) { // Remove trailing path separators. $prefix = trim($prefix, '\\'); // Remove the DRUPAL_ROOT prefix. $path = str_replace(\Drupal::root() . '/', '', reset($paths)); // Only add missing contrib theme namespaces. if (preg_match('/^(core|vendor)/', $path) === 0 && !isset($namespaces[$prefix])) { $ns[$prefix] = $path; } } // Replace the namespaces data. $namespaces->exchangeArray($ns); // Construct the plugin manager now. parent::__construct('Plugin/BootstrapLayouts', $namespaces, $module_handler, $plugin_interface, $plugin_definition_annotation_name); // Set the theme handler and manager. $this->themeHandler = $theme_handler; $this->themeManager = $theme_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('container.namespaces'), $container->get('cache.discovery'), $container->get('module_handler'), $container->get('theme_handler'), $container->get('theme.manager') ); } /** * {@inheritdoc} */ protected function alterDefinitions(&$definitions) { if ($this->alterHook) { $this->moduleHandler->alter($this->alterHook, $definitions); $this->themeManager->alter($this->alterHook, $definitions); } } /** * {@inheritdoc} */ protected function providerExists($provider) { return $this->moduleHandler->moduleExists($provider) || $this->themeHandler->themeExists($provider); } }