3737 */
3838class report_editidnumber_form extends moodleform {
3939
40+ #[\Override]
4041 public function definition () {
4142 global $ CFG , $ COURSE , $ DB ;
4243 $ mform = $ this ->_form ;
@@ -53,7 +54,7 @@ public function definition() {
5354
5455 // Defining array for providing (see above) link from grade items
5556 // which are associated with course modules.
56- $ modgradeitemmap = array () ;
57+ $ modgradeitemmap = [] ;
5758
5859 // Store current activity type.
5960 $ mform ->addElement ('hidden ' , 'activitytype ' , $ activitytype );
@@ -103,10 +104,10 @@ public function definition() {
103104 $ elname = '' ;
104105
105106 // Display activity name.
106- $ iconmarkup = html_writer::empty_tag ('img ' , array (
107- 'src ' => $ cm ->get_icon_url (), 'class ' => 'activityicon ' , 'alt ' => '' ) );
107+ $ iconmarkup = html_writer::empty_tag ('img ' , [
108+ 'src ' => $ cm ->get_icon_url (), 'class ' => 'activityicon ' , 'alt ' => '' ] );
108109 $ stractivityname = html_writer::tag ('strong ' , $ iconmarkup . $ cm ->name ,
109- array ( 'id ' => null , 'class ' => renderer_base::prepare_classes ('main ' )) );
110+ [ 'id ' => null , 'class ' => renderer_base::prepare_classes ('main ' )] );
110111
111112 $ elname = 'idnumber[cm][ ' .$ cm ->id .'] ' ;
112113 // Creating element id.
@@ -125,7 +126,7 @@ public function definition() {
125126
126127 // Element to display ID number.
127128 $ mform ->addElement ('text ' , $ elname , get_string ('idnumbermod ' ),
128- array ( "id " => $ elid), array ( "id " => $ elid) );
129+ [ "id " => $ elid], [ "id " => $ elid] );
129130 $ mform ->setType ($ elname , PARAM_RAW );
130131 $ mform ->addHelpButton ($ elname , 'idnumbermod ' );
131132 if (isset ($ cm ->idnumber )) {
@@ -142,7 +143,7 @@ public function definition() {
142143 $ readonlygrades = !has_capability ('moodle/grade:manage ' , $ coursecontext );
143144
144145 // Fetching Gradebook items.
145- $ gradeitems = grade_item::fetch_all (array ( 'courseid ' => $ course ->id ) );
146+ $ gradeitems = grade_item::fetch_all ([ 'courseid ' => $ course ->id ] );
146147
147148 // Course module will be always fetched,
148149 // so lenghth will always be 1 if no gread item is fetched.
@@ -177,7 +178,7 @@ public function definition() {
177178 // In case of itemtype category,
178179 // fetching the category fullname from grade_categories table.
179180 $ gradecategory = $ DB ->get_record ("grade_categories " ,
180- array ( "id " => $ gradeitem ->iteminstance ) );
181+ [ "id " => $ gradeitem ->iteminstance ] );
181182 $ mform ->addElement ('text ' , $ elname , $ gradecategory ->fullname );
182183 $ mform ->setType ($ elname , PARAM_RAW );
183184 $ mform ->setDefault ($ elname , $ gradeitem ->idnumber );
@@ -203,6 +204,7 @@ public function definition() {
203204 }
204205 }
205206
207+ #[\Override]
206208 // Perform some extra moodle validation.
207209 public function validation ($ data , $ files ) {
208210
@@ -226,7 +228,7 @@ public function validation($data, $files) {
226228 }
227229 ksort ($ data ['idnumber ' ]['cm ' ]);
228230
229- $ errors = array () ;
231+ $ errors = [] ;
230232 $ cmidnumbers = $ data ['idnumber ' ]['cm ' ]; // Array for course module id numbers.
231233 if (!empty ($ cmidnumbers )) {
232234 $ possibleduplicates = $ cmidnumbers ;
0 commit comments