Add composer classmap paths.

@param string $packageName
@param array  $paths

@return \Narrowspark\Automatic\Common\ClassFinder
173038
public function addClassmap(string $packageName, array $paths): self
    {
        $this->paths['classmap'][$packageName] = $paths;

        return $this;
    }
288230
protected function addPackage(ComposerPackage $package)
    {
        $plugin = $this->rep->find($package->getName());

        // create new plugin if not exists
        if (!$plugin) {
            $plugin = new Plugin();
            $plugin->setName($package->getName());
        }

        list($vendor, $package) = explode('/', $plugin->getName());

        try {
            $data = $this->client->getPlugin($vendor, $package);
            $plugin->setTitle($data['title'])->setDescription($data['description']);
            if ($data['logo']) {
                $this->downloader->entity($data['logo'], $plugin, true);
            }
        } catch (\Exception $e) {
            // is not a critical error
        }

        $this->em->persist($plugin);
        $this->em->flush();
    }
639043
public function isThemePackage($packageName)
    {
        $composerPackage = $this->findPackageGlobal($packageName);

        if (is_null($composerPackage) === true) {
            throw new \RuntimeException(sprintf('The theme: "%s" does not exist.', $packageName));
        }

        return $composerPackage->getType() == self::PACKAGE_TYPE_THEME;
    }
1024822
public function addPaths(array $paths, $priority = PriorityQueue::ABOVE_NORMAL)
    {
        foreach ($paths as $path) {
            $this->addPath($path, $priority);
        }

        return $this;
    }
1278735
public static function getPackageName($classname)
    {
        $reflect = new ReflectionClass($classname);

        if (method_exists($reflect, 'getNamespaceName')) {
            $namespace = $reflect->getNamespaceName();

            if ($namespace != '') {
                return $namespace;
            }
        }

        if (preg_match('/@package[\s]+([\.\w]+)/', $reflect->getDocComment(), $matches)) {
            return $matches[1];
        }

        return "default";
    }
1246391
@Pure
	public static Collection<Class<?>> getPackageClasses(String packageName) {
		final Collection<Class<?>> classes = new ArrayList<>();

		final String[] entries = System.getProperty("java.class.path") //$NON-NLS-1$
				.split(Pattern.quote(System.getProperty("path.separator"))); //$NON-NLS-1$
		String lentry;

		for (final String path : entries) {
			lentry = path.toLowerCase();
			if (lentry.endsWith(".jar") || lentry.endsWith(".war")) { //$NON-NLS-1$ //$NON-NLS-2$
				getPackageClassesFromJar(classes, path, packageName);
			} else {
				getPackageClassesFromFileSystem(classes, path, packageName);
			}

		}

		return classes;
	}
444855
protected function createProjectClass($className)
    {
        $arguments = func_get_args();
        array_shift($arguments);

        return $this->_projectLoader->createClass($className, $arguments);
    }
1364925
@PublicAPI(usage = ACCESS)
    public JavaClasses importPaths(String... paths) {
        Set<Path> pathSet = new HashSet<>();
        for (String path : paths) {
            pathSet.add(Paths.get(path));
        }
        return importPaths(pathSet);
    }
1066082
private static function discoverPackages(string $vendorPath, string $manifestPath): void
    {
        $installedPackages = [];
        if (file_exists($path = $vendorPath . '/composer/installed.json')) {
            $installedPackages = json_decode(file_get_contents($path), true);
        }

        $discoverPackages = [];
        foreach ($installedPackages as $package) {
            if (! empty($package['extra']['chiron'])) {
                $packageInfo = $package['extra']['chiron'];
                $discoverPackages[$package['name']] = $packageInfo;
            }
        }

        if (! is_writable(dirname($manifestPath))) {
            throw new \RuntimeException('The directory "' . dirname($manifestPath) . '" must be present and writable.');
        }

        file_put_contents($manifestPath, '<?php return ' . var_export($discoverPackages, true) . ';');
    }
579503
protected function generateDefaultAliases(PackageInterface $package, &$class, &$basePath)
    {
        $autoload = $package->getAutoload();

        if (empty($autoload['psr-4'])) {
            return null;
        }

        $fs = new Filesystem();
        $vendorDir = $fs->normalizePath($this->vendorDir);
        $aliases = array();

        foreach ($autoload['psr-4'] as $namespace => $path) {
            if (is_array($path)) {
                // Yii doesn't support aliases that point to multiple base paths
                continue;
            }

            // Normalize $path to an absolute path
            if (!$fs->isAbsolutePath($path)) {
                $path = $this->vendorDir.'/'.$package->getPrettyName().'/'.$path;
            }

            $path = $fs->normalizePath($path);
            $alias = '@'.str_replace('\\', '/', trim($namespace, '\\'));

            if (strpos($path.'/', $vendorDir.'/') === 0) {
                $aliases[$alias] = '<vendor-dir>'.substr($path, strlen($vendorDir));
            } else {
                $aliases[$alias] = $path;
            }

            // If we're still looking for the primary Plugin class, see if it's in here
            if ($class === null && file_exists($path.'/Plugin.php')) {
                $class = $namespace.'Plugin';
            }

            // If we're still looking for the base path but we know the primary Plugin class,
            // see if the class namespace matches up, and the file is in here.
            // If so, set the base path to whatever directory contains the plugin class.
            if ($basePath === null && $class !== null) {
                $n = strlen($namespace);
                if (strncmp($namespace, $class, $n) === 0) {
                    $testClassPath = $path.'/'.str_replace('\\', '/', substr($class, $n)).'.php';
                    if (file_exists($testClassPath)) {
                        $basePath = dirname($testClassPath);
                        // If the base path starts with the vendor dir path, swap with <vendor-dir>
                        if (strpos($basePath.'/', $vendorDir.'/') === 0) {
                            $basePath = '<vendor-dir>'.substr($basePath, strlen($vendorDir));
                        }
                    }
                }
            }
        }

        return $aliases;
    }
509847
public function getExtensionsByPackage($key, $packageName) {
		if ($this->packages->has($packageName)) {
			$pkg = $this->packages->get($packageName);
			if ($pkg->has($key)) {
				return $pkg->get($key);
			}
		}
		
		return [];
	}
1082947
public function addAll(Paths $paths) {
		foreach ($paths as $p) {
			$path = $this->get($p->getPath());
			foreach ($p->getMethods() as $method) {
				$path->setOperation($method, $p->getOperation($method));
			}
		}
	}
575881
public function getMigrationsDefinitions(array $paths = array())
    {
        // we try to be flexible in file types we support, and the same time avoid loading all files in a directory
        $handledDefinitions = array();
        foreach ($this->loader->listAvailableDefinitions($paths) as $migrationName => $definitionPath) {
            foreach ($this->DefinitionParsers as $definitionParser) {
                if ($definitionParser->supports($migrationName)) {
                    $handledDefinitions[] = $definitionPath;
                }
            }
        }

        // we can not call loadDefinitions with an empty array using the Filesystem loader, or it will start looking in bundles...
        if (empty($handledDefinitions) && !empty($paths)) {
            return new MigrationDefinitionCollection();
        }

        return $this->loader->loadDefinitions($handledDefinitions);
    }
1373045
public function createProject($packageName, $packageVersion, $outputFolder)
    {
        $this->runCommand('create-project --prefer-dist ' . $packageName . ' ' . $outputFolder . ' "' . $packageVersion . '"');

        return $this;
    }
552591
public function add($classes, $prefix = null, $path = false)
    {
        $prefix = $this->fixString(($prefix ? $prefix : static::DEFAULT_PREFIX));

        $this->getComponents()->push(
            (object) [
                static::PREFIX_KEY => $prefix,
                static::CLASS_KEY  => $this->fixClasses($prefix, $classes, $path)
            ]
        );

        return $this;
    }
815004
public function package($name, $path = '/packages/%s.json')
	{
		$url = sprintf($this->getUrl() . $path, $name);
		$this->_response = new Response(['json' => $this->request($url)]);
		return $this;
	}
231273
private function mergeComposerClassMap($vendor)
    {
        if ($composerClassMap = $this->findComposerDirectory($vendor, 'autoload_classmap.php')) {
            $this->log->debug('Located autoload_classmap.php file', ['path' => $composerClassMap]);
            $classMap = require $composerClassMap;
            if ($classMap) {
                $this->app->getLoader()->addClassMap($classMap);
            }
        }
    }