@@ -140,13 +140,11 @@ public function complete($callback)
140
140
$ this ->complete_function = $ callback ;
141
141
}
142
142
143
- public function delete ($ url_mixed , $ data = array ())
143
+ public function delete ($ url , $ data = array ())
144
144
{
145
- if (is_array ($ url_mixed )) {
145
+ if (is_array ($ url )) {
146
+ $ data = $ url ;
146
147
$ url = $ this ->base_url ;
147
- $ data = $ url_mixed ;
148
- } else {
149
- $ url = $ url_mixed ;
150
148
}
151
149
$ this ->setURL ($ url , $ data );
152
150
$ this ->unsetHeader ('Content-Length ' );
@@ -244,13 +242,11 @@ public function exec($ch = null)
244
242
return $ this ->response ;
245
243
}
246
244
247
- public function get ($ url_mixed , $ data = array ())
245
+ public function get ($ url , $ data = array ())
248
246
{
249
- if (is_array ($ url_mixed )) {
247
+ if (is_array ($ url )) {
248
+ $ data = $ url ;
250
249
$ url = $ this ->base_url ;
251
- $ data = $ url_mixed ;
252
- } else {
253
- $ url = $ url_mixed ;
254
250
}
255
251
$ this ->setURL ($ url , $ data );
256
252
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'GET ' );
@@ -263,13 +259,11 @@ public function getOpt($option)
263
259
return $ this ->options [$ option ];
264
260
}
265
261
266
- public function head ($ url_mixed , $ data = array ())
262
+ public function head ($ url , $ data = array ())
267
263
{
268
- if (is_array ($ url_mixed )) {
264
+ if (is_array ($ url )) {
265
+ $ data = $ url ;
269
266
$ url = $ this ->base_url ;
270
- $ data = $ url_mixed ;
271
- } else {
272
- $ url = $ url_mixed ;
273
267
}
274
268
$ this ->setURL ($ url , $ data );
275
269
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'HEAD ' );
@@ -283,27 +277,23 @@ public function headerCallback($ch, $header)
283
277
return strlen ($ header );
284
278
}
285
279
286
- public function options ($ url_mixed , $ data = array ())
280
+ public function options ($ url , $ data = array ())
287
281
{
288
- if (is_array ($ url_mixed )) {
282
+ if (is_array ($ url )) {
283
+ $ data = $ url ;
289
284
$ url = $ this ->base_url ;
290
- $ data = $ url_mixed ;
291
- } else {
292
- $ url = $ url_mixed ;
293
285
}
294
286
$ this ->setURL ($ url , $ data );
295
287
$ this ->unsetHeader ('Content-Length ' );
296
288
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'OPTIONS ' );
297
289
return $ this ->exec ();
298
290
}
299
291
300
- public function patch ($ url_mixed , $ data = array ())
292
+ public function patch ($ url , $ data = array ())
301
293
{
302
- if (is_array ($ url_mixed )) {
294
+ if (is_array ($ url )) {
295
+ $ data = $ url ;
303
296
$ url = $ this ->base_url ;
304
- $ data = $ url_mixed ;
305
- } else {
306
- $ url = $ url_mixed ;
307
297
}
308
298
$ this ->setURL ($ url );
309
299
$ this ->unsetHeader ('Content-Length ' );
@@ -312,13 +302,11 @@ public function patch($url_mixed, $data = array())
312
302
return $ this ->exec ();
313
303
}
314
304
315
- public function post ($ url_mixed , $ data = array ())
305
+ public function post ($ url , $ data = array ())
316
306
{
317
- if (is_array ($ url_mixed )) {
307
+ if (is_array ($ url )) {
308
+ $ data = $ url ;
318
309
$ url = $ this ->base_url ;
319
- $ data = $ url_mixed ;
320
- } else {
321
- $ url = $ url_mixed ;
322
310
}
323
311
324
312
if (is_array ($ data ) && empty ($ data )) {
@@ -332,13 +320,11 @@ public function post($url_mixed, $data = array())
332
320
return $ this ->exec ();
333
321
}
334
322
335
- public function put ($ url_mixed , $ data = array ())
323
+ public function put ($ url , $ data = array ())
336
324
{
337
- if (is_array ($ url_mixed )) {
325
+ if (is_array ($ url )) {
326
+ $ data = $ url ;
338
327
$ url = $ this ->base_url ;
339
- $ data = $ url_mixed ;
340
- } else {
341
- $ url = $ url_mixed ;
342
328
}
343
329
$ this ->setURL ($ url );
344
330
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'PUT ' );
0 commit comments