Skip to content

Commit

Permalink
Make codechecker happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Aug 20, 2024
1 parent 0a4f792 commit 98deb62
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ protected function get_javascript_strings() {
* Can only be added if this is not a section and if the user has the appropriate capability.
*
* @param \stdClass $course
* @param \cm_info $cm (optional)
* @param \section_info $section (optional)
* @param \cm_info|null $cm
* @param \section_info|null $section
* @return bool
*/
protected function allow_add($course, \cm_info $cm = null, \section_info $section = null) {
protected function allow_add($course, ?\cm_info $cm = null, ?\section_info $section = null) {
if ($section !== null) {
// Can only be added to modules, not sections.
return false;
Expand Down
4 changes: 2 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class provider implements \core_privacy\local\metadata\provider,
*
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_database_table(
'availability_password_grant',
[
Expand All @@ -72,7 +72,7 @@ public static function get_metadata(collection $collection) : collection {
*
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist {
public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist {
$contextlist = new \core_privacy\local\request\contextlist();

$sql = "SELECT c.id
Expand Down
6 changes: 3 additions & 3 deletions lang/en/availability_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
$string['permanently'] = 'Permanently';
$string['pluginname'] = 'Restriction by password';
$string['privacy:metadata:availability_password_grant'] = 'Information about all users who have correctly entered the password for a given activity.';
$string['privacy:metadata:availability_password_grant:courseid'] = 'The ID of the course where the password was entered.';
$string['privacy:metadata:availability_password_grant:cmid'] = 'The ID of the course module for which the password was entered.';
$string['privacy:metadata:availability_password_grant:userid'] = 'The ID of the user who has entered the password.';
$string['privacy:metadata:availability_password_grant:courseid'] = 'The ID of the course where the password was entered.';
$string['privacy:metadata:availability_password_grant:password'] = 'The password that was entered.';
$string['privacy:metadata:availability_password_grant:userid'] = 'The ID of the user who has entered the password.';
$string['rememberpassword'] = 'Remember password entered';
$string['requires_password'] = 'You enter the correct password';
$string['requires_nopassword'] = 'You have not entered the correct password';
$string['requires_password'] = 'You enter the correct password';
$string['title'] = 'Password';
$string['untillogout'] = 'Until the user logs out';
$string['wrongpassword'] = 'Password incorrect';
6 changes: 3 additions & 3 deletions tests/privacy/privacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright 2019 Davo Smith, Synergy Learning UK on behalf of Alexander Bias, Ulm University <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends \core_privacy\tests\provider_testcase {
final class privacy_test extends \core_privacy\tests\provider_testcase {
/**
* Set up the unit tests.
*/
Expand Down Expand Up @@ -120,7 +120,7 @@ private function get_users_on_page($page) {
*
* @covers \availability_password\privacy\privacy_test::get_users_on_page()
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
list($pages, ) = $this->setup_data();
list($p1, $p2, $p3, $p4) = $pages;

Expand All @@ -136,7 +136,7 @@ public function test_get_users_in_context() {
*
* @covers ::delete_data_for_users()
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
list($pages, $users) = $this->setup_data();
list($p1, $p2, $p3, $p4) = $pages;
list($u1, $u2, $u3) = $users;
Expand Down

0 comments on commit 98deb62

Please sign in to comment.