Skip to content

Commit dabdd2f

Browse files
committed
INT-17886: Fix code checker 3.1.0
1 parent 143cfdd commit dabdd2f

File tree

65 files changed

+88
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+88
-153
lines changed

backup/moodle2/backup_collaborate_activity_task.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function define_my_steps() {
5454
* @param string $content some HTML text that eventually contains URLs to the activity instance scripts
5555
* @return string the content with the URLs encoded
5656
*/
57-
static public function encode_content_links($content) {
57+
public static function encode_content_links($content) {
5858
global $CFG;
5959

6060
$base = preg_quote($CFG->wwwroot, '/');

backup/moodle2/backup_collaborate_stepslib.php

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

25-
defined('MOODLE_INTERNAL') || die;
26-
2725
/**
2826
* Define the complete collaborate structure for backup, with file and id annotations
2927
*

backup/moodle2/restore_collaborate_activity_task.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function define_my_steps() {
5656
* Define the contents in the activity that must be
5757
* processed by the link decoder
5858
*/
59-
static public function define_decode_contents() {
59+
public static function define_decode_contents() {
6060
$contents = array();
6161

6262
$contents[] = new restore_decode_content('collaborate', array('intro'), 'collaborate');
@@ -68,7 +68,7 @@ static public function define_decode_contents() {
6868
* Define the decoding rules for links belonging
6969
* to the activity to be executed by the link decoder
7070
*/
71-
static public function define_decode_rules() {
71+
public static function define_decode_rules() {
7272
$rules = array();
7373

7474
$rules[] = new restore_decode_rule('COLLABORATEVIEWBYID', '/mod/collaborate/view.php?id=$1', 'course_module');
@@ -84,7 +84,7 @@ static public function define_decode_rules() {
8484
* collaborate logs. It must return one array
8585
* of {@link restore_log_rule} objects
8686
*/
87-
static public function define_restore_log_rules() {
87+
public static function define_restore_log_rules() {
8888
$rules = array();
8989

9090
$rules[] = new restore_log_rule('collaborate', 'add', 'view.php?id={course_module}', '{collaborate}');
@@ -104,7 +104,7 @@ static public function define_restore_log_rules() {
104104
* by the restore final task, but are defined here at
105105
* activity level. All them are rules not linked to any module instance (cmid = 0)
106106
*/
107-
static public function define_restore_log_rules_for_course() {
107+
public static function define_restore_log_rules_for_course() {
108108
$rules = array();
109109

110110
$rules[] = new restore_log_rule('collaborate', 'view all', 'index.php?id={course}', null);

backup/moodle2/restore_collaborate_stepslib.php

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

17-
defined('MOODLE_INTERNAL') || die();
18-
1917
/**
2018
* Define all the restore steps that will be used by the restore_collaborate_activity_task
2119
*

classes/completion/custom_completion.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ public function get_sort_order(): array {
9191
'completionlaunch'
9292
];
9393
}
94-
}
94+
}

classes/controller/controller_abstract.php

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace mod_collaborate\controller;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Controllers handle requests. Any methods that end with "_action"
3129
* can be routed to via the URL. See the router for how this happens.

classes/controller/view_controller.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ protected function set_properties() {
7272
global $DB;
7373

7474
// Set class properties from params.
75-
$id = optional_param('id', 0, PARAM_INT); // Course_module ID, or
76-
$n = optional_param('n', 0, PARAM_INT); // collaborate instance ID.
75+
$id = optional_param('id', 0, PARAM_INT); // Course_module ID or collaborate instance ID.
76+
$n = optional_param('n', 0, PARAM_INT);
7777

7878
if ($id) {
7979
$cm = get_coursemodule_from_id('collaborate', $id, 0, false, MUST_EXIST);
@@ -84,7 +84,7 @@ protected function set_properties() {
8484
$course = $DB->get_record('course', array('id' => $collaborate->course), '*', MUST_EXIST);
8585
$cm = get_coursemodule_from_instance('collaborate', $collaborate->id, $course->id, false, MUST_EXIST);
8686
} else {
87-
print_error('error:invalidmoduleid', 'mod_collaborate');
87+
throw new \moodle_exception('error:invalidmoduleid', 'mod_collaborate');
8888
}
8989

9090
$this->cm = $cm;

classes/event/course_module_instance_list_viewed.php

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace mod_collaborate\event;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* The mod_collaborate instance list viewed event class.
3129
*

classes/event/course_module_viewed.php

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace mod_collaborate\event;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* The mod_collaborate instance list viewed event class
3129
*

classes/event/recording_deleted.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
use core\event\base;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* Recording deleted event.
3331
*

classes/event/recording_downloaded.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
use core\event\base;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* Recording downloaded event.
3331
*

classes/event/recording_viewed.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
use core\event\base;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* Recording viewed event.
3331
*

classes/event/session_launched.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
use core\event\base;
2828

29-
defined('MOODLE_INTERNAL') || die();
30-
3129
/**
3230
* The mod_collaborate session launched event class.
3331
*

classes/event_handlers.php

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
use core\event\group_deleted;
2626
use core\event\group_updated;
2727

28-
defined('MOODLE_INTERNAL') || die();
29-
3028
class event_handlers {
3129

3230
/**

classes/exceptions/soap_migration_exception.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
*/
2424

2525
namespace mod_collaborate\exceptions;
26-
defined('MOODLE_INTERNAL') || die();
2726

2827
class soap_migration_exception extends \Exception {
2928

30-
}
29+
}

classes/grades/grading.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
namespace mod_collaborate\grades;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
/**
2220
* Grading functions.
2321
*

classes/iface/api_attendee.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
namespace mod_collaborate\iface;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
use stdClass;
2220

2321
/**

classes/iface/api_recordings.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

1717
namespace mod_collaborate\iface;
18-
18+
// Prepare for code checker update. Will be removed on INT-17966.
19+
// @codingStandardsIgnoreLine
1920
defined('MOODLE_INTERNAL') || die();
2021

2122
use stdClass,

classes/iface/api_session.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
namespace mod_collaborate\iface;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
use stdClass;
2220

2321
/**

classes/local.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*/
2424

2525
namespace mod_collaborate;
26-
26+
// Prepare for code checker update. Will be removed on INT-17966.
27+
// @codingStandardsIgnoreLine
2728
defined('MOODLE_INTERNAL') || die();
2829

2930
use mod_collaborate\soap\generated\ServerConfiguration,

classes/logging/constants.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
namespace mod_collaborate\logging;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
/**
2220
* Define logging constants.
2321
*

classes/migration_status.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ public function show_migration_notification ($message) {
7373
}
7474
return $shown;
7575
}
76-
}
76+
}

classes/privacy/provider.php

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
use core_privacy\local\request\contextlist;
2929
use core_privacy\local\request\userlist;
3030

31-
defined('MOODLE_INTERNAL') || die();
32-
3331
/**
3432
* Implementation of the privacy subsystem plugin provider for the Collaborate activity module.
3533
*

classes/recording_counter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2424
*/
2525
namespace mod_collaborate;
26-
26+
// Prepare for code checker update. Will be removed on INT-17966.
27+
// @codingStandardsIgnoreLine
2728
defined('MOODLE_INTERNAL') || die();
2829

2930
use mod_collaborate\renderables\recording_counts,

classes/renderables/copyablelink.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323

2424
namespace mod_collaborate\renderables;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
28-
class copyablelink implements \renderable{
26+
class copyablelink implements \renderable {
2927

3028
public function __construct($label, $id, $groups) {
3129
$nogrouplabel = get_string('nogroup', 'mod_collaborate');

classes/renderables/meetingstatus.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323

2424
namespace mod_collaborate\renderables;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
use mod_collaborate\local;
2927
use mod_collaborate\traits\exportable;
3028

31-
class meetingstatus implements \renderable, \templatable{
29+
class meetingstatus implements \renderable, \templatable {
3230

3331
use exportable;
3432

classes/renderables/recording.php

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
*/
2323
namespace mod_collaborate\renderables;
2424

25-
defined('MOODLE_INTERNAL') || die();
26-
2725
class recording implements \renderable {
2826

2927
/**

classes/renderables/recording_counts.php

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
*/
2525
namespace mod_collaborate\renderables;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
2927
/**
3028
* Simple recording count renderable model.
3129
*

classes/renderables/view_action.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525
namespace mod_collaborate\renderables;
2626

27-
defined('MOODLE_INTERNAL') || die();
28-
29-
class view_action implements \renderable{
27+
class view_action implements \renderable {
3028

3129
/**
3230
* @var \stdClass

classes/rest/http_code_validation.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*/
2323

2424
namespace mod_collaborate\rest;
25-
25+
// Prepare for code checker update. Will be removed on INT-17966.
26+
// @codingStandardsIgnoreLine
2627
defined('MOODLE_INTERNAL') || die();
2728

2829
use mod_collaborate\traits\loggable,

classes/rest/http_validation_code_error.php

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
namespace mod_collaborate\rest;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
use mod_collaborate\logging\constants;
2927

3028
class http_validation_code_error {

classes/rest/requestoptions.php

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
namespace mod_collaborate\rest;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
class requestoptions {
2927

3028
/**

classes/rest/response.php

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
namespace mod_collaborate\rest;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
class response {
2927
/**
3028
* @var string

classes/sessionlink.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2222
*/
2323
namespace mod_collaborate;
24-
24+
// Prepare for code checker update. Will be removed on INT-17966.
25+
// @codingStandardsIgnoreLine
2526
defined('MOODLE_INTERNAL') || die();
2627

2728
use mod_collaborate\local, stdClass;

classes/settings/setting_statictext.php

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
namespace mod_collaborate\settings;
2323

24-
defined('MOODLE_INTERNAL') || die();
25-
2624
/**
2725
* @author Guy Thomas
2826
* @copyright Copyright (c) 2017 Open LMS

classes/settings/setting_trimmed_configtext.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
namespace mod_collaborate\settings;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
class setting_trimmed_configtext extends \admin_setting_configtext {
2220
/**
2321
* Config text constructor

classes/task/cleanup_sessions_task.php

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*/
2424
namespace mod_collaborate\task;
2525

26-
defined('MOODLE_INTERNAL') || die();
27-
2826
use mod_collaborate\sessionlink;
2927

3028
class cleanup_sessions_task extends \core\task\scheduled_task {

classes/task/soap_migrator_task.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424
namespace mod_collaborate\task;
25-
25+
// Prepare for code checker update. Will be removed on INT-17966.
26+
// @codingStandardsIgnoreLine
2627
defined('MOODLE_INTERNAL') || die();
2728

2829
use core\task\adhoc_task,

0 commit comments

Comments
 (0)