From 2cc40431cbe70854ad0440fb7993024677859eaf Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 28 Nov 2024 11:54:31 +0800 Subject: [PATCH] MDL-83412 core: Coding style fixes --- calendar/type/gregorian/classes/structure.php | 2 +- calendar/type/gregorian/tests/structure_test.php | 2 +- lib/tests/classes/mocking_string_manager.php | 13 ++++++++++--- lib/tests/date_test.php | 5 +++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/calendar/type/gregorian/classes/structure.php b/calendar/type/gregorian/classes/structure.php index 093a7b142e6..7680a874afd 100644 --- a/calendar/type/gregorian/classes/structure.php +++ b/calendar/type/gregorian/classes/structure.php @@ -304,7 +304,7 @@ class structure extends type_base { // The documentation for strftime notes that for the "%l" and "%e" specifiers where // no leading zero is used, a space is used instead. // As a result we switch to the new format specifiers "%l" and "%e", wrap them in placeholders - // and then remove the spaces + // and then remove the spaces. if (empty($CFG->nofixday) && $fixday) { // Config.php can force %d not to be fixed, but only if the format did not specify it. diff --git a/calendar/type/gregorian/tests/structure_test.php b/calendar/type/gregorian/tests/structure_test.php index 94a6ef14b5e..dc917ad8a1e 100644 --- a/calendar/type/gregorian/tests/structure_test.php +++ b/calendar/type/gregorian/tests/structure_test.php @@ -36,7 +36,7 @@ final class structure_test extends \advanced_testcase { * Test the timestamp_to_date_string method with different input values. * * @dataProvider timestamp_to_date_string_provider - * @param string $lang + * @param string $locale * @param int $timestamp * @param string $format * @param string $timezone diff --git a/lib/tests/classes/mocking_string_manager.php b/lib/tests/classes/mocking_string_manager.php index d932a701bf1..750cd65a3bd 100644 --- a/lib/tests/classes/mocking_string_manager.php +++ b/lib/tests/classes/mocking_string_manager.php @@ -17,14 +17,13 @@ namespace core\tests; /** - * A string manager which supports mocking individaul strings. + * A string manager which supports mocking individual strings. * * @package core * @copyright Andrew Lyons * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - - class mocking_string_manager extends \core_string_manager_standard { +class mocking_string_manager extends \core_string_manager_standard { /** @var array The list of strings */ private $strings = []; @@ -37,6 +36,14 @@ namespace core\tests; return parent::get_string($identifier, $component, $a, $lang); } + /** + * Mock a string. + * + * @param string $identifier + * @param string $component + * @param string $value + * @return void + */ public function mock_string( string $identifier, string $component, diff --git a/lib/tests/date_test.php b/lib/tests/date_test.php index b46aebab8df..fad7dc4bf69 100644 --- a/lib/tests/date_test.php +++ b/lib/tests/date_test.php @@ -697,6 +697,11 @@ class date_test extends advanced_testcase { $this->assertEqualsIgnoringWhitespace($expected, core_date::strftime($format, $input)); } + /** + * Data provider for ::test_strftime_locale. + * + * @return array[] + */ public static function get_strftime_locale_provider(): array { return [ 'Month Year only' => [