Couchbase with PHP 7 , getting error : Call to undefined method Couchbase\Bucket::enableN1ql()

I have installed couchbase with MAMP and php 7.0 and I followed this documentation : https://developer.couchbase.com/documentation/server/current/sdk/php/start-using-sdk.html

everything looks fine :
homebrew/php/php70-couchbase-2.3.2 istalled
libcouchbase-2.7.4 already installed

and the sample couchbase php code works fine , here is my issue

when I use enableN1ql(), like this sample code here : https://developer.couchbase.com/documentation/server/4.1/sdks/php-2.0/n1ql-queries.html

I am getting a PHP error : Call to undefined method Couchbase\Bucket::enableN1ql()

how could I fix it any help?

I think it is just issue of the documentation. enableN1ql() function was temporary solution and it has been deprecated and removed. N1QL ports and availability detected automatically now. Just drop this call and do the query.

I see you , we really dont need it to do a query anymore , right?

You don’t need to call Couchbase\Bucket::enableN1ql() to enable N1QL support, just construct query object and pass it to \Couchbase\Bucket::query() method.

You can read more about it in the API docs
http://docs.couchbase.com/sdk-api/couchbase-php-client-2.3.2/classes/Couchbase.N1qlQuery.html

Also we have something like this for AnalyticsQuery, which is only Developer Preview on the server. Once it will be GA part of the Couchbase Server, you won’t need to specify the location of the server (and the corresponding method will be deprecated/removed)
http://docs.couchbase.com/sdk-api/couchbase-php-client-2.3.2/classes/Couchbase.AnalyticsQuery.html