File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,10 @@ public function exec($attempts = 1, $useException = false)
133133 */
134134 public function getInfo ($ opt = 0 )
135135 {
136- return curl_getinfo ($ this ->handle , $ opt );
136+ if (func_num_args () > 0 ) {
137+ return curl_getinfo ($ this ->handle , $ opt );
138+ }
139+ return curl_getinfo ($ this ->handle );
137140 }
138141
139142 /**
Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ function curl_unescape($v, $s)
5353 return 'unescape_ ' .$ v .'_ ' .$ s ;
5454}
5555
56- function curl_getinfo ($ h , $ o )
56+ function curl_getinfo ($ h , $ o = null )
5757{
58- return 'getinfo_ ' .$ h .'_ ' .$ o ;
58+ return 'getinfo_ ' .$ h .'_ ' .func_num_args (). ' _ ' . $ o ;
5959}
6060
6161function curl_pause ($ h , $ m )
@@ -108,8 +108,8 @@ public function testAll()
108108 $ c ->reset ();
109109 $ this ->assertEquals ('reset_foo ' , array_pop (self ::$ log ));
110110
111- $ this ->assertEquals ('getinfo_foo_0 ' , $ c ->getinfo ());
112- $ this ->assertEquals ('getinfo_foo_42 ' , $ c ->getinfo (42 ));
111+ $ this ->assertEquals ('getinfo_foo_1_ ' , $ c ->getinfo ());
112+ $ this ->assertEquals ('getinfo_foo_2_42 ' , $ c ->getinfo (42 ));
113113
114114 $ this ->assertEquals ('pause_foo_42 ' , $ c ->pause (42 ));
115115
You can’t perform that action at this time.
0 commit comments