Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Apr 3, 2024
1 parent b929cef commit bb52e37
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ jobs:
strategy:
fail-fast: true
matrix:
moodle-branch: ['MOODLE_402_STABLE', 'main']
php: ['8.1']
database: [mariadb]
include:
- moodle-branch: 'MOODLE_402_STABLE'
php: '8.0'
database: mariadb
- moodle-branch: 'MOODLE_402_STABLE'
php: '8.1'
database: mariadb
- moodle-branch: 'main'
php: '8.1'
database: mariadb
- moodle-branch: 'main'
php: '8.2'
database: mariadb
Expand Down
8 changes: 6 additions & 2 deletions classes/admin_setting_markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@
*/
class admin_setting_markdown extends \admin_setting {
/**
* @var string Filename
* Filename.
*
* @var string
*/
private $filename;

/**
* @var string Plugin path
* Plugin path.
*
* @var string
*/
private $pluginpath;

Expand Down
2 changes: 2 additions & 0 deletions lang/en/filter_synhi.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/

// phpcs:disable moodle.Files.LangFilesOrdering

$string['filtername'] = 'SynHi';
$string['pluginname'] = 'SynHi';

Expand Down
3 changes: 2 additions & 1 deletion tests/PHPUNIT_COMMANDS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ or
Windows\

vendor/bin/phpunit filter/synhi/tests/toolbox_test.php
vendor\bin\phpunit filter/synhi/tests/toolbox_test.phpor
or
vendor\bin\phpunit filter/synhi/tests/toolbox_test.php


vendor/bin/phpunit filter/synhi/tests/privacy_provider_test.php
Expand Down
4 changes: 2 additions & 2 deletions tests/privacy_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @copyright © 2020-onwards G J Barnard.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class privacy_provider_test extends \core_privacy\tests\provider_testcase {
final class privacy_provider_test extends \core_privacy\tests\provider_testcase {
/**
* Set up.
*/
Expand All @@ -46,7 +46,7 @@ protected function set_up() {
/**
* Ensure that get_reason gives a reason.
*/
public function test_get_reason() {
public function test_get_reason(): void {
$this->set_up();
$result = provider::get_reason();
$this->assertSame('privacy:nop', $result);
Expand Down
13 changes: 5 additions & 8 deletions tests/toolbox_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

// @codeCoverageIgnoreStart

/**
* SynHi filter.
*
Expand All @@ -37,7 +35,7 @@
* @copyright &copy; 2020-onwards G J Barnard.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class toolbox_test extends \advanced_testcase {
final class toolbox_test extends \advanced_testcase {
/**
* @var string EnlighterJS JS file.
*/
Expand Down Expand Up @@ -108,7 +106,7 @@ protected function set_up() {
/**
* Test the setting highlight.
*/
public function test_setting_highlight() {
public function test_setting_highlight(): void {
$this->set_up();
set_config('engine', 'enlighterjs', 'filter_synhi');
set_config('enlighterjsstyle', 'default', 'filter_synhi');
Expand All @@ -131,7 +129,7 @@ public function test_setting_highlight() {
/**
* Test the setting highlight.
*/
public function test_setting_highlight_example() {
public function test_setting_highlight_example(): void {
global $CFG;

$this->set_up();
Expand Down Expand Up @@ -181,7 +179,7 @@ public function test_setting_highlight_example() {
/**
* Test the enlighterjs init.
*/
public function test_enlighterjs_init() {
public function test_enlighterjs_init(): void {
$this->set_up();
$thedata = new stdClass();
$thedata->enlighterjsstyle = 'default';
Expand All @@ -202,7 +200,7 @@ public function test_enlighterjs_init() {
/**
* Test the syntaxhighlighter init.
*/
public function test_syntaxhighlighter_init() {
public function test_syntaxhighlighter_init(): void {
$this->set_up();
$thedata = new stdClass();
$thedata->syntaxhighlighterstyle = 'default';
Expand All @@ -220,4 +218,3 @@ public function test_syntaxhighlighter_init() {
$this->assertEquals($thejsurl, $thereturneddata->thejs);
}
}
// @codeCoverageIgnoreEnd

0 comments on commit bb52e37

Please sign in to comment.