protected function filterPackagesByType($packages, $packageType)
    {
        $filteredPackages = [];
        /** @var $package Package */
        foreach ($packages as $package) {
            if ($package->getComposerManifest('type') === $packageType) {
                $filteredPackages[$package->getPackageKey()] = $package;
            }
        }

        return $filteredPackages;
    }
protected function filterPackagesByType($packages, $packageType)
    {
        $filteredPackages = [];
        /** @var $package Package */
        foreach ($packages as $package) {
            if ($package->getComposerManifest('type') === $packageType) {
                $filteredPackages[$package->getPackageKey()] = $package;
            }
        }

        return $filteredPackages;
    }
protected function filterPackagesByType ( $ packages , $ packageType ) { $ filteredPackages = [ ] ; /** @var $package Package */ foreach ( $ packages as $ package ) { if ( $ package -> getComposerManifest ( 'type' ) === $ packageType ) { $ filteredPackages [ $ package -> getPackageKey ( ) ] = $ package ; } } return $ filteredPackages ; }
Returns an array of PackageInterface objects in the given array of packages
that are of the specified package type.

@param array $packages Array of PackageInterface objects to be filtered
@param string $packageType Filter out anything that's not of this packageType
@return array<PackageInterface>
Returns an array of PackageInterface objects in the given array of packages that are of the specified package type .