Skip to content

Commit 90ea671

Browse files
committed
CTP-3558 coding std short array syntax
1 parent c11a298 commit 90ea671

File tree

96 files changed

+207
-207
lines changed

Some content is hidden

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

96 files changed

+207
-207
lines changed

actions/ajax/datatable/grading.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
$unallocated = optional_param('unallocated', false, PARAM_BOOL);
3636

3737
// Grading report display options.
38-
$report_options = array();
38+
$report_options = [];
3939
if ($unallocated) {
4040
$report_options['unallocated'] = true;
4141
}

actions/allocate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
$assessorallocationstrategy = optional_param('assessorallocationstrategy', false, PARAM_TEXT);
4646

4747
$moderationruletype = optional_param('addmodsetruletype', 0, PARAM_ALPHAEXT);
48-
$deletemodsetrule = optional_param('delete-mod-set-rule', array(), PARAM_RAW) ;
48+
$deletemodsetrule = optional_param('delete-mod-set-rule', [], PARAM_RAW) ;
4949

5050
// options used for pagination
5151
// If a session variable holding page preference for the specific coursework is not set, set default value (0).
@@ -76,7 +76,7 @@
7676
$options = compact('sortby', 'sorthow', 'perpage', 'page');
7777

7878
// $_POST['allocatables'] comes as array of arrays which is not supported by optional_param_array, however we clean this later in process_data() function
79-
$formdataarray = isset($_POST['allocatables']) ? $_POST['allocatables'] : array();
79+
$formdataarray = isset($_POST['allocatables']) ? $_POST['allocatables'] : = [];
8080

8181
require_login($course, true, $coursemodule);
8282

actions/allocationsession.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@
2626

2727
$assesorselect = required_param_array('assesorselect', PARAM_RAW);
2828
$assesorselectvalue = required_param_array('assesorselectvalue', PARAM_RAW);
29-
$pinnedchk = optional_param_array('pinned', array(), PARAM_RAW);
30-
$pinnedchkval = optional_param_array('pinnedvalue', array(), PARAM_RAW);
31-
$moderatorselect = optional_param_array('moderatorselect', array(), PARAM_RAW);
32-
$moderatorselectvalue = optional_param_array('moderatorselectvalue', array(), PARAM_RAW);
33-
$samplechk = optional_param_array('sample', array(), PARAM_RAW);
34-
$samplechkvalue = optional_param_array('samplevalue', array(), PARAM_RAW);
29+
$pinnedchk = optional_param_array('pinned', [], PARAM_RAW);
30+
$pinnedchkval = optional_param_array('pinnedvalue', [], PARAM_RAW);
31+
$moderatorselect = optional_param_array('moderatorselect', [], PARAM_RAW);
32+
$moderatorselectvalue = optional_param_array('moderatorselectvalue', [], PARAM_RAW);
33+
$samplechk = optional_param_array('sample', [], PARAM_RAW);
34+
$samplechkvalue = optional_param_array('samplevalue', [], PARAM_RAW);
3535
$coursemoduleid = required_param('coursemoduleid', PARAM_INT);
3636

3737
if (!isset($SESSION->coursework_allocationsessions)) {
38-
$SESSION->coursework_allocationsessions = array();
38+
$SESSION->coursework_allocationsessions = [];
3939
}
4040

4141
if (!isset($SESSION->coursework_allocationsessions[$coursemoduleid])) {
42-
$SESSION->coursework_allocationsessions[$coursemoduleid] = array();
42+
$SESSION->coursework_allocationsessions[$coursemoduleid] = [];
4343
}
4444

4545
for ($i = 0; $i < count($assesorselect); $i++) {

actions/set_personal_deadlines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'node-base')
6363
);
6464
$PAGE->requires->js_init_call('M.mod_coursework.init_personal_deadlines_page',
65-
array(),
65+
[],
6666
false,
6767
$jsmodule);
6868

backup/moodle2/restore_coursework_activity_task.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class restore_coursework_activity_task extends restore_activity_task
3333
* @return array of restore_decode_rule
3434
*/
3535
static public function define_decode_rules() {
36-
$rules = array();
36+
$rules = [];
3737

3838
$rules[] = new restore_decode_rule('COURSEWORKBYID',
3939
'/mod/coursework/view.php?id=$1',
@@ -53,7 +53,7 @@ static public function define_decode_rules() {
5353
* @return array
5454
*/
5555
static public function define_decode_contents() {
56-
$contents = array();
56+
$contents = [];
5757

5858
$contents[] = new restore_decode_content('coursework', array('intro'), 'assign');
5959

backup/moodle2/restore_coursework_stepslib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static function cheaplog($thing, $append = true) {
3939
* @return restore_path_element $structure
4040
*/
4141
protected function define_structure() {
42-
$paths = array();
42+
$paths = [];
4343

4444
$paths[] = new restore_path_element('coursework', '/activity/coursework');
4545
$paths[] = new restore_path_element('coursework_sample_set_rule', '/activity/coursework/coursework_sample_set_rules/coursework_sample_set_rule');

classes/allocation/manager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __construct(coursework $coursework) {
6969
$this->coursework = $coursework;
7070

7171
// Instantiate the allocation strategies so we can use them.
72-
$strategytypes = array();
72+
$strategytypes = [];
7373
if (!empty($this->coursework->assessorallocationstrategy)) {
7474
$strategytypes[] = coursework::ASSESSOR;
7575
}
@@ -110,7 +110,7 @@ public static function get_allocation_classnames($type = coursework::ASSESSOR) {
110110

111111
$classdir = $CFG->dirroot . '/mod/coursework/classes/allocation/strategy';
112112
$fullclassnames = glob($classdir . '/*.php');
113-
$options = array();
113+
$options = [];
114114
foreach ($fullclassnames as $fullclassname) {
115115
if (strpos($fullclassname, 'base') !== false) {
116116
continue;
@@ -169,7 +169,7 @@ public function auto_generate_moderation_set() {
169169
}
170170

171171
// These are the ones we will actually moderate (or which have already been moderated).
172-
$moderation_set = array();
172+
$moderation_set = [];
173173

174174
// Move all the already marked ones into the set. These have to stay in it and ought to
175175
// be taken into account so that the other rules just add to them.
@@ -289,7 +289,7 @@ public function auto_generate_sample_set() {
289289
$sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
290290
$order = 0;
291291

292-
$sample_set = array();
292+
$sample_set = [];
293293

294294
$allocatables = $this->get_coursework()->get_allocatables();
295295

@@ -331,7 +331,7 @@ public function auto_generate_sample_set() {
331331
if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v;
332332
}
333333

334-
$auto_sample_set = array();
334+
$auto_sample_set = [];
335335

336336
foreach ($sampleplugins as $plugin) {
337337
$classname = '\mod_coursework\sample_set_rule\\' . $plugin->rulename;

classes/allocation/strategy/base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ abstract class base {
6464
*
6565
* @var array
6666
*/
67-
private $settings = array();
67+
private $settings = [];
6868

6969
/**
7070
* @var stage_base

classes/allocation/strategy/equal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function save_allocation_strategy_options() {
8686
* @return mixed
8787
*/
8888
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
89-
$teacherids = array();
89+
$teacherids = [];
9090

9191
foreach ($teachers as $id => $teacher) {
9292
if ($this->teacher_already_has_an_allocation_for_this_allocatable($student, $teacher)) {

classes/allocation/strategy/group_assessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ public function save_allocation_strategy_options() {
6666
* @return mixed
6767
*/
6868
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
69-
return array();
69+
return = [];
7070
}
7171
}

0 commit comments

Comments
 (0)