Passed
Push — MOODLE_35_STABLE ( 61b49b )
by Roberto
06:41
created
lib.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@
 block discarded – undo
284 284
  * Update existing relationship
285 285
  *
286 286
  * @param sstdClass $relationship
287
- * @return void
287
+ * @return boolean
288 288
  */
289 289
 function relationship_update_relationship($relationship) {
290 290
     global $DB;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             'relationship',
270 270
             $relationship->id,
271 271
             context::instance_by_id($relationship->contextid),
272
-            $relationship->tags) ;
272
+            $relationship->tags);
273 273
 
274 274
         $event = \local_relationship\event\relationship_created::create(array(
275 275
                 'context' => context::instance_by_id($relationship->contextid),
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             'relationship',
302 302
             $relationship->id,
303 303
             context::instance_by_id($relationship->contextid),
304
-            $relationship->tags) ;
304
+            $relationship->tags);
305 305
 
306 306
         $event = \local_relationship\event\relationship_updated::create(array(
307 307
                 'context' => context::instance_by_id($relationship->contextid),
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
     $cohorts = $DB->get_records('relationship_cohorts', array('relationshipid' => $relationship->id));
330 330
 
331
-    if(count($cohorts) == 0) {
331
+    if (count($cohorts) == 0) {
332 332
 
333 333
         $relationshipgroups = $DB->get_records('relationship_groups', array('relationshipid' => $relationship->id));
334 334
         foreach ($relationshipgroups AS $g) {
Please login to merge, or discard this patch.
cohorts.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  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');
24
+require_once(__DIR__ . '/../../config.php');
25
+require($CFG->dirroot . '/local/relationship/lib.php');
26
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
27 27
 
28 28
 require_login();
29 29
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
         get_string('cohort', 'cohort'),
69 69
         get_string('size'),
70 70
         get_string('role'),
71
-        get_string('allowdupsingroups', 'local_relationship').$OUTPUT->help_icon('allowdupsingroups', 'local_relationship'),
72
-        get_string('uniformdistribute', 'local_relationship').$OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
71
+        get_string('allowdupsingroups', 'local_relationship') . $OUTPUT->help_icon('allowdupsingroups', 'local_relationship'),
72
+        get_string('uniformdistribute', 'local_relationship') . $OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
73 73
         get_string('edit')
74 74
 );
75 75
 $table->colclasses = array(
Please login to merge, or discard this patch.
edit_group.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 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_once($CFG->dirroot.'/course/lib.php');
26
-require($CFG->dirroot.'/local/relationship/lib.php');
27
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
24
+require_once(__DIR__ . '/../../config.php');
25
+require_once($CFG->dirroot . '/course/lib.php');
26
+require($CFG->dirroot . '/local/relationship/lib.php');
27
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
28 28
 
29 29
 require_login();
30 30
 
Please login to merge, or discard this patch.
classes/existing_selector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
         list($usercondition, $params) = users_search_sql($search, 'u', $this->searchanywhere);
46 46
 
47
-        if(!empty($this->validatinguserids)) {
47
+        if (!empty($this->validatinguserids)) {
48 48
             list($usertest, $userparams) = $DB->get_in_or_equal($this->validatinguserids, SQL_PARAMS_NAMED, 'val');
49 49
             $usercondition .= " AND u.id*1000000+rc.id " . $usertest;
50 50
             $params = array_merge($params, $userparams);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 WHERE rm.relationshipgroupid = :relationshipgroupid
62 62
                   AND {$usercondition}";
63 63
 
64
-        $orderby= "ORDER BY roleid, fullname";
64
+        $orderby = "ORDER BY roleid, fullname";
65 65
 
66 66
         if (!$this->is_validating()) {
67 67
             $sql = $countfields . "\n" . $from;
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
             }
74 74
         }
75 75
 
76
-        $sql = $selectfields . "\n" . $from .  "\n" . $orderby;
76
+        $sql = $selectfields . "\n" . $from . "\n" . $orderby;
77 77
 
78 78
         $users = array();
79 79
         $roleid = -1;
80 80
         $index = false;
81
-        foreach($DB->get_recordset_sql($sql, $params) AS $cand) {
82
-            if($cand->roleid != $roleid) {
81
+        foreach ($DB->get_recordset_sql($sql, $params) AS $cand) {
82
+            if ($cand->roleid != $roleid) {
83 83
                 $role = $DB->get_record('role', array('id'=>$cand->roleid), '*', MUST_EXIST);
84 84
                 $index = role_get_name($role);
85 85
                 $users[$index] = array();
Please login to merge, or discard this patch.
classes/observer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 defined('MOODLE_INTERNAL') || die();
25 25
 
26
-require_once($CFG->dirroot.'/local/relationship/lib.php');
26
+require_once($CFG->dirroot . '/local/relationship/lib.php');
27 27
 
28 28
 /**
29 29
  * Event handler for relationship local plugin.
Please login to merge, or discard this patch.
classes/form/edit_group.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 namespace local_relationship\form;
25 25
 defined('MOODLE_INTERNAL') || die();
26 26
 
27
-require_once($CFG->dirroot.'/lib/formslib.php');
27
+require_once($CFG->dirroot . '/lib/formslib.php');
28 28
 
29 29
 class edit_group extends \moodleform {
30 30
 
Please login to merge, or discard this patch.
classes/form/autogroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 namespace local_relationship\form;
25 25
 defined('MOODLE_INTERNAL') || die();
26 26
 
27
-require_once($CFG->dirroot.'/lib/formslib.php');
27
+require_once($CFG->dirroot . '/lib/formslib.php');
28 28
 
29 29
 /**
30 30
  * Auto group form class
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     function definition() {
41 41
         global $DB;
42 42
 
43
-        $mform =& $this->_form;
43
+        $mform = & $this->_form;
44 44
 
45 45
         $relationshipid = $this->_customdata['relationshipid'];
46 46
 
Please login to merge, or discard this patch.
classes/form/edit_cohort.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 namespace local_relationship\form;
25 25
 defined('MOODLE_INTERNAL') || die();
26 26
 
27
-require_once($CFG->dirroot.'/lib/formslib.php');
27
+require_once($CFG->dirroot . '/lib/formslib.php');
28 28
 
29 29
 class edit_cohort extends \moodleform {
30 30
 
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
 
36 36
         $cohorts = relationship_get_cohort_options($relationshipcohort->relationshipid);
37 37
         $relationshipcohorts = relationship_get_cohorts($relationshipcohort->relationshipid);
38
-        foreach($relationshipcohorts AS $rc) {
38
+        foreach ($relationshipcohorts AS $rc) {
39 39
             unset($cohorts[$rc->cohortid]);
40 40
         }
41 41
 
42 42
         $mform->addElement('select', 'cohortid', get_string('cohort', 'cohort'), $cohorts);
43 43
 
44 44
         $roles = relationship_get_role_options();
45
-        foreach($relationshipcohorts AS $rc) {
45
+        foreach ($relationshipcohorts AS $rc) {
46 46
             unset($roles[$rc->roleid]);
47 47
         }
48 48
         $mform->addElement('select', 'roleid', get_string('role'), $roles);
49 49
 
50
-        if($relationshipcohort->id) {
50
+        if ($relationshipcohort->id) {
51 51
             $mform->freeze('roleid');
52 52
             $mform->freeze('cohortid');
53 53
         }
Please login to merge, or discard this patch.
classes/form/edit_relationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 namespace local_relationship\form;
25 25
 defined('MOODLE_INTERNAL') || die();
26 26
 
27
-require_once($CFG->dirroot.'/lib/formslib.php');
27
+require_once($CFG->dirroot . '/lib/formslib.php');
28 28
 
29 29
 class edit_relationship extends \moodleform {
30 30
 
Please login to merge, or discard this patch.