Skip to content

Commit

Permalink
Fix Moodle Code Checker errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
iarenaza committed Jan 31, 2024
1 parent c94f6f5 commit 827db86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function filter_stage_string(string $text, array $options): string {
* @param array $options The filter options.
* @return string The filtered text for this multilang block.
*/
public function filter($text, array $options = array()) {
public function filter($text, array $options = []) {

if (!is_string($text) || empty($text)) {
// Non-string data can not be filtered anyway.
Expand All @@ -146,7 +146,7 @@ public function filter($text, array $options = array()) {
}

if (!isset(self::$parentcache)) {
self::$parentcache['other'] = array();
self::$parentcache['other'] = [];
}

$this->replacementdone = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/actual_test_cases.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function multilang2_actual_test_cases(): array {
'{mlang other}Hello!{mlang}{mlang es,es_mx}¡Hola!{mlang}
This text is common for all languages because it is outside of all lang blocks.
{mlang other}Bye!{mlang}{mlang it}Ciao!{mlang}',
'es_mx', ['es_mx' => 'es']
'es_mx', ['es_mx' => 'es'],
],
[
'
Expand Down
4 changes: 2 additions & 2 deletions tests/filter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function setup_parent_language(string $child, string $parent): void {
/**
* Data provider for multi-language filtering tests.
*/
public function multilang2_test_cases(): array {
public static function multilang2_test_cases(): array {
require_once(dirname(__FILE__) . '/actual_test_cases.php');
return multilang2_actual_test_cases();
}
Expand All @@ -98,7 +98,7 @@ public function test_filtering($expectedoutput, $input, $targetlang, $parentlang
$this->setup_parent_language($child, $parent);
}

$filtered = format_text($input, FORMAT_HTML, array('context' => \context_system::instance()));
$filtered = format_text($input, FORMAT_HTML, ['context' => \context_system::instance()]);
$this->assertEquals($expectedoutput, $filtered);
}

Expand Down

0 comments on commit 827db86

Please sign in to comment.