src/Builder/WebBuilder.php
private function getHighestVersion(array $packages): ?PackageInterface
    {
        /** @var $highestVersion PackageInterface|null */
        $highestVersion = null;
        foreach ($packages as $package) {
            if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) {
                $highestVersion = $package;
            }
        }

        return $highestVersion;
    }
private function getHighestVersion(array $packages): ?PackageInterface
    {
        /** @var $highestVersion PackageInterface|null */
        $highestVersion = null;
        foreach ($packages as $package) {
            if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) {
                $highestVersion = $package;
            }
        }

        return $highestVersion;
    }
private function getHighestVersion ( array $ packages ) : ? PackageInterface { /** @var $highestVersion PackageInterface|null */ $ highestVersion = null ; foreach ( $ packages as $ package ) { if ( null === $ highestVersion || version_compare ( $ package -> getVersion ( ) , $ highestVersion -> getVersion ( ) , '>=' ) ) { $ highestVersion = $ package ; } } return $ highestVersion ; }
Gets the highest version of packages.

@param PackageInterface[] $packages List of packages to dump

@return PackageInterface The package with the highest version
Gets the highest version of packages .