@@ -168,25 +168,25 @@ public function getDocById($id) : Document
168168 public function getView ($ options = []) : array
169169 {
170170 // check we have ddoc and view name
171- if (!isset ($ options ['ddoc ' ])) {
171+ if (!isset ($ options ['ddoc ' ])) {
172172 throw new Exception \ServerException (
173173 'ddoc is a required parameter for getView '
174174 );
175175 }
176- if (!isset ($ options ['view ' ])) {
176+ if (!isset ($ options ['view ' ])) {
177177 throw new Exception \ServerException (
178178 'view is a required parameter for getView '
179179 );
180180 }
181181
182- $ endpoint = "/ " . $ this ->db_name . "/_design/ " . $ options ['ddoc ' ]
182+ $ endpoint = "/ " . $ this ->db_name . "/_design/ " . $ options ['ddoc ' ]
183183 . "/_view/ " . $ options ['view ' ];
184184
185185 // grab extra params
186186 $ query = [];
187- foreach ($ options as $ key => $ value ) {
187+ foreach ($ options as $ key => $ value ) {
188188 // skip the values we need for the URL, pass the rest through
189- if (!in_array ($ key , ["ddoc " , "view " ])) {
189+ if (!in_array ($ key , ["ddoc " , "view " ])) {
190190 $ query [$ key ] = $ value ;
191191 }
192192 }
@@ -205,7 +205,8 @@ public function getView($options = []) : array
205205 return $ data ;
206206 }
207207
208- protected function handleServerResponse ($ response ) : array {
208+ protected function handleServerResponse ($ response ) : arrayxi
209+ {
209210 if ($ response ->getStatusCode () == 200 ) {
210211 // try to decode JSON
211212 if ($ json_data = json_decode ($ response ->getBody (), true )) {
@@ -225,5 +226,4 @@ protected function handleServerResponse($response) : array {
225226 }
226227 }
227228 }
228-
229229}
0 commit comments