Skip to content

Commit

Permalink
MDL-78496 core: Address phpcs issues with upgrade.php files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Nov 19, 2023
1 parent 545b36c commit 525212f
Show file tree
Hide file tree
Showing 119 changed files with 180 additions and 345 deletions.
2 changes: 0 additions & 2 deletions admin/tool/cohortroles/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade tool_cohortroles.
*
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/customlang/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand All @@ -24,8 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

function xmldb_tool_customlang_upgrade($oldversion) {
// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/dataprivacy/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade tool_dataprivacy.
*
Expand All @@ -42,7 +40,6 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
// Put any upgrade step following this.

if ($oldversion < 2023062700) {

// Define table tool_dataprivacy_contextlist to be created.
$table = new xmldb_table('tool_dataprivacy_contextlist');

Expand Down
2 changes: 0 additions & 2 deletions admin/tool/log/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade the plugin.
*
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/log/store/database/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

function xmldb_logstore_database_upgrade($oldversion) {
// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/log/store/standard/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

function xmldb_logstore_standard_upgrade($oldversion) {
// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.
Expand Down
1 change: 0 additions & 1 deletion admin/tool/mfa/factor/auth/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @param int $oldversion
*/
function xmldb_factor_auth_upgrade($oldversion) {

if ($oldversion < 2021020500) {
$authtypes = get_enabled_auth_plugins(true);
// Upgrade goodauth config from number to name.
Expand Down
4 changes: 0 additions & 4 deletions admin/tool/mobile/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once($CFG->dirroot . '/lib/upgradelib.php');

/**
* Upgrade the plugin.
*
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/monitor/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade the plugin.
*
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/moodlenet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade the plugin.
*
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/policy/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Execute the plugin upgrade steps from the given old version.
*
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/usertours/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

use tool_usertours\manager;
use tool_usertours\tour;

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

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

/**
* Function to upgrade auth_cas.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/db/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_db.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/email/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_email.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/ldap/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_ldap.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/lti/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade function.
*
Expand Down
2 changes: 0 additions & 2 deletions auth/manual/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_manual.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_mnet.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/none/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_none.
* @param int $oldversion the version we are upgrading from
Expand Down
2 changes: 0 additions & 2 deletions auth/oauth2/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade function
*
Expand Down
2 changes: 0 additions & 2 deletions auth/shibboleth/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Function to upgrade auth_shibboleth.
* @param int $oldversion the version we are upgrading from
Expand Down
4 changes: 0 additions & 4 deletions blocks/calendar_month/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once("{$CFG->libdir}/db/upgradelib.php");

/**
* Upgrade the calendar_month block
* @param int $oldversion
Expand Down
10 changes: 0 additions & 10 deletions blocks/completionstatus/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,13 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Handles upgrading instances of this block.
*
* @param int $oldversion
* @param object $block
*/
function xmldb_block_completionstatus_upgrade($oldversion, $block) {
global $CFG;

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.

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

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

/**
* Handles upgrading instances of this block.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/feedback/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Handles upgrading instances of this block.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/html/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade code for the HTML block.
*
Expand Down
5 changes: 0 additions & 5 deletions blocks/myoverview/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once("{$CFG->dirroot}/my/lib.php");
require_once("{$CFG->libdir}/db/upgradelib.php");

/**
* Upgrade code for the MyOverview block.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/navigation/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* As of the implementation of this block and the general navigation code
* in Moodle 2.0 the body of immediate upgrade work for this block and
Expand Down
2 changes: 0 additions & 2 deletions blocks/recent_activity/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade code for the recent activity block.
*
Expand Down
4 changes: 0 additions & 4 deletions blocks/recentlyaccesseditems/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once("{$CFG->libdir}/db/upgradelib.php");

/**
* Upgrade the recentlyaccesseditems db table.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/rss_client/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @author Neill Magill <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
defined('MOODLE_INTERNAL') || die();

/**
* Upgrade the block_rss_client database.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/section_links/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade code for the section links block.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/selfcompletion/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Handles upgrading instances of this block.
*
Expand Down
2 changes: 0 additions & 2 deletions blocks/settings/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* As of the implementation of this block and the general navigation code
* in Moodle 2.0 the body of immediate upgrade work for this block and
Expand Down
2 changes: 0 additions & 2 deletions blocks/tag_youtube/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade code for the Tag Youtube block.
*
Expand Down
5 changes: 1 addition & 4 deletions blocks/timeline/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once("{$CFG->libdir}/db/upgradelib.php");

/**
*
* Upgrade the timeline block
* @param int $oldversion
* @param object $block
Expand Down
2 changes: 0 additions & 2 deletions course/format/topics/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade script for Topics course format.
*
Expand Down
2 changes: 0 additions & 2 deletions course/format/weeks/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Upgrade script for format_weeks
*
Expand Down
Loading

0 comments on commit 525212f

Please sign in to comment.