Skip to content

Commit

Permalink
Merge pull request #342 from catalyst/fixup-ci-and-codingstandards
Browse files Browse the repository at this point in the history
cleanup: fixup to match coding standards
  • Loading branch information
rhell4 authored Aug 9, 2024
2 parents dae83f4 + 97b1185 commit abcb087
Show file tree
Hide file tree
Showing 35 changed files with 40 additions and 300 deletions.
1 change: 1 addition & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* This file should run before config.php requires '/lib/setup.php'.
*
Expand Down
9 changes: 0 additions & 9 deletions classes/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* calendar class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\calendar;

use auth_outage\local\outage;
Expand Down
12 changes: 0 additions & 12 deletions classes/dml/outagedb.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +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/>.

/**
* outagedb class.
*
* The DB Context to manipulate Outages.
* It will also commit changes to the calendar as you change outages.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\dml;

use auth_outage\calendar\calendar;
Expand Down
9 changes: 0 additions & 9 deletions classes/event/outage_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* Toutage_created class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\event;

use core\event\base;
Expand Down
8 changes: 0 additions & 8 deletions classes/event/outage_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +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/>.

/**
* outage_deleted class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace auth_outage\event;

use core\event\base;
Expand Down
9 changes: 0 additions & 9 deletions classes/event/outage_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* outage_updated class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\event;

use core\event\base;
Expand Down
12 changes: 0 additions & 12 deletions classes/form/outage/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* delete class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\form\outage;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/formslib.php');

defined('MOODLE_INTERNAL') || die();

/**
* delete class.
*
Expand Down
11 changes: 1 addition & 10 deletions classes/form/outage/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* edit class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\form\outage;

use auth_outage\local\outage;
Expand Down Expand Up @@ -166,7 +157,7 @@ public function set_data($outage) {
if (array_key_exists('auth_outage', $CFG->forced_plugin_settings)
&& array_key_exists('default_autostart', $CFG->forced_plugin_settings['auth_outage'])) {
$this->_form->setDefaults([
'autostart' => $CFG->forced_plugin_settings['auth_outage']['default_autostart']
'autostart' => $CFG->forced_plugin_settings['auth_outage']['default_autostart'],
]);
$mform->freeze('autostart');
}
Expand Down
9 changes: 0 additions & 9 deletions classes/form/outage/finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* finish class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\form\outage;

use moodleform;
Expand Down
13 changes: 2 additions & 11 deletions classes/local/cli/cli_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* cli_exception class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\cli;

use Exception;
Expand Down Expand Up @@ -85,9 +76,9 @@ class cli_exception extends Exception {
* cliexception constructor.
* @param string $message An explanation of the exception.
* @param int $code Exit code to be used.
* @param Exception $previous Another exception as reference or null.
* @param Exception|null $previous Another exception as reference or null.
*/
public function __construct($message, $code = 1, Exception $previous = null) {
public function __construct($message, $code = 1, ?Exception $previous = null) {
parent::__construct('*ERROR* '.$message, $code, $previous = null);
}
}
13 changes: 2 additions & 11 deletions classes/local/cli/clibase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* clibase class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\cli;

use auth_outage\local\outagelib;
Expand Down Expand Up @@ -50,10 +41,10 @@ abstract class clibase {

/**
* clibase constructor.
* @param array $options The parameters to use.
* @param array|null $options The parameters to use.
* @throws cli_exception
*/
public function __construct(array $options = null) {
public function __construct(?array $options = null) {
global $CFG;
require_once($CFG->libdir.'/clilib.php');

Expand Down
9 changes: 0 additions & 9 deletions classes/local/cli/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* create class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\cli;

use auth_outage\dml\outagedb;
Expand Down
9 changes: 0 additions & 9 deletions classes/local/cli/finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* finish class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\cli;

use auth_outage\dml\outagedb;
Expand Down
9 changes: 0 additions & 9 deletions classes/local/cli/waitforit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* waitforit class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\cli;

use auth_outage\dml\outagedb;
Expand Down
13 changes: 2 additions & 11 deletions classes/local/controllers/infopage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* infopage class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\controllers;

use auth_outage\dml\outagedb;
Expand Down Expand Up @@ -53,9 +44,9 @@ class infopage {

/**
* infopage_controller constructor.
* @param array $params Parameters to use or null to get from Moodle API (request).
* @param array|null $params Parameters to use or null to get from Moodle API (request).
*/
public function __construct(array $params = null) {
public function __construct(?array $params = null) {
global $CFG;
// Enable SVG support here to make sure all SVG files
// used in the current theme are served properly.
Expand Down
9 changes: 0 additions & 9 deletions classes/local/controllers/maintenance_static_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* maintenance_static_page class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\controllers;

use auth_outage\local\outage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* maintenance_static_page_generator class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\controllers;

use auth_outage\local\outagelib;
Expand Down
9 changes: 0 additions & 9 deletions classes/local/controllers/maintenance_static_page_io.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* maintenance_static_page_io class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local\controllers;

use auth_outage\local\outagelib;
Expand Down
9 changes: 0 additions & 9 deletions classes/local/outage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +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/>.

/**
* outage class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local;

use coding_exception;
Expand Down
11 changes: 0 additions & 11 deletions classes/local/outagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* outagelib class.
*
* @package auth_outage
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
* @copyright 2016 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace auth_outage\local;

use auth_outage\dml\outagedb;
use auth_outage\local\controllers\maintenance_static_page;
use auth_outage\output\renderer;
use coding_exception;
use curl;
use Exception;
Expand All @@ -36,7 +26,6 @@
use stdClass;

defined('MOODLE_INTERNAL') || die();

require_once(__DIR__.'/../../lib.php');

/**
Expand Down
Loading

0 comments on commit abcb087

Please sign in to comment.