{@inheritdoc}

@see ProviderInterface::getPackageStats()
344674
public function getPackageStats($packageHandle, $packageVersion, $localeID, $progressLimit = null)
    {
        $allStats = $this->getAvailablePackageStats($packageHandle, $packageVersion, $progressLimit);
        if (isset($allStats[$localeID])) {
            $result = $allStats[$localeID];
        } else {
            if (empty($allStats)) {
                $version = '';
                $total = 0;
            } else {
                $sampleStats = array_pop($allStats);
                $version = $sampleStats->getVersion();
                $total = $sampleStats->getTotal();
            }
            $result = new Stats($version, 0, 0);
        }

        return $result;
    }
603777
public function getPackage($name = null)
    {
        /** @var PackageResolver $resolver */
        $resolver = $this->container->get('package.resolver');

        return $resolver->getPackage($name);
    }
1196140
public function getLocalPackages() {
		$composer = $this->getComposer();
		$dispatcher = new EventDispatcher($composer, $this->io);
		$autoloadGenerator = new \Composer\Autoload\AutoloadGenerator($dispatcher);
		
		if ($this->selfEdit) {
			chdir(__DIR__."/../../..");
			\putenv('COMPOSER=composer-mouf.json');
		} else {
			chdir(__DIR__."/../../../../../..");
		}
		//TODO: this call is strange because it will return the same isntance as above.
		$composer = $this->getComposer();
				
		$localRepos = new CompositeRepository(array($composer->getRepositoryManager()->getLocalRepository()));
		$package = $composer->getPackage();
		$packagesList = $localRepos->getPackages();
		$packagesList[] = $package;
		
		return $packagesList;
	}
123978
protected function getPackages(array $vendors)
    {
        $packagist = new Packagist();

        $client = new Client($packagist);

        $packages = $client->packages($vendors);

        return new PackagesPresenter($packages);
    }
800064
protected function getModules()
    {
    	$file = json_decode( file_get_contents( $this->packagist . 'packages.json' ) )->includes;
    	$file = json_decode( file_get_contents( $this->packagist . key( $file ) ) );
    	return $this->normaliseData( $file->packages );
    }
505823
public function getPackages( $keys = null )
    {
        $packages = array();

        if ( empty( $keys ) )
        {
            foreach ( $this as $subPackages )
            {
                $packages = array_merge(
                    $packages,
                    array_values( $subPackages )
                );
            }
        }
        else if ( is_array( $keys ) )
        {
            foreach ( $keys as $key )
            {
                $key = (string) $key;

                if ( ! empty( $this[$key] ) )
                {
                    $packages = array_merge(
                        $packages,
                        array_values( $this[$key] )
                    );
                }
            }
        }
        else
        {
            $packages = $this[(string) $keys];
        }

        return array_unique( array_map( 'strtolower', $packages ) );
    }
1339044
protected function getWebpackAssets()
    {
        $assets = public_path('builds/manifest.json');
        $assets = file_get_contents($assets);
        $assets = json_decode($assets, true);

        return $assets;
    }
1309909
protected function getPackages()
    {
        if (! is_null($package = $this->input->getArgument('package'))) {
            if (Str::length($package) > 3) {
                $package = Str::snake($package, '-');
            } else {
                $package = Str::lower($package);
            }

            return array($package);
        }

        return $this->findAllAssetPackages();
    }
1113469
public function getAggregatePackageContaining($packageName)
    {
        foreach ($this->packages as $packageNode) {
            if ($packageNode->replaces($packageName)) {
                return $packageNode;
            }
        }

        return null;
    }
43393
public function getAvailablePackageStats(Package $package)
    {
        $result = [];
        $languagesDir = $package->getPackagePath() . '/' . DIRNAME_LANGUAGES;
        if ($this->fs->isDirectory($languagesDir)) {
            foreach ($this->fs->directories($languagesDir) as $localeDirectory) {
                $localeID = basename($localeDirectory);
                if (preg_match('/^[a-z]{2,3}($|_)/', $localeID)) {
                    $mo = $languagesDir . '/' . $localeID . '/LC_MESSAGES/messages.mo';
                    if ($this->fs->isFile($mo)) {
                        $result[$localeID] = $this->getMoFileStats($mo);
                    }
                }
            }
        }

        return $result;
    }
1027979
public static function getReportArray()
    {
        $composerArray = self::getComposerArray();
        $packages = self::getPackagesAndDependencies($composerArray['require']);
        $version = self::getDecomposerVersion($composerArray, $packages);

        $reportArray['Server Environment'] = self::getServerEnv();
        $reportArray['Laravel Environment'] = self::getLaravelEnv($version);
        $reportArray['Installed Packages'] = self::getPackagesArray($composerArray['require']);

        empty(self::getExtraStats()) ? '' : $reportArray['Extra Stats'] = self::getExtraStats();

        return $reportArray;
    }
1198720
public function getAvailablePackages($onlyNotInstalled = true)
    {
        $dh = $this->application->make('helper/file');
        $packages = $dh->getDirectoryContents(DIR_PACKAGES);
        if ($onlyNotInstalled) {
            $handles = $this->getInstalledHandles();
            $packages = array_diff($packages, $handles);
        }

        if (count($packages) > 0) {
            $packagesTemp = [];
            // get package objects from the file system
            foreach ($packages as $p) {
                if (file_exists(DIR_PACKAGES . '/' . $p . '/' . FILENAME_CONTROLLER)) {
                    $pkg = $this->getClass($p);
                    if (!empty($pkg)) {
                        $packagesTemp[] = $pkg;
                    }
                }
            }
            $packages = $packagesTemp;
        }

        return $packages;
    }
681735
public static function getGlobalVariables(AbstractPackage $package = null)
    {
        if (!static::$messages) {
            static::$messages = $package->getContainer()
                ->get('session')
                ->getFlashBag()
                ->takeAll();
        }

        $container = $package->getContainer();

        return [
            'uri' => $container->get('uri'),
            'app' => $container->get('application'),
            'package' => $package,
            'router' => $package->router,
            'asset' => $container->get('asset'),
            'messages' => static::$messages,
            'translator' => $container->get('language'),
            'datetime' => new \DateTime(
                'now',
                new \DateTimeZone($container->get('config')->get('system.timezone', 'UTC'))
            ),
        ];
    }
479731
protected function getPackages()
    {
        $translator = $this->container->get('translator');
        $errorMessage = $translator->trans('settings.version.error_parsing_composer');

        $composerPath = $this->getLockPath();
        if (!file_exists($composerPath)) {
            throw new ParseException(
                $translator->trans('settings.version.composer_lock_not_found')
            );
        }

        $json = file_get_contents($composerPath);
        $result = json_decode($json, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new ParseException($errorMessage.' (#'.json_last_error().')');
        }

        if (array_key_exists('packages', $result) && is_array($result['packages'])) {
            return $result['packages'];
        }

        // No package list in JSON structure
        throw new ParseException($errorMessage);
    }
875918
protected function getActiveSitePackageKeys()
    {
        $sitePackages = $this->packageManager->getFilteredPackages('available', null, 'neos-site');
        $result = [];
        foreach ($sitePackages as $sitePackage) {
            $packageKey = $sitePackage->getPackageKey();
            $result[] = $packageKey;
        }
        return $result;
    }
467942
public function getPackages()
    {
        $filename = $this->vendorPath . '/composer/installed.json';
        if (!file_exists($filename)) {
            throw new Exception($filename . ' not exists!');
        }
        $packages = [];
        foreach (json_decode(file_get_contents($filename), true) as $package) {
            if ($package['type'] === 'teamelf-extension') {
                $packages[] = $package;
            }
        }
        return $packages;
    }
1172349
protected function getCurrentPackageStates()
    {
        $savePackageStates = false;
        $loadedPackageStates = $this->loadPackageStates();
        if (
            empty($loadedPackageStates)
            || !isset($loadedPackageStates['version'])
            || $loadedPackageStates['version'] < self::PACKAGESTATE_FORMAT_VERSION
        ) {
            $loadedPackageStates = $this->scanAvailablePackages();
            $savePackageStates = true;
        }

        if ($savePackageStates) {
            $loadedPackageStates = $this->sortAndSavePackageStates($loadedPackageStates);
        }

        return $loadedPackageStates;
    }