import custom files keep to psr-4

@param $loader
178616
public function import(array $loader)
    {
        $this->loader = $loader;
        foreach ($loader as $alias => $namespace) {
            $alias = $this->alias($alias);
            $this->container->set($alias, function ($c) use ($alias, $namespace) {
                if (is_callable([$namespace, 'make'])) {
                    call_user_func_array($namespace . '::make', [$alias, $c]);
                }

                return new $namespace();
            });
        }
    }
1327748
public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $config = '';
        if ($this->configMerge) {
            $config = $config ? Yaml::parse($config) : array();
            foreach ($this->configMerge as $configToMerge) {
                $config = array_replace($config, Yaml::parse($configToMerge));
            }
            $config = Yaml::dump($config);
        }

        file_put_contents($this->getCacheDir() .'/config.yml', $config);

        $loader->load($this->getCacheDir() .'/config.yml');
    }
17070
public function setLoader($loader)
    {
        if (!is_array($loader) && !($loader instanceof LoaderInterface)) {
            throw new InvalidParamException('Argument should be an array or implement LoaderInterface');
        }

        $this->loader = $loader;
    }
740515
public function setPluginLoader($type, $loader)
    {
        $type       = $this->_validateLoaderType($type);

        if (is_string($loader)) {
            if (!class_exists($loader)) {

                Zend_Loader::loadClass($loader);
            }
            $loader = new $loader();
        } elseif (!is_object($loader)) {

            throw new Zend_Http_UserAgent_Exception(sprintf(
                'Expected a plugin loader class or object; received %s',
                gettype($loader)
            ));
        }
        if (!$loader instanceof Zend_Loader_PluginLoader) {

            throw new Zend_Http_UserAgent_Exception(sprintf(
                'Expected an object extending Zend_Loader_PluginLoader; received %s',
                get_class($loader)
            ));
        }

        $basePrefix = 'Zend_Http_UserAgent_';
        $basePath   = 'Zend/Http/UserAgent/';
        switch ($type) {
            case 'storage':
                $prefix = $basePrefix . 'Storage';
                $path   = $basePath   . 'Storage';
                break;
            case 'device':
                $prefix = $basePrefix;
                $path   = $basePath;
                break;
        }
        $loader->addPrefixPath($prefix, $path);
        $this->_loaders[$type] = $loader;
        return $this;
    }
966723
private function handleApiLoading(ContainerBuilder $container, FileLoader $loader)
    {
        // Loading configuration from Core/settings
        $coreLoader = new Loader\YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../../../Publish/Core/settings')
        );
        $coreLoader->load('repository.yml');
        $coreLoader->load('repository/inner.yml');
        $coreLoader->load('repository/signalslot.yml');
        $coreLoader->load('repository/siteaccessaware.yml');
        $coreLoader->load('fieldtype_external_storages.yml');
        $coreLoader->load('fieldtypes.yml');
        $coreLoader->load('indexable_fieldtypes.yml');
        $coreLoader->load('roles.yml');
        $coreLoader->load('storage_engines/common.yml');
        $coreLoader->load('storage_engines/cache.yml');
        $coreLoader->load('storage_engines/legacy.yml');
        $coreLoader->load('storage_engines/shortcuts.yml');
        $coreLoader->load('search_engines/common.yml');
        $coreLoader->load('utils.yml');
        $coreLoader->load('io.yml');
        $coreLoader->load('policies.yml');
        $coreLoader->load('notification.yml');
        $coreLoader->load('user_preference.yml');

        // Load Core RichText settings
        if (!$this->isRichTextBundleEnabled($container)) {
            $coreLoader->load('richtext.yml');
        }

        // Public API services
        $loader->load('papi.yml');

        // Built-in field types
        $loader->load('fieldtype_services.yml');

        // Storage engine
        $loader->load('storage_engines.yml');

        // Load CoreBundle RichText settings
        if (!$this->isRichTextBundleEnabled($container)) {
            $loader->load('richtext.yml');
        }
    }
250659
protected function loadFixtures(
        LoaderInterface $loader,
        EntityManagerInterface $manager,
        array $files,
        array $parameters,
        ?PurgeMode $purgeMode
    ) {
        $persister = $this->createPersister($manager);

        $loader = $loader->withPersister($persister);

        return $loader->load($files, $parameters, [], $purgeMode);
    }
782934
public function setLoader($alias, FormulaLoaderInterface $loader)
    {
        $this->loaders[$alias] = $loader;
        $this->loaded = false;
    }
1372192
private function loadImports(array $resources)
    {
        foreach ($resources as $resource) {
            if (!is_string($resource)) {
                continue;
            }

            $this->import($resource);
        }
    }
835182
public function guessFromAssetsLoader(AssetsLoader $loader)
    {
        $this->setAssetsLoader($loader);
        $this
            ->setLayoutsDir($this->assets_loader->getAssetsRealPath())
            ->setToTemplate('setWebRootPath', $this->assets_loader->getAssetsWebPath())
            ->setToView('addDefaultViewParam', 'assets', $this->assets_loader->getAssetsWebPath())
            ->setToTemplate('setWebRootPath', $this->assets_loader->getDocumentRoot())
            ;
        return $this;
    }
116605
protected function setupWpcliDriver(FileLoader $loader, ContainerBuilder $container, array $config)
    {
        if (! isset($config['wpcli'])) {
            return;
        }

        $loader->load('drivers/wpcli.yml');

        $config['wpcli']['alias'] = isset($config['wpcli']['alias']) ? $config['wpcli']['alias'] : '';
        $container->setParameter('wordpress.driver.wpcli.alias', $config['wpcli']['alias']);

        $config['wpcli']['path'] = isset($config['path']) ? $config['path'] : '';
        $container->setParameter('wordpress.driver.wpcli.path', $config['path']);

        $config['wpcli']['binary'] = isset($config['wpcli']['binary']) ? $config['wpcli']['binary'] : null;
        $container->setParameter('wordpress.driver.wpcli.binary', $config['wpcli']['binary']);
    }
302455
public static function addPsr4($paths)
    {
        $loader = new ClassLoader();

        foreach ($paths as $namespace => $path) {
            $loader->addPsr4($namespace, $path);
        }

        $loader->register();
    }
47966
protected function addLoaderPaths(\Twig_Loader_Filesystem $loader, $paths)
    {
        foreach ((array)$paths as $namespace => $path) {
            if (is_int($namespace)) {
                $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE;
            }

            $loader->addPath($path, $namespace);
        }
    }
691257
protected function importTranslationFiles($finder)
    {
        if (!$finder instanceof Finder) {
            $this->output->writeln('No file to import');

            return;
        }

        $importer = $this->getContainer()->get('lexik_translation.importer.file');
        $importer->setCaseInsensitiveInsert($this->input->getOption('case-insensitive'));

        foreach ($finder as $file) {
            $this->output->write(sprintf('Importing <comment>"%s"</comment> ... ', $file->getPathname()));
            $number = $importer->import($file, $this->input->getOption('force'), $this->input->getOption('merge'));
            $this->output->writeln(sprintf('%d translations', $number));

            $skipped = $importer->getSkippedKeys();
            if (count($skipped) > 0) {
                $this->output->writeln(sprintf('    <error>[!]</error> The following keys has been skipped: "%s".', implode('", "', $skipped)));
            }
        }
    }
509213
public function importer($importer)
    {
        if ($importer instanceof ImporterContract) {
            $this->importer = $importer;
        } else {
            $this->importer = $this->getImporter($importer);
        }

        return $this;
    }
1283401
protected function addAutoloader() {
        $autoloaderFile = VENDOR_PATH.'composer/autoload_psr4.php';
        $content = file_get_contents($autoloaderFile);
        
        $lineToAdd = PHP_EOL.'    \''.$this->authorNamespace.'\\\\'.$this->id.'\\\\\' => array($baseDir . \'/'.$this->id.'\'),';
        $content = str_replace('return array(', 'return array('.$lineToAdd, $content);
        
        $content = file_put_contents($autoloaderFile, $content);
    }
1036584
protected function loadImports(YamlLoader $loader, $file, array $configValues = array())
    {
        if (!isset($configValues['imports'])) {
            return $configValues;
        }

        if (!is_array($configValues['imports'])) {
            $configValues['imports'] = array($configValues['imports']);
        }

        foreach ($configValues['imports'] as $import) {
            $loader->setCurrentDir(dirname($file));
            $importValues = $loader->import($import, null, false, $file);

            $configValues = array_replace_recursive($configValues, $importValues);
        }

        return $configValues;
    }
778297
protected function addAliases($loader, $aliases)
    {
        foreach ($aliases as $alias => $path) {
            if (is_array($path)) {
                $this->addAliases($loader, $path);
            } elseif (is_string($path) && is_dir($path)) {
                $loader->addPath($path, substr($alias, 1));
            }
        }
    }