This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-33
lines changed
Expand file tree Collapse file tree 2 files changed +9
-33
lines changed Original file line number Diff line number Diff line change @@ -186,27 +186,6 @@ protected function parseTokenResponse(ResponseInterface $response):AccessToken{
186186 return $ token ;
187187 }
188188
189- /**
190- * @param string $apiMethod
191- * @param array $params
192- * @param array $body
193- *
194- * @return array
195- */
196- protected function requestParams (string $ apiMethod , array $ params , array $ body ):array {
197-
198- $ params = array_merge ($ params , $ body , [
199- 'method ' => $ apiMethod ,
200- 'format ' => 'json ' ,
201- 'api_key ' => $ this ->options ->key ,
202- 'sk ' => $ this ->storage ->getAccessToken ($ this ->serviceName )->accessToken ,
203- ]);
204-
205- $ params ['api_sig ' ] = $ this ->getSignature ($ params );
206-
207- return $ params ;
208- }
209-
210189 /**
211190 * @inheritDoc
212191 */
@@ -218,7 +197,15 @@ public function request(
218197 array $ headers = null
219198 ):ResponseInterface {
220199 $ method ??= 'GET ' ;
221- $ params = $ this ->requestParams ($ path , $ params ?? [], $ body ?? []);
200+
201+ $ params = array_merge (($ params ?? []), ($ body ?? []), [
202+ 'method ' => $ path ,
203+ 'format ' => 'json ' ,
204+ 'api_key ' => $ this ->options ->key ,
205+ 'sk ' => $ this ->storage ->getAccessToken ($ this ->serviceName )->accessToken ,
206+ ]);
207+
208+ $ params ['api_sig ' ] = $ this ->getSignature ($ params );
222209
223210 if ($ method === 'POST ' ){
224211 $ body = $ params ;
Original file line number Diff line number Diff line change @@ -91,17 +91,6 @@ public function testParseTokenResponseNoToken():void{
9191 ->invokeArgs ($ this ->provider , [$ r ]);
9292 }
9393
94- public function testRequestParams ():void {
95- $ params = $ this
96- ->getMethod ('requestParams ' )
97- ->invokeArgs ($ this ->provider , ['whatever ' , ['foo ' => 'bar ' ], []]);
98-
99- $ this ::assertSame ('310be19b3ff6967ca8425666753019fb ' , $ params ['api_sig ' ]);
100- $ this ::assertSame ($ this ->options ->key , $ params ['api_key ' ]);
101- $ this ::assertSame ('whatever ' , $ params ['method ' ]);
102- $ this ::assertSame ('bar ' , $ params ['foo ' ]);
103- }
104-
10594 public function testGetAccessToken ():void {
10695 $ this ->setProperty ($ this ->provider , 'apiURL ' , '/lastfm/auth ' );
10796
You can’t perform that action at this time.
0 commit comments