src/ShopifyApp/Services/ShopSession.php
public function getToken(bool $strict = false)
    {
        // Tokens
        $tokens = [
            self::GRANT_PERUSER => Session::get(self::TOKEN),
            self::GRANT_OFFLINE => $this->shop->{self::TOKEN},
        ];

        if ($strict) {
            // We need the token matching the type
            return $tokens[$this->getType()];
        }

        // We need a token either way...
        return $tokens[self::GRANT_PERUSER] ?? $tokens[self::GRANT_OFFLINE];
    }
public function getToken(bool $strict = false)
    {
        // Tokens
        $tokens = [
            self::GRANT_PERUSER => Session::get(self::TOKEN),
            self::GRANT_OFFLINE => $this->shop->{self::TOKEN},
        ];

        if ($strict) {
            // We need the token matching the type
            return $tokens[$this->getType()];
        }

        // We need a token either way...
        return $tokens[self::GRANT_PERUSER] ?? $tokens[self::GRANT_OFFLINE];
    }
public function getToken ( bool $ strict = false ) { // Tokens $ tokens = [ self :: GRANT_PERUSER => Session :: get ( self :: TOKEN ) , self :: GRANT_OFFLINE => $ this -> shop -> { self :: TOKEN } , ] ; if ( $ strict ) { // We need the token matching the type return $ tokens [ $ this -> getType ( ) ] ; } // We need a token either way... return $ tokens [ self :: GRANT_PERUSER ] ?? $ tokens [ self :: GRANT_OFFLINE ] ; }
Gets the access token in use.

@param bool $strict Return the token matching the grant type (default: use either).

@return string
Gets the access token in use .