MDL-79675 enrol_lti: fix client implementation signatures after upgrade

Not strictly required due to contravariance, but nice for readability.
This commit is contained in:
Jake Dallimore 2024-02-22 16:10:35 +08:00
parent 73ce114066
commit 7c9fb5d89b
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View File

@ -52,10 +52,10 @@ class issuer_database implements IDatabase {
* Find and return an LTI registration based on its unique {issuer, client_id} tuple.
*
* @param string $iss the issuer id.
* @param string $clientId the client_id of the registration.
* @param string|null $clientId the client_id of the registration.
* @return LtiRegistration|null The registration object, or null if not found.
*/
public function findRegistrationByIssuer($iss, $clientId = null): ?LtiRegistration {
public function findRegistrationByIssuer(string $iss, ?string $clientId = null): ?LtiRegistration {
if (is_null($clientId)) {
throw new \coding_exception("The param 'clientid' is required. Calling code must either pass in 'client_id' ".
"(generated by the platform during registration) or 'id' (found in the initiate login URI created by the tool) ".
@ -98,10 +98,10 @@ class issuer_database implements IDatabase {
*
* @param string $iss the issuer id.
* @param string $deploymentId the deployment id.
* @param string $clientId the client_id of the registration.
* @param string|null $clientId the client_id of the registration.
* @return LtiDeployment|null The deployment object or null if not found.
*/
public function findDeployment($iss, $deploymentId, $clientId = null): ?LtiDeployment {
public function findDeployment(string $iss, string $deploymentId, ?string $clientId = null): ?LtiDeployment {
if (is_null($clientId)) {
throw new \coding_exception("Both issuer and client id are required to identify platform registrations ".
"and must be included in the 'aud' claim of the message JWT.");

View File

@ -36,7 +36,7 @@ class launch_cache_session implements ICache {
* @param string $key the launch id.
* @return array|null the launch data.
*/
public function getLaunchData($key): ?array {
public function getLaunchData(string $key): ?array {
global $SESSION;
if (isset($SESSION->enrol_lti_launch[$key])) {
return unserialize($SESSION->enrol_lti_launch[$key]);