Skip to content

Commit

Permalink
codecleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed Jun 11, 2024
1 parent 96d7bcc commit 52a406c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions classes/output/moodleoverflow_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class moodleoverflow_email implements \renderable, \templatable {
/**
* Whether the user can reply to this post.
*
* @var boolean $canreply
* @var bool $canreply
*/
protected $canreply = false;

/**
* Whether to override forum display when displaying usernames.
* @var boolean $viewfullnames
* @var bool $viewfullnames
*/
protected $viewfullnames = 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
*
* @return collection the updated collection of metadata items.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_database_table('moodleoverflow_discussions',
[
'name' => 'privacy:metadata:moodleoverflow_discussions:name',
Expand Down Expand Up @@ -135,7 +135,7 @@ public static function get_metadata(collection $collection) : collection {
*
* @return contextlist $contextlist The list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
public static function get_contexts_for_userid(int $userid): contextlist {
// Fetch all Moodleoverflow discussions, moodleoverflow posts, ratings, tracking settings and subscriptions.
$sql = "SELECT c.id
FROM {context} c
Expand Down
4 changes: 2 additions & 2 deletions lang/en/moodleoverflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

// Default strings.
$string['modulename'] = 'Moodleoverflow';
$string['modulenameplural'] = 'Moodleoverflows';
$string['modulename_help'] = 'The Moodleoverflow module enables participants to use a question-answer forum structure. The forum display is non-chronological as the ordering depends on collaborative voting instead of on time.';
$string['modulenameplural'] = 'Moodleoverflows';
$string['moodleoverflow'] = 'Moodleoverflow';
$string['moodleoverflowfieldset'] = 'Custom example fieldset';
$string['moodleoverflowname'] = 'Moodleoverflow name';
$string['moodleoverflow'] = 'Moodleoverflow';
$string['pluginadministration'] = 'Moodleoverflow administration';
$string['pluginname'] = 'Moodleoverflow';

Expand Down
6 changes: 3 additions & 3 deletions tests/behat/behat_mod_moodleoverflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ public function should_not_exist_in_the_moodleoverflow_discussion_card($element,
public function i_set_the_moodleoverflow_limitedanswertime_to_now($activity): void {
global $DB;

if (!$activityRecord = $DB->get_record('moodleoverflow', ['name' => $activity])) {
if (!$activityrecord = $DB->get_record('moodleoverflow', ['name' => $activity])) {
throw new Exception("Activity '$activity' not found");
}

// Update the specified field
$activityRecord->limitedanswer = time();
$DB->update_record('moodleoverflow', $activityRecord);
$activityrecord->limitedanswer = time();
$DB->update_record('moodleoverflow', $activityrecord);
}
}
2 changes: 1 addition & 1 deletion tests/dailymail_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2023 Tamaro Walter
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class dailymail_test extends \advanced_testcase {
final class dailymail_test extends \advanced_testcase {

/** @var \stdClass collection of messages */
private $sink;
Expand Down
2 changes: 1 addition & 1 deletion tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @copyright 2017 Kennet Winter <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class locallib_test extends advanced_testcase {
final class locallib_test extends advanced_testcase {

public function setUp(): void {
\mod_moodleoverflow\subscriptions::reset_moodleoverflow_cache();
Expand Down
2 changes: 1 addition & 1 deletion tests/post_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @copyright 2023 Tamaro Walter
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class post_test extends \advanced_testcase {
final class post_test extends \advanced_testcase {

/** @var \stdClass test course */
private $course;
Expand Down
2 changes: 1 addition & 1 deletion tests/privacy_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \provider
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
final class privacy_provider_test extends \core_privacy\tests\provider_testcase {
/**
* @var \mod_moodleoverflow_generator Plugin generator
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/ratings_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @copyright 2023 Tamaro Walter
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class ratings_test extends \advanced_testcase {
final class ratings_test extends \advanced_testcase {
/** @var \stdClass test course */
private $course;

Expand Down
2 changes: 1 addition & 1 deletion tests/readtracking_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \readtracking
*/
class readtracking_test extends advanced_testcase {
final class readtracking_test extends advanced_testcase {

/**
* Test the logic in the moodleoverflow_can_track_moodleoverflows() function.
Expand Down
2 changes: 1 addition & 1 deletion tests/review_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* @group mod_moodleoverflow
*/
class review_test extends \advanced_testcase {
final class review_test extends \advanced_testcase {

/** @var \mod_moodleoverflow_generator $generator */
private $generator;
Expand Down
2 changes: 1 addition & 1 deletion tests/subscriptions_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \subscriptions
*/
class subscriptions_test extends advanced_testcase {
final class subscriptions_test extends advanced_testcase {

/**
* Test setUp.
Expand Down
2 changes: 1 addition & 1 deletion tests/userstats_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @covers \userstats_table
*/
class userstats_test extends \advanced_testcase {
final class userstats_test extends \advanced_testcase {

/** @var \stdClass test course */
private $course;
Expand Down

0 comments on commit 52a406c

Please sign in to comment.