Test Failed
Push — main ( a7121c...c8394f )
by Rafael
91:23
created
public/htdocs/install/step1.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,9 @@
 block discarded – undo
99 99
             $main_data_dir = $argv[4]; // override when executing the script in command line
100 100
         }
101 101
         // In mode 3 the main_url is custom
102
-        if ($force_install_noedit != 3)
103
-        $main_url = detect_dolibarr_main_url_root();
102
+        if ($force_install_noedit != 3) {
103
+                $main_url = detect_dolibarr_main_url_root();
104
+        }
104 105
         if (!empty($argv[5])) {
105 106
             $main_url = $argv[5]; // override when executing the script in command line
106 107
         }
Please login to merge, or discard this patch.
public/htdocs/ticket/card.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,9 @@  discard block
 block discarded – undo
192 192
 
193 193
     if (($action == 'add' || ($action == 'update' && $object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) {
194 194
         $ifErrorAction = $action == 'add' ? 'create' : 'edit';
195
-        if ($action == 'add') $object->track_id = null;
195
+        if ($action == 'add') {
196
+            $object->track_id = null;
197
+        }
196 198
         $error = 0;
197 199
 
198 200
         $fieldsToCheck = [
@@ -344,7 +346,9 @@  discard block
 block discarded – undo
344 346
                 $db->rollback();
345 347
                 setEventMessages($object->error, $object->errors, 'errors');
346 348
             }
347
-        } else $action = $ifErrorAction;
349
+        } else {
350
+            $action = $ifErrorAction;
351
+        }
348 352
     }
349 353
 
350 354
     // Mark as Read
Please login to merge, or discard this patch.
public/htdocs/public/webportal/logout.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,9 @@
 block discarded – undo
49 49
 }
50 50
 
51 51
 // Not sure this is required
52
-if (isset($_SESSION['webportal_logged_thirdparty_account_id'])) unset($_SESSION['webportal_logged_thirdparty_account_id']);
52
+if (isset($_SESSION['webportal_logged_thirdparty_account_id'])) {
53
+    unset($_SESSION['webportal_logged_thirdparty_account_id']);
54
+}
53 55
 
54 56
 if (GETPOST('noredirect')) {
55 57
     return;
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Filter/PropFilter.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -67,25 +67,25 @@
 block discarded – undo
67 67
         if (is_array($elems)) {
68 68
             foreach ($elems as $elem) {
69 69
                 switch ($elem['name']) {
70
-                case '{' . Plugin::NS_CARDDAV . '}param-filter':
71
-                        $result['param-filters'][] = $elem['value'];
72
-                    break;
73
-                case '{' . Plugin::NS_CARDDAV . '}is-not-defined':
74
-                        $result['is-not-defined'] = true;
75
-                    break;
76
-                case '{' . Plugin::NS_CARDDAV . '}text-match':
77
-                        $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains';
70
+                    case '{' . Plugin::NS_CARDDAV . '}param-filter':
71
+                            $result['param-filters'][] = $elem['value'];
72
+                        break;
73
+                    case '{' . Plugin::NS_CARDDAV . '}is-not-defined':
74
+                            $result['is-not-defined'] = true;
75
+                        break;
76
+                    case '{' . Plugin::NS_CARDDAV . '}text-match':
77
+                            $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains';
78 78
 
79
-                        if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) {
80
-                            throw new BadRequest('Unknown match-type: ' . $matchType);
81
-                            }
82
-                        $result['text-matches'][] = [
83
-                        'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
84
-                        'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap',
85
-                        'value' => $elem['value'],
86
-                        'match-type' => $matchType,
87
-                        ];
88
-                    break;
79
+                            if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) {
80
+                                throw new BadRequest('Unknown match-type: ' . $matchType);
81
+                                }
82
+                            $result['text-matches'][] = [
83
+                            'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
84
+                            'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap',
85
+                            'value' => $elem['value'],
86
+                            'match-type' => $matchType,
87
+                            ];
88
+                        break;
89 89
             }
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/CardDAV/Xml/Filter/ParamFilter.php 1 patch
Switch Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -61,22 +61,22 @@
 block discarded – undo
61 61
         if (is_array($elems)) {
62 62
             foreach ($elems as $elem) {
63 63
                 switch ($elem['name']) {
64
-                case '{' . Plugin::NS_CARDDAV . '}is-not-defined':
65
-                        $result['is-not-defined'] = true;
66
-                    break;
67
-                case '{' . Plugin::NS_CARDDAV . '}text-match':
68
-                        $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains';
64
+                    case '{' . Plugin::NS_CARDDAV . '}is-not-defined':
65
+                            $result['is-not-defined'] = true;
66
+                        break;
67
+                    case '{' . Plugin::NS_CARDDAV . '}text-match':
68
+                            $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains';
69 69
 
70
-                        if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) {
71
-                            throw new BadRequest('Unknown match-type: ' . $matchType);
72
-                            }
73
-                        $result['text-match'] = [
74
-                        'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
75
-                        'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap',
76
-                        'value' => $elem['value'],
77
-                        'match-type' => $matchType,
78
-                        ];
79
-                    break;
70
+                            if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) {
71
+                                throw new BadRequest('Unknown match-type: ' . $matchType);
72
+                                }
73
+                            $result['text-match'] = [
74
+                            'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
75
+                            'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap',
76
+                            'value' => $elem['value'],
77
+                            'match-type' => $matchType,
78
+                            ];
79
+                        break;
80 80
             }
81 81
             }
82 82
         }
Please login to merge, or discard this patch.
public/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -64,28 +64,28 @@
 block discarded – undo
64 64
         if (is_array($elems)) {
65 65
             foreach ($elems as $elem) {
66 66
                 switch ($elem['name']) {
67
-                case '{' . Plugin::NS_CALDAV . '}param-filter':
68
-                        $result['param-filters'][] = $elem['value'];
69
-                    break;
70
-                case '{' . Plugin::NS_CALDAV . '}is-not-defined':
71
-                        $result['is-not-defined'] = true;
72
-                    break;
73
-                case '{' . Plugin::NS_CALDAV . '}time-range':
74
-                        $result['time-range'] = [
75
-                        'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null,
76
-                        'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null,
77
-                        ];
78
-                        if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) {
79
-                            throw new BadRequest('The end-date must be larger than the start-date');
80
-                            }
81
-                    break;
82
-                case '{' . Plugin::NS_CALDAV . '}text-match':
83
-                        $result['text-match'] = [
84
-                        'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
85
-                        'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap',
86
-                        'value' => $elem['value'],
87
-                        ];
88
-                    break;
67
+                    case '{' . Plugin::NS_CALDAV . '}param-filter':
68
+                            $result['param-filters'][] = $elem['value'];
69
+                        break;
70
+                    case '{' . Plugin::NS_CALDAV . '}is-not-defined':
71
+                            $result['is-not-defined'] = true;
72
+                        break;
73
+                    case '{' . Plugin::NS_CALDAV . '}time-range':
74
+                            $result['time-range'] = [
75
+                            'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null,
76
+                            'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null,
77
+                            ];
78
+                            if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) {
79
+                                throw new BadRequest('The end-date must be larger than the start-date');
80
+                                }
81
+                        break;
82
+                    case '{' . Plugin::NS_CALDAV . '}text-match':
83
+                            $result['text-match'] = [
84
+                            'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
85
+                            'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap',
86
+                            'value' => $elem['value'],
87
+                            ];
88
+                        break;
89 89
             }
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/ParamFilter.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,16 +60,16 @@
 block discarded – undo
60 60
         if (is_array($elems)) {
61 61
             foreach ($elems as $elem) {
62 62
                 switch ($elem['name']) {
63
-                case '{' . Plugin::NS_CALDAV . '}is-not-defined':
64
-                        $result['is-not-defined'] = true;
65
-                    break;
66
-                case '{' . Plugin::NS_CALDAV . '}text-match':
67
-                        $result['text-match'] = [
68
-                        'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
69
-                        'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap',
70
-                        'value' => $elem['value'],
71
-                        ];
72
-                    break;
63
+                    case '{' . Plugin::NS_CALDAV . '}is-not-defined':
64
+                            $result['is-not-defined'] = true;
65
+                        break;
66
+                    case '{' . Plugin::NS_CALDAV . '}text-match':
67
+                            $result['text-match'] = [
68
+                            'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'],
69
+                            'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap',
70
+                            'value' => $elem['value'],
71
+                            ];
72
+                        break;
73 73
             }
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
public/htdocs/includes/sabre/sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -64,27 +64,27 @@
 block discarded – undo
64 64
         if (is_array($elems)) {
65 65
             foreach ($elems as $elem) {
66 66
                 switch ($elem['name']) {
67
-                case '{' . Plugin::NS_CALDAV . '}comp-filter':
68
-                        $result['comp-filters'][] = $elem['value'];
69
-                    break;
70
-                case '{' . Plugin::NS_CALDAV . '}prop-filter':
71
-                        $result['prop-filters'][] = $elem['value'];
72
-                    break;
73
-                case '{' . Plugin::NS_CALDAV . '}is-not-defined':
74
-                        $result['is-not-defined'] = true;
75
-                    break;
76
-                case '{' . Plugin::NS_CALDAV . '}time-range':
77
-                        if ('VCALENDAR' === $result['name']) {
78
-                            throw new BadRequest('You cannot add time-range filters on the VCALENDAR component');
79
-                            }
80
-                        $result['time-range'] = [
81
-                        'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null,
82
-                        'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null,
83
-                        ];
84
-                        if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) {
85
-                            throw new BadRequest('The end-date must be larger than the start-date');
86
-                            }
87
-                    break;
67
+                    case '{' . Plugin::NS_CALDAV . '}comp-filter':
68
+                            $result['comp-filters'][] = $elem['value'];
69
+                        break;
70
+                    case '{' . Plugin::NS_CALDAV . '}prop-filter':
71
+                            $result['prop-filters'][] = $elem['value'];
72
+                        break;
73
+                    case '{' . Plugin::NS_CALDAV . '}is-not-defined':
74
+                            $result['is-not-defined'] = true;
75
+                        break;
76
+                    case '{' . Plugin::NS_CALDAV . '}time-range':
77
+                            if ('VCALENDAR' === $result['name']) {
78
+                                throw new BadRequest('You cannot add time-range filters on the VCALENDAR component');
79
+                                }
80
+                            $result['time-range'] = [
81
+                            'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null,
82
+                            'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null,
83
+                            ];
84
+                            if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) {
85
+                                throw new BadRequest('The end-date must be larger than the start-date');
86
+                                }
87
+                        break;
88 88
             }
89 89
             }
90 90
         }
Please login to merge, or discard this patch.
public/htdocs/includes/tcpdi/tcpdi_parser.php 1 patch
Braces   +49 added lines, -27 removed lines patch added patch discarded remove patch
@@ -49,35 +49,51 @@  discard block
 block discarded – undo
49 49
  */
50 50
 
51 51
 // include class for decoding filters
52
-if (defined('TCPDF_PATH')) require_once(constant('TCPDF_PATH') . '/include/tcpdf_filters.php');
53
-else require_once(dirname(__FILE__) . '/../tecnickcom/tcpdf/include/tcpdf_filters.php');
52
+if (defined('TCPDF_PATH')) {
53
+    require_once(constant('TCPDF_PATH') . '/include/tcpdf_filters.php');
54
+} else {
55
+    require_once(dirname(__FILE__) . '/../tecnickcom/tcpdf/include/tcpdf_filters.php');
56
+}
54 57
 
55
-if (!defined('PDF_TYPE_NULL'))
58
+if (!defined('PDF_TYPE_NULL')) {
56 59
     define('PDF_TYPE_NULL', 0);
57
-if (!defined('PDF_TYPE_NUMERIC'))
60
+}
61
+if (!defined('PDF_TYPE_NUMERIC')) {
58 62
     define('PDF_TYPE_NUMERIC', 1);
59
-if (!defined('PDF_TYPE_TOKEN'))
63
+}
64
+if (!defined('PDF_TYPE_TOKEN')) {
60 65
     define('PDF_TYPE_TOKEN', 2);
61
-if (!defined('PDF_TYPE_HEX'))
66
+}
67
+if (!defined('PDF_TYPE_HEX')) {
62 68
     define('PDF_TYPE_HEX', 3);
63
-if (!defined('PDF_TYPE_STRING'))
69
+}
70
+if (!defined('PDF_TYPE_STRING')) {
64 71
     define('PDF_TYPE_STRING', 4);
65
-if (!defined('PDF_TYPE_DICTIONARY'))
72
+}
73
+if (!defined('PDF_TYPE_DICTIONARY')) {
66 74
     define('PDF_TYPE_DICTIONARY', 5);
67
-if (!defined('PDF_TYPE_ARRAY'))
75
+}
76
+if (!defined('PDF_TYPE_ARRAY')) {
68 77
     define('PDF_TYPE_ARRAY', 6);
69
-if (!defined('PDF_TYPE_OBJDEC'))
78
+}
79
+if (!defined('PDF_TYPE_OBJDEC')) {
70 80
     define('PDF_TYPE_OBJDEC', 7);
71
-if (!defined('PDF_TYPE_OBJREF'))
81
+}
82
+if (!defined('PDF_TYPE_OBJREF')) {
72 83
     define('PDF_TYPE_OBJREF', 8);
73
-if (!defined('PDF_TYPE_OBJECT'))
84
+}
85
+if (!defined('PDF_TYPE_OBJECT')) {
74 86
     define('PDF_TYPE_OBJECT', 9);
75
-if (!defined('PDF_TYPE_STREAM'))
87
+}
88
+if (!defined('PDF_TYPE_STREAM')) {
76 89
     define('PDF_TYPE_STREAM', 10);
77
-if (!defined('PDF_TYPE_BOOLEAN'))
90
+}
91
+if (!defined('PDF_TYPE_BOOLEAN')) {
78 92
     define('PDF_TYPE_BOOLEAN', 11);
79
-if (!defined('PDF_TYPE_REAL'))
93
+}
94
+if (!defined('PDF_TYPE_REAL')) {
80 95
     define('PDF_TYPE_REAL', 12);
96
+}
81 97
 
82 98
 /**
83 99
  * @class tcpdi_parser
@@ -251,8 +267,9 @@  discard block
 block discarded – undo
251 267
     public function getPDFVersion()
252 268
     {
253 269
         preg_match('/\d\.\d/', substr($this->pdfdata, 0, 16), $m);
254
-        if (isset($m[0]))
255
-            $this->pdfVersion = $m[0];
270
+        if (isset($m[0])) {
271
+                    $this->pdfVersion = $m[0];
272
+        }
256 273
         return $this->pdfVersion;
257 274
     }
258 275
 
@@ -1211,16 +1228,18 @@  discard block
 block discarded – undo
1211 1228
         // parent object.
1212 1229
         if (isset($obj[1][1]['/Resources'])) {
1213 1230
             $res = $obj[1][1]['/Resources'];
1214
-            if ($res[0] == PDF_TYPE_OBJECT)
1215
-                return $res[1];
1231
+            if ($res[0] == PDF_TYPE_OBJECT) {
1232
+                            return $res[1];
1233
+            }
1216 1234
             return $res;
1217 1235
         } else {
1218 1236
             if (!isset($obj[1][1]['/Parent'])) {
1219 1237
                 return false;
1220 1238
             } else {
1221 1239
                 $res = $this->_getPageResources($obj[1][1]['/Parent']);
1222
-                if ($res[0] == PDF_TYPE_OBJECT)
1223
-                    return $res[1];
1240
+                if ($res[0] == PDF_TYPE_OBJECT) {
1241
+                                    return $res[1];
1242
+                }
1224 1243
                 return $res;
1225 1244
             }
1226 1245
         }
@@ -1324,8 +1343,9 @@  discard block
 block discarded – undo
1324 1343
     {
1325 1344
         $page = $this->getObjectVal($page);
1326 1345
         $box = null;
1327
-        if (isset($page[1][1][$box_index]))
1328
-            $box =& $page[1][1][$box_index];
1346
+        if (isset($page[1][1][$box_index])) {
1347
+                    $box =& $page[1][1][$box_index];
1348
+        }
1329 1349
 
1330 1350
         if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) {
1331 1351
             $tmp_box = $this->getObjectVal($box);
@@ -1398,16 +1418,18 @@  discard block
 block discarded – undo
1398 1418
         $obj = $this->getObjectVal($obj);
1399 1419
         if (isset($obj[1][1]['/Rotate'])) {
1400 1420
             $res = $this->getObjectVal($obj[1][1]['/Rotate']);
1401
-            if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
1402
-                return $res[1];
1421
+            if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT) {
1422
+                            return $res[1];
1423
+            }
1403 1424
             return $res;
1404 1425
         } else {
1405 1426
             if (!isset($obj[1][1]['/Parent'])) {
1406 1427
                 return false;
1407 1428
             } else {
1408 1429
                 $res = $this->_getPageRotation($obj[1][1]['/Parent']);
1409
-                if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
1410
-                    return $res[1];
1430
+                if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT) {
1431
+                                    return $res[1];
1432
+                }
1411 1433
                 return $res;
1412 1434
             }
1413 1435
         }
Please login to merge, or discard this patch.