protected function filterPackagesByPath($packages, $filterPath)
    {
        $filteredPackages = [];
        /** @var $package Package */
        foreach ($packages as $package) {
            $packagePath = substr($package->getPackagePath(), strlen($this->packagesBasePath));
            $packageGroup = substr($packagePath, 0, strpos($packagePath, '/'));
            if ($packageGroup === $filterPath) {
                $filteredPackages[$package->getPackageKey()] = $package;
            }
        }

        return $filteredPackages;
    }
protected function filterPackagesByPath($packages, $filterPath)
    {
        $filteredPackages = [];
        /** @var $package Package */
        foreach ($packages as $package) {
            $packagePath = substr($package->getPackagePath(), strlen($this->packagesBasePath));
            $packageGroup = substr($packagePath, 0, strpos($packagePath, '/'));
            if ($packageGroup === $filterPath) {
                $filteredPackages[$package->getPackageKey()] = $package;
            }
        }

        return $filteredPackages;
    }
protected function filterPackagesByPath ( $ packages , $ filterPath ) { $ filteredPackages = [ ] ; /** @var $package Package */ foreach ( $ packages as $ package ) { $ packagePath = substr ( $ package -> getPackagePath ( ) , strlen ( $ this -> packagesBasePath ) ) ; $ packageGroup = substr ( $ packagePath , 0 , strpos ( $ packagePath , '/' ) ) ; if ( $ packageGroup === $ filterPath ) { $ filteredPackages [ $ package -> getPackageKey ( ) ] = $ package ; } } return $ filteredPackages ; }
Returns an array of PackageInterface objects in the given array of packages
that are in the specified Package Path

@param array $packages Array of PackageInterface to be filtered
@param string $filterPath Filter out anything that's not in this path
@return array<PackageInterface>
Returns an array of PackageInterface objects in the given array of packages that are in the specified Package Path