| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function execute(TestInfo $testInfo): void |
||
| 27 | { |
||
| 28 | $clientRegistrationService = new RegistrationService(); |
||
|
|
|||
| 29 | |||
| 30 | $configUri = sprintf('%s/%s/%s/.well-known/openid-configuration', $testInfo->getRoot(), $testInfo->getRpId(), $this->getTestId()); |
||
| 31 | $issuer = (new IssuerBuilder()) |
||
| 32 | ->build($configUri); |
||
| 33 | |||
| 34 | $metadata = $clientRegistrationService->register($issuer, [ |
||
| 35 | 'client_name' => $testInfo->getRpId() . '/' . $this->getTestId(), |
||
| 36 | 'redirect_uris' => [ |
||
| 37 | 'https://example.com/callback', |
||
| 38 | ], |
||
| 39 | 'contacts' => [ |
||
| 40 | '[email protected]', |
||
| 41 | ], |
||
| 42 | ]); |
||
| 43 | |||
| 44 | Assert::assertArrayHasKey('client_id', $metadata); |
||
| 45 | Assert::assertArrayHasKey('client_secret_expires_at', $metadata); |
||
| 46 | } |
||
| 48 |
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.