Passed
Push — MOODLE_38_STABLE ( 6314bf...2403c5 )
by Roberto
49s
created
classes/mass_assign_processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 defined('MOODLE_INTERNAL') || die();
27 27
 
28
-require_once($CFG->dirroot.'/cohort/lib.php');
28
+require_once($CFG->dirroot . '/cohort/lib.php');
29 29
 
30 30
 class mass_assign_processor {
31 31
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     private $registerpendencies;
37 37
     private $allowallusers;
38 38
 
39
-    public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies=false, $allowallusers=false, $authtype='') {
39
+    public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies = false, $allowallusers = false, $authtype = '') {
40 40
         global $DB;
41 41
 
42 42
         $this->relationshipcohort = relationship_get_cohort($relationshipcohortid);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         }
46 46
 
47 47
         $this->relationshipgroup = $DB->get_record('relationship_groups', array('id' => $relationshipgroupid), '*', MUST_EXIST);
48
-        if($this->relationshipgroup->uniformdistribution) {
48
+        if ($this->relationshipgroup->uniformdistribution) {
49 49
             throw new \moodle_exception('cantmassassign', 'local_relationship');
50 50
         }
51 51
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                     'level' => 'error'
416 416
                 ];
417 417
             } else {
418
-                $data = (object)$params;
418
+                $data = (object) $params;
419 419
                 $data->timecreated = time();
420 420
                 $DB->insert_record('relationship_pendencies', $data);
421 421
                 $result->summary = 'registeredaspending';
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
         } else {
444 444
             for ($t = 9; $t < 11; $t++) {
445 445
                 for ($d = 0, $c = 0; $c < $t; $c++) {
446
-                    $d += $cpf{$c} * (($t + 1) - $c);
446
+                    $d += $cpf{$c}*(($t+1)-$c);
447 447
                 }
448
-                $d = ((10 * $d) % 11) % 10;
448
+                $d = ((10*$d)%11)%10;
449 449
                 if ($cpf{$c} != $d) {
450 450
                     return false;
451 451
                 }
Please login to merge, or discard this patch.
groups.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 22
  */
23 23
 
24
-require_once(__DIR__.'/../../config.php');
25
-require($CFG->dirroot.'/local/relationship/lib.php');
26
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
27
-require_once($CFG->libdir.'/adminlib.php');
24
+require_once(__DIR__ . '/../../config.php');
25
+require($CFG->dirroot . '/local/relationship/lib.php');
26
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
27
+require_once($CFG->libdir . '/adminlib.php');
28 28
 
29 29
 require_login();
30 30
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
     if ($editable) {
67 67
         $url = new moodle_url('/local/relationship/edit_group.php', array('relationshipgroupid' => $relationshipgroup->id, 'uniformdistribution' => $uniformdistribution));
68
-        $line[] = $status.' ('.html_writer::link($url, $text).')';
68
+        $line[] = $status . ' (' . html_writer::link($url, $text) . ')';
69 69
     } else {
70 70
         $line[] = $status;
71 71
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     if ($manager || $canassign) {
81 81
         $buttons[] = html_writer::link(new moodle_url('/local/relationship/assign.php', array('relationshipgroupid' => $relationshipgroup->id)),
82 82
                 html_writer::span($OUTPUT->pix_icon('t/assignroles', get_string('assign', 'local_relationship'), 'moodle', ['class' => 'iconsmall'])));
83
-        if($relationshipcohort && empty($relationshipcohort->component) && !$relationshipcohort->uniformdistribution && !$relationshipgroup->uniformdistribution) {
83
+        if ($relationshipcohort && empty($relationshipcohort->component) && !$relationshipcohort->uniformdistribution && !$relationshipgroup->uniformdistribution) {
84 84
             $buttons[] = html_writer::link(new moodle_url('/local/relationship/mass_assign.php', array('relationshipgroupid' => $relationshipgroup->id)),
85 85
                     html_writer::span($OUTPUT->pix_icon('t/add', get_string('massassign', 'local_relationship'), 'moodle', ['class' => 'iconsmall'])));
86 86
         }
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 $table = new html_table();
93 93
 $table->head = array(get_string('name', 'local_relationship'),
94 94
         get_string('memberscount', 'local_relationship'),
95
-        get_string('limit', 'local_relationship').$OUTPUT->help_icon('userlimit', 'local_relationship'),
96
-        get_string('uniformdistribute', 'local_relationship').$OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
95
+        get_string('limit', 'local_relationship') . $OUTPUT->help_icon('userlimit', 'local_relationship'),
96
+        get_string('uniformdistribute', 'local_relationship') . $OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
97 97
         get_string('edit'));
98 98
 $table->colclasses = array('leftalign name',
99 99
         'leftalign size',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     $addgroup = new single_button(new moodle_url('/local/relationship/edit_group.php', array('relationshipid' => $relationshipid)), get_string('addgroup', 'local_relationship'));
142 142
     $addgroups = new single_button(new moodle_url('/local/relationship/autogroup.php', array('relationshipid' => $relationshipid)), get_string('autogroup', 'local_relationship'));
143
-    echo html_writer::tag('div', $OUTPUT->render($addgroup).$OUTPUT->render($addgroups), array('class' => 'buttons'));
143
+    echo html_writer::tag('div', $OUTPUT->render($addgroup) . $OUTPUT->render($addgroups), array('class' => 'buttons'));
144 144
 } else if ($manager) {
145 145
     echo $OUTPUT->heading(get_string('noeditable', 'local_relationship'));
146 146
 }
Please login to merge, or discard this patch.