@@ -138,7 +138,7 @@ public function listActiveRooms($appId, $prefix = null, $offset = null, $limit =
138
138
if (isset ($ limit )) {
139
139
$ query ['limit ' ] = $ limit ;
140
140
}
141
- if ($ query != null ) {
141
+ if (isset ( $ query) && ! empty ( $ query ) ) {
142
142
$ query = '? ' . http_build_query ($ query );
143
143
$ url = sprintf ("%s/%s/rooms%s " , $ this ->baseURL , $ appId , $ query );
144
144
} else {
@@ -170,7 +170,7 @@ public function appToken($appId, $roomName, $userId, $expireAt, $permission)
170
170
171
171
private function get ($ url , $ cType = null )
172
172
{
173
- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "GET " , $ body , $ cType );
173
+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "GET " , null , $ cType );
174
174
$ rtcToken ['Content-Type ' ] = $ cType ;
175
175
$ ret = Client::get ($ url , $ rtcToken );
176
176
if (!$ ret ->ok ()) {
@@ -179,21 +179,21 @@ private function get($url, $cType = null)
179
179
return array ($ ret ->json (), null );
180
180
}
181
181
182
- private function delete ($ url , $ cType = 'application/json ' )
182
+ private function delete ($ url , $ contentType = 'application/json ' )
183
183
{
184
- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "DELETE " , $ body , $ cType );
185
- $ rtcToken ['Content-Type ' ] = $ cType ;
184
+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "DELETE " , null , $ contentType );
185
+ $ rtcToken ['Content-Type ' ] = $ contentType ;
186
186
$ ret = Client::delete ($ url , $ rtcToken );
187
187
if (!$ ret ->ok ()) {
188
188
return array (null , new Error ($ url , $ ret ));
189
189
}
190
190
return array ($ ret ->json (), null );
191
191
}
192
192
193
- private function post ($ url , $ body , $ cType = 'application/json ' )
193
+ private function post ($ url , $ body , $ contentType = 'application/json ' )
194
194
{
195
- $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "POST " , $ body , $ cType );
196
- $ rtcToken ['Content-Type ' ] = $ cType ;
195
+ $ rtcToken = $ this ->auth ->authorizationV2 ($ url , "POST " , $ body , $ contentType );
196
+ $ rtcToken ['Content-Type ' ] = $ contentType ;
197
197
$ ret = Client::post ($ url , $ body , $ rtcToken );
198
198
if (!$ ret ->ok ()) {
199
199
return array (null , new Error ($ url , $ ret ));
0 commit comments