Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ protected function get_mapping_parameter() {
];
break;


default:
$parameter = [];
break;
Expand Down
5 changes: 1 addition & 4 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
namespace auth_userkey\privacy;

use core_privacy\local\metadata\null_provider;
use core_privacy\local\legacy_polyfill;

/**
* Privacy provider.
Expand All @@ -35,15 +34,13 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements null_provider {
use legacy_polyfill;

/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function _get_reason() {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
4 changes: 3 additions & 1 deletion tests/auth_plugin_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,9 @@ public function test_that_user_gets_redirected_to_external_wantsurl(): void {
$_POST['wantsurl'] = 'http://test.com/course/index.php?id=12&key=134';

$this->expectException(moodle_exception::class);
$this->expectExceptionMessage('Unsupported redirect to http://test.com/course/index.php?id=12&key=134 detected, execution terminated');
$this->expectExceptionMessage(
'Unsupported redirect to http://test.com/course/index.php?id=12&key=134 detected, execution terminated'
);

// Using @ is the only way to test this. Thanks moodle!
@$this->auth->user_login_userkey();
Expand Down
8 changes: 6 additions & 2 deletions tests/core_userkey_manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ public function setUp(): void {
* @return void
* @throws \dml_exception
*/
private function validate_iprestriction(string $allowips = '', string $script = 'auth/userkey', ?string $iprestriction = null,
int $keylifetime = 60): void {
private function validate_iprestriction(
string $allowips = '',
string $script = 'auth/userkey',
?string $iprestriction = null,
int $keylifetime = 60
): void {
global $DB;
$manager = new core_userkey_manager($this->config);
if ($allowips) {
Expand Down
Loading