From 32c3d0b8f84e69c30ca7129c8bd8bcfaad4225a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Mai=C3=9Fer?= Date: Fri, 6 Dec 2024 15:03:20 +0100 Subject: [PATCH] Linting --- classes/bo_availability/bo_info.php | 1 - classes/bo_availability/conditions/nooverlapping.php | 1 - classes/bo_availability/conditions/nooverlappingproxy.php | 2 -- classes/booking_campaigns/campaigns_info.php | 2 +- tests/bo_availability/condition_all_test.php | 5 +---- tests/bo_availability/condition_allowupdate_test.php | 1 - version.php | 2 +- 7 files changed, 3 insertions(+), 11 deletions(-) diff --git a/classes/bo_availability/bo_info.php b/classes/bo_availability/bo_info.php index cc4953893..ab8b82397 100644 --- a/classes/bo_availability/bo_info.php +++ b/classes/bo_availability/bo_info.php @@ -573,7 +573,6 @@ public static function get_conditions(int $condparam = MOD_BOOKING_CONDPARAM_ALL $instance = new $filename(); } - switch ($condparam) { case MOD_BOOKING_CONDPARAM_HARDCODED_ONLY: if ($instance->is_json_compatible() === false) { diff --git a/classes/bo_availability/conditions/nooverlapping.php b/classes/bo_availability/conditions/nooverlapping.php index 532f1a513..f2e93b1f9 100644 --- a/classes/bo_availability/conditions/nooverlapping.php +++ b/classes/bo_availability/conditions/nooverlapping.php @@ -300,7 +300,6 @@ public function render_button( ): array { $label = $this->get_description_string(false, $full, $settings); - // return bo_info::render_button($settings, $userid, $label, 'alert alert-warning', true, $fullwidth, 'alert', 'option'); for optionhasstarted. $handling = $this->return_handling_from_settings($settings); switch ($handling) { case MOD_BOOKING_COND_OVERLAPPING_HANDLING_BLOCK: diff --git a/classes/bo_availability/conditions/nooverlappingproxy.php b/classes/bo_availability/conditions/nooverlappingproxy.php index 83386779a..16e09d2d1 100644 --- a/classes/bo_availability/conditions/nooverlappingproxy.php +++ b/classes/bo_availability/conditions/nooverlappingproxy.php @@ -143,7 +143,6 @@ public function is_available(booking_option_settings $settings, int $userid, boo // This is the return value. Not available to begin with. $isavailable = false; - if (!empty($this->return_handling_from_settings($settings))) { $isavailable = true; } else { @@ -300,7 +299,6 @@ public function render_button( ): array { $label = $this->get_description_string(false, $full, $settings); - // return bo_info::render_button($settings, $userid, $label, 'alert alert-warning', true, $fullwidth, 'alert', 'option'); for optionhasstarted. $handling = $this->return_handling_from_answers($settings->id); switch ($handling) { case MOD_BOOKING_COND_OVERLAPPING_HANDLING_BLOCK: diff --git a/classes/booking_campaigns/campaigns_info.php b/classes/booking_campaigns/campaigns_info.php index 9044be5ce..b122e343c 100644 --- a/classes/booking_campaigns/campaigns_info.php +++ b/classes/booking_campaigns/campaigns_info.php @@ -232,7 +232,7 @@ private static function get_list_of_saved_campaigns(): array { * Destroys all campaigns in db and singleton. * @return bool */ - public static function delete_all_campaigns(): bool{ + public static function delete_all_campaigns(): bool { global $DB; $DB->delete_records('booking_campaigns'); singleton_service::destroy_all_campaigns(); diff --git a/tests/bo_availability/condition_all_test.php b/tests/bo_availability/condition_all_test.php index fab016226..54ad136bf 100644 --- a/tests/bo_availability/condition_all_test.php +++ b/tests/bo_availability/condition_all_test.php @@ -543,7 +543,6 @@ public function test_booking_bookit_with_pricecategories_and_fallback(array $bda $price = price::get_price('option', $settings->id); $this->assertEquals($pricecategorydata2->defaultvalue, $price["price"]); - // Student one should see the the default price. $this->setUser($student3); singleton_service::destroy_instance(); @@ -596,7 +595,6 @@ public function test_booking_bookit_with_pricecategories_and_fallback(array $bda $price = price::get_price('option', $settings->id); $this->assertEquals($pricecategorydata2->defaultvalue, $price["price"]); - // Student one should see the the default price. $this->setUser($student3); singleton_service::destroy_instance(); @@ -611,7 +609,6 @@ public function test_booking_bookit_with_pricecategories_and_fallback(array $bda // Validation that price == category price. $price = price::get_price('option', $settings->id); - // $this->assertEquals((int)get_config('booking', 'pricecategoryfallback'), $price["price"]); $this->assertEmpty($price); } @@ -1406,7 +1403,7 @@ public function test_booking_bookwithcredits(array $bdata): void { 'datatype' => 'text', 'shortname' => 'credit', 'name' => 'Credit', - 'visible' => PROFILE_VISIBLE_NONE + 'visible' => PROFILE_VISIBLE_NONE, ]); // Create users. diff --git a/tests/bo_availability/condition_allowupdate_test.php b/tests/bo_availability/condition_allowupdate_test.php index e9176e9e1..e002b42a0 100644 --- a/tests/bo_availability/condition_allowupdate_test.php +++ b/tests/bo_availability/condition_allowupdate_test.php @@ -46,7 +46,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ final class condition_allowupdate_test extends advanced_testcase { - /** * Tests set up. */ diff --git a/version.php b/version.php index 107bf3935..2a6a2c979 100755 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024120501; +$plugin->version = 2024120502; $plugin->requires = 2022112800; // Requires this Moodle version. Current: Moodle 4.1. $plugin->release = '8.8.7'; $plugin->maturity = MATURITY_STABLE;