src/Reader.php
protected function readVersionFromLocation(string $location, string $package) : ?string
    {
        // Get the installed packages
        $installed = $this->getInstalledPackages($location);
        if(empty($installed)){
            return null;
        }

        // Search for package
        foreach ($installed as $installedPackage){
            $version = $this->readFromSource($installedPackage, $package);
            if(isset($version)){
                return $version;
            }
        }

        // Nothing found in this package
        return null;
    }
protected function readVersionFromLocation(string $location, string $package) : ?string
    {
        // Get the installed packages
        $installed = $this->getInstalledPackages($location);
        if(empty($installed)){
            return null;
        }

        // Search for package
        foreach ($installed as $installedPackage){
            $version = $this->readFromSource($installedPackage, $package);
            if(isset($version)){
                return $version;
            }
        }

        // Nothing found in this package
        return null;
    }
protected function readVersionFromLocation ( string $ location , string $ package ) : ? string { // Get the installed packages $ installed = $ this -> getInstalledPackages ( $ location ) ; if ( empty ( $ installed ) ) { return null ; } // Search for package foreach ( $ installed as $ installedPackage ) { $ version = $ this -> readFromSource ( $ installedPackage , $ package ) ; if ( isset ( $ version ) ) { return $ version ; } } // Nothing found in this package return null ; }
Attempts to read the version from the given location

@param string $location
@param string $package
@return null|string Version or null if no version found for package
Attempts to read the version from the given location