Skip to content

Commit

Permalink
MDL-79675 enrol_lti: fix client implementation signatures after upgrade
Browse files Browse the repository at this point in the history
Not strictly required due to contravariance, but nice for readability.
  • Loading branch information
snake committed Mar 6, 2024
1 parent 73ce114 commit 7c9fb5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions enrol/lti/classes/local/ltiadvantage/lib/issuer_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function __construct(application_registration_repository $appregrepo,
* 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) ".
Expand Down Expand Up @@ -98,10 +98,10 @@ public function findRegistrationByIssuer($iss, $clientId = null): ?LtiRegistrati
*
* @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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 7c9fb5d

Please sign in to comment.