public function hasInstalledPackage($packageName)
    {
        foreach ($this->contents['packages'] as $packageDetails) {
            if ($packageName === $packageDetails['name']) {
                return true;
            }
        }
        
        return false;
    }
public function hasInstalledPackage($packageName)
    {
        foreach ($this->contents['packages'] as $packageDetails) {
            if ($packageName === $packageDetails['name']) {
                return true;
            }
        }
        
        return false;
    }
public function hasInstalledPackage ( $ packageName ) { foreach ( $ this -> contents [ 'packages' ] as $ packageDetails ) { if ( $ packageName === $ packageDetails [ 'name' ] ) { return true ; } } return false ; }
Check if a package name has been installed in any version.

@param string $packageName
@return bool
Check if a package name has been installed in any version .