From 62296f88d6e6910d7b3958b73a5b3c0be5dc7203 Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Thu, 13 Jun 2024 10:43:12 +0200 Subject: [PATCH] Cleanup: Change @codingStandardsIgnore tags to phpcs:disable, resolves #676. (#677) --- CHANGES.md | 1 + config.php | 2 +- flavours/styles.php | 6 ++---- h5p/styles.php | 6 ++---- locallogin.php | 4 +--- mobile/styles.php | 6 ++---- pages/aboutus.php | 4 +--- pages/contact.php | 4 +--- pages/help.php | 4 +--- pages/imprint.php | 4 +--- pages/maintenance.php | 4 +--- pages/offers.php | 4 +--- pages/page1.php | 4 +--- pages/page2.php | 4 +--- pages/page3.php | 4 +--- settings.php | 3 +-- 16 files changed, 19 insertions(+), 45 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bae39a23673..6efff2db200 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-06-13 - Cleanup: Change @codingStandardsIgnore tags to phpcs:disable, resolves #676. * 2024-06-12 - Cleanup: Fix CSS warnings in external SCSS tests, resolves #674. ### v4.3-r14 diff --git a/config.php b/config.php index 304cbd96293..a6503eadb11 100644 --- a/config.php +++ b/config.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die(); -// @codingStandardsIgnoreFile // Let codechecker ignore this file. We prefer being able to diff this file easily than to make codechecker happy. +// phpcs:disable NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine // Require own locallib.php. require_once($CFG->dirroot . '/theme/boost_union/locallib.php'); diff --git a/flavours/styles.php b/flavours/styles.php index ec649c02407..5d67c4b6341 100644 --- a/flavours/styles.php +++ b/flavours/styles.php @@ -30,11 +30,9 @@ define('NO_UPGRADE_CHECK', true); // Require config. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check -// after requiring config.php which is really not needed.require('../config.php'); -require(__DIR__.'/../../../config.php'); -// @codingStandardsIgnoreEnd +// after requiring config.php which is really not needed. +require(__DIR__.'/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require css sending libraries. require_once($CFG->dirroot.'/lib/csslib.php'); diff --git a/h5p/styles.php b/h5p/styles.php index 1daf4c2f694..002a97cb6a1 100644 --- a/h5p/styles.php +++ b/h5p/styles.php @@ -30,11 +30,9 @@ define('NO_UPGRADE_CHECK', true); // Require config. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check -// after requiring config.php which is really not needed.require('../config.php'); -require(__DIR__.'/../../../config.php'); -// @codingStandardsIgnoreEnd +// after requiring config.php which is really not needed. +require(__DIR__.'/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require css sending libraries. require_once($CFG->dirroot.'/lib/csslib.php'); diff --git a/locallogin.php b/locallogin.php index 9bff5a22e8f..c9992b5c4fc 100644 --- a/locallogin.php +++ b/locallogin.php @@ -26,11 +26,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__.'/../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__.'/../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/lib/authlib.php'); diff --git a/mobile/styles.php b/mobile/styles.php index 258df32f6e7..2b82ba620a4 100644 --- a/mobile/styles.php +++ b/mobile/styles.php @@ -30,11 +30,9 @@ define('NO_UPGRADE_CHECK', true); // Require config. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check -// after requiring config.php which is really not needed.require('../config.php'); -require(__DIR__.'/../../../config.php'); -// @codingStandardsIgnoreEnd +// after requiring config.php which is really not needed. +require(__DIR__.'/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require css sending libraries. require_once($CFG->dirroot.'/lib/csslib.php'); diff --git a/pages/aboutus.php b/pages/aboutus.php index 9a36b5e1211..afb71b7d586 100644 --- a/pages/aboutus.php +++ b/pages/aboutus.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/contact.php b/pages/contact.php index cedc42c4d11..2193330dc37 100644 --- a/pages/contact.php +++ b/pages/contact.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/help.php b/pages/help.php index cd4e4e94ed3..301cef9bd06 100644 --- a/pages/help.php +++ b/pages/help.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/imprint.php b/pages/imprint.php index 37a5a1d0ad1..d6a11d29560 100644 --- a/pages/imprint.php +++ b/pages/imprint.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/maintenance.php b/pages/maintenance.php index ab9e0497462..022707fb579 100644 --- a/pages/maintenance.php +++ b/pages/maintenance.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/offers.php b/pages/offers.php index 55743448d40..dcbffb11cd3 100644 --- a/pages/offers.php +++ b/pages/offers.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/page1.php b/pages/page1.php index acda2a3821c..ba5fbeb473e 100644 --- a/pages/page1.php +++ b/pages/page1.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/page2.php b/pages/page2.php index fa2c468ab69..f0ce9ee0513 100644 --- a/pages/page2.php +++ b/pages/page2.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/pages/page3.php b/pages/page3.php index 480b2523ba8..352c2cad442 100644 --- a/pages/page3.php +++ b/pages/page3.php @@ -23,11 +23,9 @@ */ // Include config.php. -// @codingStandardsIgnoreStart // Let codechecker ignore the next line because otherwise it would complain about a missing login check // after requiring config.php which is really not needed. -require(__DIR__ . '/../../../config.php'); -// @codingStandardsIgnoreEnd +require(__DIR__ . '/../../../config.php'); // phpcs:disable moodle.Files.RequireLogin.Missing // Require the necessary libraries. require_once($CFG->dirroot.'/theme/boost_union/lib.php'); diff --git a/settings.php b/settings.php index 5782629521a..48ab4411c1c 100644 --- a/settings.php +++ b/settings.php @@ -108,8 +108,7 @@ } // Create full settings page structure. - // @codingStandardsIgnoreLine - else if ($ADMIN->fulltree) { + else if ($ADMIN->fulltree) { // phpcs:disable moodle.ControlStructures.ControlSignature.Found // Require the necessary libraries. require_once($CFG->dirroot . '/theme/boost_union/lib.php');