| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function execute(TestInfo $testInfo): void |
||
| 20 | { |
||
| 21 | $client = $this->registerClient($testInfo); |
||
| 22 | |||
| 23 | Assert::assertSame('code', $testInfo->getResponseType()); |
||
| 24 | |||
| 25 | // Get authorization redirect uri |
||
| 26 | $authorizationService = new AuthorizationService(); |
||
|
|
|||
| 27 | $uri = $authorizationService->getAuthorizationUri($client, ['response_type' => $testInfo->getResponseType()]); |
||
| 28 | // Simulate a redirect and create the server request |
||
| 29 | $serverRequest = $this->simulateAuthRedirect($uri); |
||
| 30 | |||
| 31 | $params = $authorizationService->getCallbackParams($serverRequest, $client); |
||
| 32 | |||
| 33 | Assert::assertArrayHasKey('code', $params); |
||
| 34 | } |
||
| 36 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.