src/VK/OAuth/VKOAuth.php
public function getAuthorizeUrl(string $response_type, int $client_id, string $redirect_uri, string $display,
                                    ?array $scope = null, ?string $state = null, ?array $group_ids = null, bool $revoke = false): string {
        $scope_mask = 0;
        foreach ($scope as $scope_setting) {
            $scope_mask |= $scope_setting;
        }

        $params = array(
            static::PARAM_CLIENT_ID     => $client_id,
            static::PARAM_REDIRECT_URI  => $redirect_uri,
            static::PARAM_DISPLAY       => $display,
            static::PARAM_SCOPE         => $scope_mask,
            static::PARAM_STATE         => $state,
            static::PARAM_RESPONSE_TYPE => $response_type,
            static::PARAM_VERSION       => $this->version,
        );

        if ($group_ids) {
            $params[static::PARAM_GROUP_IDS] = implode(',', $group_ids);
        }

        if ($revoke) {
            $params[static::PARAM_REVOKE] = 1;
        }

        return $this->host . static::ENDPOINT_AUTHORIZE . '?' . http_build_query($params);
    }
public function getAuthorizeUrl(string $response_type, int $client_id, string $redirect_uri, string $display,
                                    ?array $scope = null, ?string $state = null, ?array $group_ids = null, bool $revoke = false): string {
        $scope_mask = 0;
        foreach ($scope as $scope_setting) {
            $scope_mask |= $scope_setting;
        }

        $params = array(
            static::PARAM_CLIENT_ID     => $client_id,
            static::PARAM_REDIRECT_URI  => $redirect_uri,
            static::PARAM_DISPLAY       => $display,
            static::PARAM_SCOPE         => $scope_mask,
            static::PARAM_STATE         => $state,
            static::PARAM_RESPONSE_TYPE => $response_type,
            static::PARAM_VERSION       => $this->version,
        );

        if ($group_ids) {
            $params[static::PARAM_GROUP_IDS] = implode(',', $group_ids);
        }

        if ($revoke) {
            $params[static::PARAM_REVOKE] = 1;
        }

        return $this->host . static::ENDPOINT_AUTHORIZE . '?' . http_build_query($params);
    }
public function getAuthorizeUrl ( string $ response_type , int $ client_id , string $ redirect_uri , string $ display , ? array $ scope = null , ? string $ state = null , ? array $ group_ids = null , bool $ revoke = false ) : string { $ scope_mask = 0 ; foreach ( $ scope as $ scope_setting ) { $ scope_mask |= $ scope_setting ; } $ params = array ( static :: PARAM_CLIENT_ID => $ client_id , static :: PARAM_REDIRECT_URI => $ redirect_uri , static :: PARAM_DISPLAY => $ display , static :: PARAM_SCOPE => $ scope_mask , static :: PARAM_STATE => $ state , static :: PARAM_RESPONSE_TYPE => $ response_type , static :: PARAM_VERSION => $ this -> version , ) ; if ( $ group_ids ) { $ params [ static :: PARAM_GROUP_IDS ] = implode ( ',' , $ group_ids ) ; } if ( $ revoke ) { $ params [ static :: PARAM_REVOKE ] = 1 ; } return $ this -> host . static :: ENDPOINT_AUTHORIZE . '?' . http_build_query ( $ params ) ; }
Get authorize url

@param string $response_type
@param int $client_id
@param string $redirect_uri
@param string $display
@param int[] $scope
@param string $state
@param int[] $group_ids
@param bool $revoke
@return string
@see VKOAuthResponseType
@see VKOAuthDisplay
@see VKOAuthGroupScope
@see VKOAuthUserScope
Get authorize url