src/Package.php
public function getPackageType(): string
    {
        //if it starts with / like /foo/bar
        if (strpos($this->name, '/') === 0) {
            //it's a root package
            return self::TYPE_ROOT;
        }

        //if theres a slash like foo/bar
        if (strpos($this->name, '/') !== false) {
            //it's vendor package
            return self::TYPE_VENDOR;
        }

        //by default it's a pseudo package
        return self::TYPE_PSEUDO;
    }
public function getPackageType(): string
    {
        //if it starts with / like /foo/bar
        if (strpos($this->name, '/') === 0) {
            //it's a root package
            return self::TYPE_ROOT;
        }

        //if theres a slash like foo/bar
        if (strpos($this->name, '/') !== false) {
            //it's vendor package
            return self::TYPE_VENDOR;
        }

        //by default it's a pseudo package
        return self::TYPE_PSEUDO;
    }
public function getPackageType ( ) : string { //if it starts with / like /foo/bar if ( strpos ( $ this -> name , '/' ) === 0 ) { //it's a root package return self :: TYPE_ROOT ; } //if theres a slash like foo/bar if ( strpos ( $ this -> name , '/' ) !== false ) { //it's vendor package return self :: TYPE_VENDOR ; } //by default it's a pseudo package return self :: TYPE_PSEUDO ; }
Returns the package type

@return string
Returns the package type