Completed
Push — 1.11.x ( 7ffd51...902ebd )
by José
50:21 queued 21:28
created
main/inc/lib/search/tool_processors/quiz_processor.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@
 block discarded – undo
81 81
                         );
82 82
                         if ($course_visible_for_user) {
83 83
                             $results[] = $result;
84
-                        } else { // course not visible for user
84
+                        } else {
85
+// course not visible for user
85 86
                             if ($search_show_unlinked_results) {
86 87
                                 $result['url'] = '';
87 88
                                 $results[] = $result;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             switch ($row_val['xapian_data'][SE_DATA]['type']) {
27 27
                 case SE_DOCTYPE_EXERCISE_EXERCISE:
28 28
                     $exercise_id = $se_data['exercise_id'];
29
-                    $question = NULL;
29
+                    $question = null;
30 30
                     $item = array(
31 31
                         'courseid' => $courseid,
32 32
                         'question' => $question,
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $results = array();
61 61
         foreach ($this->exercises as $courseid => $exercises) {
62 62
             $search_show_unlinked_results = (api_get_setting('search_show_unlinked_results') == 'true');
63
-            $course_visible_for_user = api_is_course_visible_for_user(NULL, $courseid);
63
+            $course_visible_for_user = api_is_course_visible_for_user(null, $courseid);
64 64
             // can view course?
65 65
             if ($course_visible_for_user || $search_show_unlinked_results) {
66 66
                 foreach ($exercises as $exercise_id => $exercise) {
Please login to merge, or discard this patch.
main/inc/lib/search/tool_processors/document_processor.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
                     );
43 43
                     if ($course_visible_for_user) {
44 44
                         $results[] = $result;
45
-                    } else { // course not visible for user
45
+                    } else {
46
+// course not visible for user
46 47
                         if ($search_show_unlinked_results) {
47 48
                             $result['url'] = '';
48 49
                             $results[] = $result;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $results = array();
25 25
         foreach ($this->rows as $row_val) {
26 26
             $search_show_unlinked_results = (api_get_setting('search_show_unlinked_results') == 'true');
27
-            $course_visible_for_user = api_is_course_visible_for_user(NULL, $row_val['courseid']);
27
+            $course_visible_for_user = api_is_course_visible_for_user(null, $row_val['courseid']);
28 28
             // can view course?
29 29
             if ($course_visible_for_user || $search_show_unlinked_results) {
30 30
                 // is visible?
Please login to merge, or discard this patch.
main/inc/lib/search/tool_processors/learnpath_processor.class.php 2 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $lp_id = intval($lp_id);
109 109
 
110 110
             if ($has_document_id) {
111
-                $sql = "SELECT $lpi_table.id, $lp_table.name, $lp_table.author, $doc_table.path
111
+                $sql = "select $lpi_table.id, $lp_table.name, $lp_table.author, $doc_table.path
112 112
                     FROM       $lp_table, $lpi_table
113 113
                     INNER JOIN $doc_table ON $lpi_table.path = $doc_table.id  AND $lpi_table.c_id = $course_id
114 114
                     WHERE       $lpi_table.c_id = $course_id AND 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                                 $lp_table.id = $lpi_table.lp_id
119 119
                     LIMIT 1";
120 120
             } else {
121
-                $sql = "SELECT $lpi_table.id, $lp_table.name, $lp_table.author
121
+                $sql = "select $lpi_table.id, $lp_table.name, $lp_table.author
122 122
                     FROM       $lp_table, $lpi_table
123 123
                     WHERE      
124 124
                                 $lpi_table.c_id = $course_id AND 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@
 block discarded – undo
81 81
                         );
82 82
                         if ($course_visible_for_user) {
83 83
                             $results[] = $result;
84
-                        } else { // course not visible for user
84
+                        } else {
85
+// course not visible for user
85 86
                             if ($search_show_unlinked_results) {
86 87
                                 $result['url'] = '';
87 88
                                 $results[] = $result;
Please login to merge, or discard this patch.
main/inc/lib/text.lib.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -681,7 +681,7 @@
 block discarded – undo
681 681
     $lastweek = sprintf("%02d", $lastweek);
682 682
     $arrdays = array();
683 683
     for ($i = 1; $i <= 7; $i++) {
684
-        $arrdays[] = strtotime("$year"."W$lastweek"."$i");
684
+        $arrdays[] = strtotime("$year"."w$lastweek"."$i");
685 685
     }
686 686
     return $arrdays;
687 687
 }
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,6 +54,7 @@  discard block
 block discarded – undo
54 54
  * Converts the text of a html-document to a given encoding, the meta-tag is changed accordingly.
55 55
  * @param string $string                The input full-html document.
56 56
  * @param string                        The new encoding value to be set.
57
+ * @param string $encoding
57 58
  */
58 59
 function api_set_encoding_html(&$string, $encoding)
59 60
 {
@@ -463,7 +464,7 @@  discard block
 block discarded – undo
463 464
  * @since wordpress  2.8.1
464 465
  * @access private
465 466
  *
466
- * @param string|array $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
467
+ * @param string[] $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
467 468
  * @param string $subject The string being searched and replaced on, otherwise known as the haystack.
468 469
  * @return string The string with the replaced svalues.
469 470
  */
@@ -660,6 +661,7 @@  discard block
 block discarded – undo
660 661
  * @param string    The text to "cut"
661 662
  * @param int       Count of chars
662 663
  * @param bool      Whether to embed in a <span title="...">...</span>
664
+ * @param integer $maxchar
663 665
  * @return string
664 666
  * */
665 667
 function cut($text, $maxchar, $embed = false)
@@ -678,7 +680,7 @@  discard block
 block discarded – undo
678 680
  *
679 681
  * @param mixed     Number to convert
680 682
  * @param int       Decimal points 0=never, 1=if needed, 2=always
681
- * @return mixed    An integer or a float depends on the parameter
683
+ * @return string|null    An integer or a float depends on the parameter
682 684
  */
683 685
 function float_format($number, $flag = 1)
684 686
 {
@@ -723,7 +725,7 @@  discard block
 block discarded – undo
723 725
 /**
724 726
  * Gets the week from a day
725 727
  * @param   string   Date in UTC (2010-01-01 12:12:12)
726
- * @return  int      Returns an integer with the week number of the year
728
+ * @return  string      Returns an integer with the week number of the year
727 729
  */
728 730
 function get_week_from_day($date)
729 731
 {
@@ -770,6 +772,9 @@  discard block
 block discarded – undo
770 772
     return $output.$end;
771 773
 }
772 774
 
775
+/**
776
+ * @param string $glue
777
+ */
773 778
 function implode_with_key($glue, $array)
774 779
 {
775 780
     if (!empty($array)) {
@@ -849,7 +854,7 @@  discard block
 block discarded – undo
849 854
 /**
850 855
  * @param string $string
851 856
  * @param bool $capitalizeFirstCharacter
852
- * @return mixed
857
+ * @return string
853 858
  */
854 859
 function underScoreToCamelCase($string, $capitalizeFirstCharacter = true)
855 860
 {
Please login to merge, or discard this patch.
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -418,8 +418,9 @@  discard block
 block discarded – undo
418 418
      * link starting with /, # or ? or a php file).
419 419
      */
420 420
     if (strpos($url, ':') === false && !in_array($url[0], array('/', '#', '?')) &&
421
-        !preg_match('/^[a-z0-9-]+?\.php/i', $url))
422
-        $url = 'http://'.$url;
421
+        !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
422
+            $url = 'http://'.$url;
423
+    }
423 424
 
424 425
     return Security::remove_XSS($url);
425 426
 
@@ -558,7 +559,8 @@  discard block
 block discarded – undo
558 559
         // Long strings might contain expensive edge cases ...
559 560
         if (10000 < strlen($piece)) {
560 561
             // ... break it up
561
-            foreach (_split_str_by_whitespace($piece, 2100) as $chunk) { // 2100: Extra room for scheme and leading and trailing paretheses
562
+            foreach (_split_str_by_whitespace($piece, 2100) as $chunk) {
563
+// 2100: Extra room for scheme and leading and trailing paretheses
562 564
                 if (2101 < strlen($chunk)) {
563 565
                     $r .= $chunk; // Too big, no whitespace: bail.
564 566
                 } else {
@@ -814,13 +816,21 @@  discard block
 block discarded – undo
814 816
     if (isset($array['Y']) && (isset($array['F']) || isset($array['M'])) && isset($array['d']) && isset($array['H']) && isset($array['i'])) {
815 817
         $year = $array['Y'];
816 818
         $month = isset($array['F']) ? $array['F'] : $array['M'];
817
-        if (intval($month) < 10) $month = '0'.$month;
819
+        if (intval($month) < 10) {
820
+            $month = '0'.$month;
821
+        }
818 822
         $day = $array['d'];
819
-        if (intval($day) < 10) $day = '0'.$day;
823
+        if (intval($day) < 10) {
824
+            $day = '0'.$day;
825
+        }
820 826
         $hours = $array['H'];
821
-        if (intval($hours) < 10) $hours = '0'.$hours;
827
+        if (intval($hours) < 10) {
828
+            $hours = '0'.$hours;
829
+        }
822 830
         $minutes = $array['i'];
823
-        if (intval($minutes) < 10) $minutes = '0'.$minutes;
831
+        if (intval($minutes) < 10) {
832
+            $minutes = '0'.$minutes;
833
+        }
824 834
     }
825 835
     if (checkdate($month, $day, $year)) {
826 836
         $datetime = $year.'-'.$month.'-'.$day.' '.$hours.':'.$minutes.':'.$seconds;
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 3 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         }
455 455
 
456 456
         $tbl_message = Database::get_main_table(TABLE_MESSAGE);
457
-        $sql = "UPDATE $tbl_message
457
+        $sql = "update $tbl_message
458 458
                 SET msg_status = ".MESSAGE_STATUS_INVITATION_ACCEPTED."
459 459
                 WHERE
460 460
                     user_sender_id = ".((int) $user_send_id)." AND
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
         $id = intval($id);
1780 1780
         $tblMessage = Database::get_main_table(TABLE_MESSAGE);
1781 1781
         $statusMessage = MESSAGE_STATUS_WALL_DELETE;
1782
-        $sql = "UPDATE $tblMessage SET msg_status = '$statusMessage' WHERE id = '{$id}' ";
1782
+        $sql = "update $tblMessage SET msg_status = '$statusMessage' WHERE id = '{$id}' ";
1783 1783
 
1784 1784
         return Database::query($sql);
1785 1785
     }
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
             $media .= '<div class="col-md-2 col-xs-2 social-post-answers">';
1556 1556
             $media .= '<div class="user-image pull-right">';
1557 1557
             $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar'].
1558
-                       '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1558
+                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1559 1559
             $media .= '</div>';
1560 1560
             $media .= '</div>';
1561 1561
             $media .= '<div class="col-md-9 col-xs-9 social-post-answers">';
@@ -1770,10 +1770,10 @@  discard block
 block discarded – undo
1770 1770
     }
1771 1771
 
1772 1772
     /**
1773
-    * Delete messages delete logic
1774
-    * @param int $id id message to delete.
1775
-    * @return bool status query
1776
-    */
1773
+     * Delete messages delete logic
1774
+     * @param int $id id message to delete.
1775
+     * @return bool status query
1776
+     */
1777 1777
     public static function deleteMessage($id)
1778 1778
     {
1779 1779
         $id = intval($id);
Please login to merge, or discard this patch.
Doc Comments   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,6 +66,7 @@  discard block
 block discarded – undo
66 66
      * @param int user id
67 67
      * @param int user friend id
68 68
      * @param string
69
+     * @param integer $user_friend
69 70
      * @return int
70 71
      * @author isaac flores paz
71 72
      */
@@ -129,6 +130,8 @@  discard block
 block discarded – undo
129 130
      * @param int group id
130 131
      * @param string name to search
131 132
      * @param bool true will load firstname, lastname, and image name
133
+     * @param integer $user_id
134
+     * @param integer $id_group
132 135
      * @return array
133 136
      * @author Julio Montoya <[email protected]> Cleaning code, function renamed, $load_extra_info option added
134 137
      * @author isaac flores paz
@@ -210,6 +213,9 @@  discard block
 block discarded – undo
210 213
      * @param int user friend id
211 214
      * @param string title of the message
212 215
      * @param string content of the message
216
+     * @param integer $user_id
217
+     * @param string $message_title
218
+     * @param string $message_content
213 219
      * @return boolean
214 220
      * @author isaac flores paz
215 221
      * @author Julio Montoya <[email protected]> Cleaning code
@@ -287,6 +293,7 @@  discard block
 block discarded – undo
287 293
      * Get number messages of the inbox
288 294
      * @author isaac flores paz
289 295
      * @param int user receiver id
296
+     * @param integer $user_receiver_id
290 297
      * @return int
291 298
      */
292 299
     public static function get_message_number_invitation_by_user_id($user_receiver_id)
@@ -477,6 +484,7 @@  discard block
 block discarded – undo
477 484
      * Denies invitation
478 485
      * @param int user sender id
479 486
      * @param int user receiver id
487
+     * @param integer $user_receiver_id
480 488
      * @return bool
481 489
      *
482 490
      * @author isaac flores paz
@@ -579,7 +587,7 @@  discard block
 block discarded – undo
579 587
      * @param string $subject
580 588
      * @param string $content
581 589
      *
582
-     * @return string message invitation
590
+     * @return false|null message invitation
583 591
      */
584 592
     public static function sendInvitationToUser($userId, $subject = '', $content = '')
585 593
     {
@@ -1379,7 +1387,7 @@  discard block
 block discarded – undo
1379 1387
      * @param string $messageContent of the message
1380 1388
      * @param int $messageId id parent
1381 1389
      * @param string $messageStatus status type of message
1382
-     * @return boolean
1390
+     * @return false|string
1383 1391
      * @author Yannick Warnier
1384 1392
      */
1385 1393
     public static function sendWallMessage(
@@ -1480,7 +1488,7 @@  discard block
 block discarded – undo
1480 1488
      * Gets all messages from someone's wall (within specific limits)
1481 1489
      * @param int $userId id of wall shown
1482 1490
      * @param string $messageStatus status wall message
1483
-     * @param int|string $parentId id message (Post main)
1491
+     * @param integer|null $parentId id message (Post main)
1484 1492
      * @param string $start Date from which we want to show the messages, in UTC time
1485 1493
      * @param int $limit Limit for the number of parent messages we want to show
1486 1494
      * @param int $offset Wall message query offset
@@ -1796,7 +1804,7 @@  discard block
 block discarded – undo
1796 1804
 
1797 1805
     /**
1798 1806
      * verify if Url Exist - Using Curl
1799
-     * @param $uri url
1807
+     * @param string $uri url
1800 1808
      *
1801 1809
      * @return boolean
1802 1810
      */
@@ -1822,7 +1830,7 @@  discard block
 block discarded – undo
1822 1830
     /**
1823 1831
     * Delete messages delete logic
1824 1832
     * @param int $id id message to delete.
1825
-    * @return bool status query
1833
+    * @return Statement status query
1826 1834
     */
1827 1835
     public static function deleteMessage($id)
1828 1836
     {
Please login to merge, or discard this patch.
main/inc/lib/usergroup.lib.php 4 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1947,8 +1947,9 @@
 block discarded – undo
1947 1947
                 $new_relation_type[] = "'$rel'";
1948 1948
             }
1949 1949
             $relation_type = implode(',', $new_relation_type);
1950
-            if (!empty($relation_type))
1951
-                $where_relation_condition = "AND gu.relation_type IN ($relation_type) ";
1950
+            if (!empty($relation_type)) {
1951
+                            $where_relation_condition = "AND gu.relation_type IN ($relation_type) ";
1952
+            }
1952 1953
         }
1953 1954
 
1954 1955
         $sql = "SELECT picture_uri as image, u.id, CONCAT (u.firstname,' ', u.lastname) as fullname, relation_type
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1760,7 +1760,7 @@  discard block
 block discarded – undo
1760 1760
         $group_id = intval($group_id);
1761 1761
         $user_id = intval($user_id);
1762 1762
 
1763
-        $sql = "UPDATE $table_group_rel_user
1763
+        $sql = "update $table_group_rel_user
1764 1764
    				SET relation_type = ".intval($relation_type)."
1765 1765
                 WHERE user_id = $user_id AND usergroup_id = $group_id";
1766 1766
         Database::query($sql);
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
         if (isset($from) && isset($limit)) {
1936 1936
             $from = intval($from);
1937 1937
             $limit = intval($limit);
1938
-            $limit_text = "LIMIT $from, $limit";
1938
+            $limit_text = "limit $from, $limit";
1939 1939
         }
1940 1940
 
1941 1941
         if (count($relation_type) == 0) {
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
         $table_message = Database::get_main_table(TABLE_MESSAGE);
2103 2103
         $topic_id = intval($topic_id);
2104 2104
         $group_id = intval($group_id);
2105
-        $sql = "UPDATE $table_message SET
2105
+        $sql = "update $table_message SET
2106 2106
                 msg_status = 3
2107 2107
                 WHERE
2108 2108
                     group_id = $group_id AND
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
                 $select_part .= "rg$rg_number.group_id as id_$rg_number, ";
2215 2215
             }
2216 2216
             if ($i == 1) {
2217
-                $cond_part .= "FROM $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id ";
2217
+                $cond_part .= "from $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id ";
2218 2218
             } else {
2219 2219
                 $cond_part .= " LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id ";
2220 2220
             }
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
         $groupRelGroupTable = Database::get_main_table(TABLE_USERGROUP_REL_USERGROUP);
2302 2302
 
2303 2303
         $select = "SELECT ";
2304
-        $from = "FROM $groupTable g1 ";
2304
+        $from = "from $groupTable g1 ";
2305 2305
 
2306 2306
         for ($i = 1; $i <= $levels; $i++) {
2307 2307
             $tableIndexNumber = $i;
@@ -2355,7 +2355,7 @@  discard block
 block discarded – undo
2355 2355
                         subgroup_id = $group_id,
2356 2356
                         relation_type = $relation_type";
2357 2357
             } else {
2358
-                $sql = "UPDATE $table SET
2358
+                $sql = "update $table SET
2359 2359
                         group_id = $parent_group_id,
2360 2360
                         relation_type = $relation_type
2361 2361
                         WHERE subgroup_id = $group_id";
Please login to merge, or discard this patch.
Doc Comments   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
      * @param int    $groupId
1068 1068
      * @param string $picture
1069 1069
      *
1070
-     * @return bool|string
1070
+     * @return false|string
1071 1071
      */
1072 1072
     public function manageFileUpload($groupId, $picture)
1073 1073
     {
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
      * If an empty name is provided, then old user photos are deleted only,
1097 1097
      * @see UserManager::delete_user_picture() as the prefered way for deletion.
1098 1098
      * @param    string $source_file The full system name of the image from which user photos will be created.
1099
-     * @return   mixed    Returns the resulting common file name of created images which usually should be stored in database.
1099
+     * @return   false|string    Returns the resulting common file name of created images which usually should be stored in database.
1100 1100
      * When an image is removed the function returns an empty string. In case of internal error or negative validation it returns FALSE.
1101 1101
      */
1102 1102
     public function update_group_picture($group_id, $file = null, $source_file = null)
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
     }
1210 1210
 
1211 1211
     /**
1212
-     * @return mixed
1212
+     * @return integer
1213 1213
      */
1214 1214
     public function getGroupType()
1215 1215
     {
@@ -1408,6 +1408,8 @@  discard block
 block discarded – undo
1408 1408
      * @param string height
1409 1409
      * @param string picture size it can be small_,  medium_  or  big_
1410 1410
      * @param string style css
1411
+     * @param integer $height
1412
+     * @param integer $size_picture
1411 1413
      * @return array with the file and the style of an image i.e $array['file'] $array['style']
1412 1414
      */
1413 1415
     public function get_picture_group(
@@ -1475,7 +1477,7 @@  discard block
 block discarded – undo
1475 1477
      * @param    string    Type of path to return (can be 'none', 'system', 'rel', 'web')
1476 1478
      * @param    bool    Whether we want to have the directory name returned 'as if' there was a file or not (in the case we want to know which directory to create - otherwise no file means no split subdir)
1477 1479
      * @param    bool    If we want that the function returns the /main/img/unknown.jpg image set it at true
1478
-     * @return   array    Array of 2 elements: 'dir' and 'file' which contain the dir and file as the name implies if image does not exist it will return the unknow image if anonymous parameter is true if not it returns an empty er's
1480
+     * @return   integer    Array of 2 elements: 'dir' and 'file' which contain the dir and file as the name implies if image does not exist it will return the unknow image if anonymous parameter is true if not it returns an empty er's
1479 1481
      */
1480 1482
     public function get_group_picture_path_by_id($id, $type = 'none', $preview = false, $anonymous = false)
1481 1483
     {
@@ -1525,7 +1527,7 @@  discard block
 block discarded – undo
1525 1527
     }
1526 1528
 
1527 1529
     /**
1528
-     * @return array
1530
+     * @return string[]
1529 1531
      */
1530 1532
     public function getAllowedPictureExtensions()
1531 1533
     {
@@ -1716,7 +1718,7 @@  discard block
 block discarded – undo
1716 1718
      * @author Julio Montoya
1717 1719
      * @param  int  $user_id
1718 1720
      * @param  int $group_id
1719
-     * @return boolean true if success
1721
+     * @return Doctrine\DBAL\Driver\Statement true if success
1720 1722
      * */
1721 1723
     public function delete_user_rel_group($user_id, $group_id)
1722 1724
     {
@@ -1927,6 +1929,8 @@  discard block
 block discarded – undo
1927 1929
      * @param int from value
1928 1930
      * @param int limit
1929 1931
      * @param array image configuration, i.e array('height'=>'20px', 'size'=> '20px')
1932
+     * @param integer $from
1933
+     * @param integer $limit
1930 1934
      * @return array list of users in a group
1931 1935
      */
1932 1936
     public function get_users_by_group(
@@ -2025,6 +2029,8 @@  discard block
 block discarded – undo
2025 2029
      * Shows the left column of the group page
2026 2030
      * @param int group id
2027 2031
      * @param int user id
2032
+     * @param integer $group_id
2033
+     * @param integer $user_id
2028 2034
      * @return string
2029 2035
      */
2030 2036
     public function show_group_column_information($group_id, $user_id, $show = '')
@@ -2353,7 +2359,7 @@  discard block
 block discarded – undo
2353 2359
      * @param int $group_id
2354 2360
      * @param int $parent_group_id if 0, we delete the parent_group association
2355 2361
      * @param int $relation_type
2356
-     * @return resource
2362
+     * @return Doctrine\DBAL\Driver\Statement
2357 2363
      **/
2358 2364
     public static function set_parent_group($group_id, $parent_group_id, $relation_type = 1)
2359 2365
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1736,7 +1736,7 @@
 block discarded – undo
1736 1736
      * @param  int $user_id
1737 1737
      * @param  int $group_id
1738 1738
      * @param  int $relation_type
1739
-    *
1739
+     *
1740 1740
      * @return boolean true if success
1741 1741
      **/
1742 1742
     public function add_user_to_group($user_id, $group_id, $relation_type = GROUP_USER_PERMISSION_READER)
Please login to merge, or discard this patch.
main/inc/lib/course_category.lib.php 2 patches
Upper-Lower-Casing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
         // Now we're at the top, get back down to update each child
159 159
         //$children_count = courseCategoryChildrenCount($categoryId);
160 160
         if ($delta >= 0) {
161
-            $sql = "UPDATE $tbl_category SET children_count = (children_count + $delta)
161
+            $sql = "update $tbl_category SET children_count = (children_count + $delta)
162 162
                 WHERE code = '$categoryId'";
163 163
         } else {
164
-            $sql = "UPDATE $tbl_category SET children_count = (children_count - ".abs($delta).")
164
+            $sql = "update $tbl_category SET children_count = (children_count - ".abs($delta).")
165 165
                 WHERE code = '$categoryId'";
166 166
         }
167 167
         Database::query($sql);
@@ -180,15 +180,15 @@  discard block
 block discarded – undo
180 180
         if ($row = Database::fetch_array($result)) {
181 181
             if (!empty($row['parent_id'])) {
182 182
                 Database::query(
183
-                    "UPDATE $tbl_course SET category_code = '".$row['parent_id']."' WHERE category_code='$node'"
183
+                    "update $tbl_course SET category_code = '".$row['parent_id']."' WHERE category_code='$node'"
184 184
                 );
185
-                Database::query("UPDATE $tbl_category SET parent_id='".$row['parent_id']."' WHERE parent_id='$node'");
185
+                Database::query("update $tbl_category SET parent_id='".$row['parent_id']."' WHERE parent_id='$node'");
186 186
             } else {
187
-                Database::query("UPDATE $tbl_course SET category_code='' WHERE category_code='$node'");
188
-                Database::query("UPDATE $tbl_category SET parent_id=NULL WHERE parent_id='$node'");
187
+                Database::query("update $tbl_course SET category_code='' WHERE category_code='$node'");
188
+                Database::query("update $tbl_category SET parent_id=NULL WHERE parent_id='$node'");
189 189
             }
190 190
 
191
-            Database::query("UPDATE $tbl_category SET tree_pos=tree_pos-1 WHERE tree_pos > '".$row['tree_pos']."'");
191
+            Database::query("update $tbl_category SET tree_pos=tree_pos-1 WHERE tree_pos > '".$row['tree_pos']."'");
192 192
             Database::query("DELETE FROM $tbl_category WHERE code='$node'");
193 193
 
194 194
             if (!empty($row['parent_id'])) {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         $code = CourseManager::generate_course_code($code);
218 218
         // Updating category
219
-        $sql = "UPDATE $tbl_category SET 
219
+        $sql = "update $tbl_category SET 
220 220
                     name='$name', 
221 221
                     code='$code', 
222 222
                     auth_course_child = '$canHaveCourses'
@@ -224,12 +224,12 @@  discard block
 block discarded – undo
224 224
         Database::query($sql);
225 225
 
226 226
         // Updating children
227
-        $sql = "UPDATE $tbl_category SET parent_id = '$code'
227
+        $sql = "update $tbl_category SET parent_id = '$code'
228 228
             WHERE parent_id = '$old_code'";
229 229
         Database::query($sql);
230 230
 
231 231
         // Updating course category
232
-        $sql = "UPDATE $tbl_course SET category_code = '$code'
232
+        $sql = "update $tbl_course SET category_code = '$code'
233 233
             WHERE category_code = '$old_code' ";
234 234
         Database::query($sql);
235 235
 
@@ -279,12 +279,12 @@  discard block
 block discarded – undo
279 279
             }
280 280
         }
281 281
 
282
-        $sql = "UPDATE $tbl_category
282
+        $sql = "update $tbl_category
283 283
                 SET tree_pos ='".$row['tree_pos']."'
284 284
                 WHERE code='$code'";
285 285
         Database::query($sql);
286 286
 
287
-        $sql = "UPDATE $tbl_category
287
+        $sql = "update $tbl_category
288 288
                 SET tree_pos = '$tree_pos'
289 289
                 WHERE code= '".$row['code']."'";
290 290
         Database::query($sql);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
         while ($row = Database::fetch_array($result)) {
313 313
             $count += self::courseCategoryChildrenCount($row['id']);
314 314
         }
315
-        $sql = "UPDATE $tbl_category SET 
315
+        $sql = "update $tbl_category SET 
316 316
                     children_count = $count 
317 317
                 WHERE id = $categoryId";
318 318
         Database::query($sql);
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * @param string $canHaveCourses
99 99
      * @param int $parent_id
100 100
      *
101
-     * @return bool
101
+     * @return false|string
102 102
      */
103 103
     public static function addNode($code, $name, $canHaveCourses, $parent_id)
104 104
     {
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      * Counts the number of children categories a category has
295 295
      * @param int $categoryId The ID of the category of which we want to count the children
296 296
      *
297
-     * @return mixed The number of subcategories this category has
297
+     * @return integer The number of subcategories this category has
298 298
      */
299 299
     public static function courseCategoryChildrenCount($categoryId)
300 300
     {
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     /**
493 493
      * @param int $id
494 494
      *
495
-     * @return bool
495
+     * @return boolean|null
496 496
      */
497 497
     public static function addToUrl($id)
498 498
     {
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
      * Get Pagination HTML div
964 964
      * @param $pageCurrent
965 965
      * @param $pageLength
966
-     * @param $pageTotal
966
+     * @param integer $pageTotal
967 967
      * @return string
968 968
      */
969 969
     public static function getCatalogPagination($pageCurrent, $pageLength, $pageTotal)
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
      * @param $categoryId
1193 1193
      * @param string $description
1194 1194
      *
1195
-     * @return string
1195
+     * @return boolean
1196 1196
      */
1197 1197
     public static function saveDescription($categoryId, $description)
1198 1198
     {
Please login to merge, or discard this patch.
main/inc/lib/agenda.lib.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3413,7 +3413,8 @@  discard block
 block discarded – undo
3413 3413
             $sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date) = ".$month." AND YEAR(start_date) = ".$year."  AND access_url_id = $current_access_url_id ORDER BY start_date ASC";
3414 3414
         }
3415 3415
         // 2. creating the SQL statement for getting the personal agenda items in WEEK view
3416
-        if ($type == "week_view") { // we are in week view
3416
+        if ($type == "week_view") {
3417
+// we are in week view
3417 3418
             $start_end_day_of_week = self::calculate_start_end_of_week(
3418 3419
                 $week,
3419 3420
                 $year
@@ -3433,7 +3434,8 @@  discard block
 block discarded – undo
3433 3434
             $sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND  access_url_id = $current_access_url_id ";
3434 3435
         }
3435 3436
         // 3. creating the SQL statement for getting the personal agenda items in DAY view
3436
-        if ($type == "day_view") { // we are in day view
3437
+        if ($type == "day_view") {
3438
+// we are in day view
3437 3439
             // we could use mysql date() function but this is only available from 4.1 and higher
3438 3440
             $start_filter = $year."-".$month."-".$day." 00:00:00";
3439 3441
             $start_filter = api_get_utc_datetime($start_filter);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1296,13 +1296,13 @@  discard block
 block discarded – undo
1296 1296
         if (!empty($event)) {
1297 1297
             switch ($this->type) {
1298 1298
                 case 'personal':
1299
-                    $sql = "UPDATE $this->tbl_personal_agenda SET
1299
+                    $sql = "update $this->tbl_personal_agenda SET
1300 1300
                             enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1301 1301
 							WHERE id = ".$id;
1302 1302
                     Database::query($sql);
1303 1303
                     break;
1304 1304
                 case 'course':
1305
-                    $sql = "UPDATE $this->tbl_course_agenda SET
1305
+                    $sql = "update $this->tbl_course_agenda SET
1306 1306
                             end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
1307 1307
 							WHERE 
1308 1308
 							    c_id = ".$this->course['real_id']." AND 
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
                     Database::query($sql);
1311 1311
                     break;
1312 1312
                 case 'admin':
1313
-                    $sql = "UPDATE $this->tbl_global_agenda SET
1313
+                    $sql = "update $this->tbl_global_agenda SET
1314 1314
                             end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
1315 1315
 							WHERE id = ".$id;
1316 1316
                     Database::query($sql);
@@ -1343,14 +1343,14 @@  discard block
 block discarded – undo
1343 1343
         if (!empty($event)) {
1344 1344
             switch ($this->type) {
1345 1345
                 case 'personal':
1346
-                    $sql = "UPDATE $this->tbl_personal_agenda SET
1346
+                    $sql = "update $this->tbl_personal_agenda SET
1347 1347
                             all_day = $allDay, date = DATE_ADD(date, INTERVAL $delta MINUTE),
1348 1348
                             enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1349 1349
 							WHERE id=".$id;
1350 1350
                     Database::query($sql);
1351 1351
                     break;
1352 1352
                 case 'course':
1353
-                    $sql = "UPDATE $this->tbl_course_agenda SET
1353
+                    $sql = "update $this->tbl_course_agenda SET
1354 1354
                             all_day = $allDay, 
1355 1355
                             start_date = DATE_ADD(start_date, INTERVAL $delta MINUTE),
1356 1356
                             end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
                     Database::query($sql);
1361 1361
                     break;
1362 1362
                 case 'admin':
1363
-                    $sql = "UPDATE $this->tbl_global_agenda SET
1363
+                    $sql = "update $this->tbl_global_agenda SET
1364 1364
                             all_day = $allDay,
1365 1365
                             start_date = DATE_ADD(start_date,INTERVAL $delta MINUTE),
1366 1366
                             end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
                     ];
2726 2726
                     $id = Database::insert($agenda_table_attachment, $params);
2727 2727
                     if ($id) {
2728
-                        $sql = "UPDATE $agenda_table_attachment
2728
+                        $sql = "update $agenda_table_attachment
2729 2729
                                 SET id = iid WHERE iid = $id";
2730 2730
                         Database::query($sql);
2731 2731
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -677,7 +677,7 @@
 block discarded – undo
677 677
      * @param bool $updateContent
678 678
      * @param int $authorId
679 679
      *
680
-     * @return bool
680
+     * @return null|boolean
681 681
      */
682 682
     public function editEvent(
683 683
         $id,
Please login to merge, or discard this patch.
main/inc/lib/lp_item.lib.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     {
80 80
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
81 81
         if ($this->c_id > 0 && $this->id > 0) {
82
-            $sql = "UPDATE $item_view_table SET
82
+            $sql = "update $item_view_table SET
83 83
                         lp_id = '".intval($this->lp_id)."' ,
84 84
                         item_type = '".Database::escape_string($this->item_type)."' ,
85 85
                         ref = '".Database::escape_string($this->ref)."' ,
Please login to merge, or discard this patch.
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  * You can add lp_item database manipulation function here
10 10
  *
11 11
  */
12
-class LpItem
13
-{
12
+class LpItem
13
+{
14 14
     public $c_id = 0;
15 15
     public $id = 0;
16 16
     public $lp_id = 0;
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
     public $search_did = 0;
35 35
     public $audio = '';
36 36
 
37
-    public function __construct($in_c_id = 0, $in_id = 0)
38
-    {
39
-        if ($in_c_id > 0 && $in_id > 0) {
37
+    public function __construct($in_c_id = 0, $in_id = 0)
38
+    {
39
+        if ($in_c_id > 0 && $in_id > 0) {
40 40
             $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
41 41
             $sql = "SELECT * FROM $item_view_table
42 42
                     WHERE
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
             $res = Database::query($sql);
47 47
             $data = Database::fetch_array($res);
48
-            if (Database::num_rows($res) > 0) {
48
+            if (Database::num_rows($res) > 0) {
49 49
                 $this->c_id = $data['c_id'];
50 50
                 $this->id = $data['id'];
51 51
                 $this->lp_id = $data['lp_id'];
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
     /**
76 76
      * Update in database
77 77
      */
78
-    public function update_in_bdd()
79
-    {
78
+    public function update_in_bdd()
79
+    {
80 80
         $item_view_table = Database::get_course_table(TABLE_LP_ITEM);
81
-        if ($this->c_id > 0 && $this->id > 0) {
81
+        if ($this->c_id > 0 && $this->id > 0) {
82 82
             $sql = "UPDATE $item_view_table SET
83 83
                         lp_id = '".intval($this->lp_id)."' ,
84 84
                         item_type = '".Database::escape_string($this->item_type)."' ,
Please login to merge, or discard this patch.