mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-83412 core: Coding style fixes
This commit is contained in:
parent
68c96a97b9
commit
e7556aa106
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 <andrew@nicols.co.uk>
|
||||
* @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<string, string> 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,
|
||||
|
@ -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' => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user