diff --git a/enrol/lti/classes/local/ltiadvantage/lib/issuer_database.php b/enrol/lti/classes/local/ltiadvantage/lib/issuer_database.php index 4841ba3d6e0..8b825912f28 100644 --- a/enrol/lti/classes/local/ltiadvantage/lib/issuer_database.php +++ b/enrol/lti/classes/local/ltiadvantage/lib/issuer_database.php @@ -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."); diff --git a/enrol/lti/classes/local/ltiadvantage/lib/launch_cache_session.php b/enrol/lti/classes/local/ltiadvantage/lib/launch_cache_session.php index 38df8d9085f..4aab362bc77 100644 --- a/enrol/lti/classes/local/ltiadvantage/lib/launch_cache_session.php +++ b/enrol/lti/classes/local/ltiadvantage/lib/launch_cache_session.php @@ -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]);