src/Installer/PackagesInstaller.php
private function isPackageRequired(string $packageName): bool
    {
        foreach ($this->composer->getPackage()->getRequires() as $require) {
            if ($require->getTarget() === $packageName) {
                return true;
            }
        }

        return false;
    }
private function isPackageRequired(string $packageName): bool
    {
        foreach ($this->composer->getPackage()->getRequires() as $require) {
            if ($require->getTarget() === $packageName) {
                return true;
            }
        }

        return false;
    }
private function isPackageRequired ( string $ packageName ) : bool { foreach ( $ this -> composer -> getPackage ( ) -> getRequires ( ) as $ require ) { if ( $ require -> getTarget ( ) === $ packageName ) { return true ; } } return false ; }
Whether a package has been required.

@param string $packageName

@return bool
Whether a package has been required .