Test Failed
Push — main ( a7121c...c8394f )
by Rafael
91:23
created
public/htdocs/includes/restler/framework/Luracast/Restler/UI/Emmet.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public static function make($string, $data = null)
28 28
     {
29
-        if (!strlen($string))
30
-            return array();
29
+        if (!strlen($string)) {
30
+                    return array();
31
+        }
31 32
 
32 33
         $implicitTag =
33 34
             function () use (&$tag) {
@@ -67,8 +68,8 @@  discard block
 block discarded – undo
67 68
                 & $tokens, & $tag
68 69
             ) {
69 70
                 $digits = 0;
70
-                if ($delimiter == null)
71
-                    $delimiter = array(
71
+                if ($delimiter == null) {
72
+                                    $delimiter = array(
72 73
                         '.' => true,
73 74
                         '#' => true,
74 75
                         '*' => true,
@@ -79,6 +80,7 @@  discard block
 block discarded – undo
79 80
                         ']' => true,
80 81
                         '=' => true,
81 82
                     );
83
+                }
82 84
                 while (!empty($tokens) &&
83 85
                     !isset($delimiter[$t = array_shift($tokens)])) {
84 86
                     while ('$' === $t) {
@@ -127,8 +129,9 @@  discard block
 block discarded – undo
127 129
                         $text .= $t;
128 130
                     }
129 131
                 }
130
-                if (isset($t))
131
-                    array_unshift($tokens, $t);
132
+                if (isset($t)) {
133
+                                    array_unshift($tokens, $t);
134
+                }
132 135
                 return $text;
133 136
             };
134 137
 
@@ -138,8 +141,9 @@  discard block
 block discarded – undo
138 141
                 $a = $parseText(
139 142
                     '', $round, $total, $data
140 143
                 );
141
-                if (is_null($a))
142
-                    return;
144
+                if (is_null($a)) {
145
+                                    return;
146
+                }
143 147
                 if ('=' == ($v = array_shift($tokens))) {
144 148
                     //value
145 149
                     if ('"' == ($v = array_shift($tokens))) {
@@ -267,11 +271,13 @@  discard block
 block discarded – undo
267 271
                                 break;
268 272
                             }
269 273
                             $tag = $tag->parent;
270
-                            if ($tag->parent)
271
-                                $tag = $tag->parent;
274
+                            if ($tag->parent) {
275
+                                                            $tag = $tag->parent;
276
+                            }
272 277
                             while ('^' == ($t = array_shift($tokens))) {
273
-                                if ($tag->parent)
274
-                                    $tag = $tag->parent;
278
+                                if ($tag->parent) {
279
+                                                                    $tag = $tag->parent;
280
+                                }
275 281
                             }
276 282
                             $child = new T($t);
277 283
                             $tag[] = $child;
Please login to merge, or discard this patch.
public/htdocs/includes/restler/framework/Luracast/Restler/UI/Nav.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,23 +57,26 @@  discard block
 block discarded – undo
57 57
         if (empty(static::$tree)) {
58 58
             /** @var Restler $restler */
59 59
             $restler = Scope::get('Restler');
60
-            if (static::$addExtension)
61
-                static::$extension = isset($restler->responseFormat)
60
+            if (static::$addExtension) {
61
+                            static::$extension = isset($restler->responseFormat)
62 62
                     ? '.' . $restler->responseFormat->getExtension()
63 63
                     : '.html';
64
+            }
64 65
             static::$url = $restler->getBaseUrl();
65
-            if (empty(static::$url))
66
-                static::$url = '';
66
+            if (empty(static::$url)) {
67
+                            static::$url = '';
68
+            }
67 69
             static::$activeTrail = $activeTrail = empty($activeTrail)
68 70
                 ? (empty($restler->url) || $restler->url == 'index'
69 71
                     ? static::$root
70 72
                     : $restler->url
71 73
                 )
72 74
                 : $activeTrail;
73
-            if (static::$addExtension)
74
-                static::$extension = isset($restler->responseFormat)
75
+            if (static::$addExtension) {
76
+                            static::$extension = isset($restler->responseFormat)
75 77
                     ? '.' . $restler->responseFormat->getExtension()
76 78
                     : '.html';
79
+            }
77 80
             static::addUrls(static::$prepends);
78 81
             $map = Routes::findAll(
79 82
                 static::$excludedPaths,
@@ -168,8 +171,9 @@  discard block
 block discarded – undo
168 171
         //remove / prefix and / suffixes and any extension
169 172
         $trail = strtok(trim($trail, '/'), '.');
170 173
         $parts = explode('/', $trail);
171
-        if (count($parts) == 1 && empty($parts[0]))
172
-            $parts = array(static::$root);
174
+        if (count($parts) == 1 && empty($parts[0])) {
175
+                    $parts = array(static::$root);
176
+        }
173 177
         if (isset($r['fragment'])) {
174 178
             $parts[] = $r['fragment'];
175 179
             if (is_null($label)) {
Please login to merge, or discard this patch.
includes/restler/framework/Luracast/Restler/compatibility/restler2.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 //changes in auto loading
12 12
 $classMap = array();
13 13
 //find lowercase php files representing a class/interface
14
-foreach (explode(PATH_SEPARATOR, get_include_path()) as $path)
14
+foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
15 15
     foreach (new DirectoryIterator($path) as $fileInfo)
16 16
         if (
17 17
             $fileInfo->isFile()
@@ -25,6 +25,7 @@  discard block
 block discarded – undo
25 25
             )
26 26
         )
27 27
             $classMap[$matches[2]] = $fileInfo->getPathname();
28
+}
28 29
 
29 30
 AutoLoader::seen($classMap);
30 31
 
Please login to merge, or discard this patch.
public/htdocs/includes/restler/framework/Luracast/Restler/views/debug.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,8 +44,9 @@  discard block
 block discarded – undo
44 44
         }
45 45
         //$output .= print_r($entry, true) . "\n";
46 46
         $output .= "\nFile: " . $entry['file'] . " (Line: " . $entry['line'] . ")\n";
47
-        if (isset($entry['class']))
48
-            $output .= $entry['class'] . "::";
47
+        if (isset($entry['class'])) {
48
+                    $output .= $entry['class'] . "::";
49
+        }
49 50
         $output .= $entry['function']
50 51
             . "( " . json_encode($entry['args']) . " )\n";
51 52
     }
@@ -73,8 +74,9 @@  discard block
 block discarded – undo
73 74
 function render($data, $shadow = true)
74 75
 {
75 76
     $r = '';
76
-    if (empty($data))
77
-        return $r;
77
+    if (empty($data)) {
78
+            return $r;
79
+    }
78 80
     $r .= $shadow ? "<ul class=\"shadow\">\n" : "<ul>\n";
79 81
     if (is_array($data)) {
80 82
         // field name
@@ -112,8 +114,9 @@  discard block
 block discarded – undo
112 114
 $reqHeadersArr = array();
113 115
 $requestHeaders = $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . ' ' . $_SERVER['SERVER_PROTOCOL'] . PHP_EOL;
114 116
 foreach ($reqHeadersArr as $key => $value) {
115
-    if ($key == 'Host')
116
-        continue;
117
+    if ($key == 'Host') {
118
+            continue;
119
+    }
117 120
     $requestHeaders .= "$key: $value" . PHP_EOL;
118 121
 }
119 122
 // $requestHeaders = $this->encode(apache_request_headers(), FALSE,
Please login to merge, or discard this patch.
public/htdocs/includes/restler/framework/Luracast/Restler/Defaults.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -353,7 +353,9 @@
 block discarded – undo
353 353
      */
354 354
     public static function setProperty($name, $value)
355 355
     {
356
-        if (!property_exists(__CLASS__, $name)) return false;
356
+        if (!property_exists(__CLASS__, $name)) {
357
+            return false;
358
+        }
357 359
         if (@is_array(Defaults::$validation[$name])) {
358 360
             $info = new ValidationInfo(Defaults::$validation[$name]);
359 361
             $value = Validator::validate($value, $info);
Please login to merge, or discard this patch.
public/htdocs/includes/restler/framework/Luracast/Restler/Util.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -244,7 +244,9 @@
 block discarded – undo
244 244
     public static function getShortName($className)
245 245
     {
246 246
         // @CHANGE LDR
247
-        if (!is_string($className)) return;
247
+        if (!is_string($className)) {
248
+            return;
249
+        }
248 250
         
249 251
         $className = explode('\\', $className);
250 252
         return end($className);
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/Format/UploadFormat.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,8 +118,9 @@  discard block
 block discarded – undo
118 118
                     foreach ($file as $property => $value) {
119 119
                         $innerFile[$property] = $value[$i];
120 120
                     }
121
-                    if ($innerFile['name'])
122
-                        static::checkFile($innerFile, $doMimeCheck, $doSizeCheck);
121
+                    if ($innerFile['name']) {
122
+                                            static::checkFile($innerFile, $doMimeCheck, $doSizeCheck);
123
+                    }
123 124
 
124 125
                     if (isset($innerFile['exception'])) {
125 126
                         $file['error'][$i] = $innerFile['error'];
@@ -128,8 +129,9 @@  discard block
 block discarded – undo
128 129
                     }
129 130
                 }
130 131
             } else {
131
-                if ($file['name'])
132
-                    static::checkFile($file, $doMimeCheck, $doSizeCheck);
132
+                if ($file['name']) {
133
+                                    static::checkFile($file, $doMimeCheck, $doSizeCheck);
134
+                }
133 135
                 if (isset($innerFile['exception'])) {
134 136
                     break;
135 137
                 }
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/Format/CsvFormat.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -106,8 +106,9 @@  discard block
 block discarded – undo
106 106
 
107 107
         static::$haveHeaders ? $keys = $row : $decoded[] = $row;
108 108
 
109
-        while (($row = static::getRow(array_shift($lines), $keys)) !== FALSE)
110
-            $decoded [] = $row;
109
+        while (($row = static::getRow(array_shift($lines), $keys)) !== FALSE) {
110
+                    $decoded [] = $row;
111
+        }
111 112
 
112 113
         $char = Obj::$separatorChar;
113 114
         Obj::$separatorChar = false;
@@ -130,11 +131,13 @@  discard block
 block discarded – undo
130 131
 
131 132
         $row = array();
132 133
         foreach ($line as $key => $value) {
133
-            if (is_numeric($value))
134
-                $value = floatval($value);
134
+            if (is_numeric($value)) {
135
+                            $value = floatval($value);
136
+            }
135 137
             if ($keys) {
136
-                if (isset($keys [$key]))
137
-                    $row [$keys [$key]] = $value;
138
+                if (isset($keys [$key])) {
139
+                                    $row [$keys [$key]] = $value;
140
+                }
138 141
             } else {
139 142
                 $row [$key] = $value;
140 143
             }
@@ -169,8 +172,9 @@  discard block
 block discarded – undo
169 172
 
170 173
         static::$haveHeaders ? $keys = $row : $decoded[] = $row;
171 174
 
172
-        while (($row = static::getRow(stream_get_line($stream, 0, PHP_EOL), $keys)) !== FALSE)
173
-            $decoded [] = $row;
175
+        while (($row = static::getRow(stream_get_line($stream, 0, PHP_EOL), $keys)) !== FALSE) {
176
+                    $decoded [] = $row;
177
+        }
174 178
 
175 179
         $char = Obj::$separatorChar;
176 180
         Obj::$separatorChar = false;
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/Filter/RateLimit.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -81,7 +81,9 @@  discard block
 block discarded – undo
81 81
         if (
82 82
             static::$authenticatedUsagePerUnit
83 83
             == static::$usagePerUnit
84
-        ) return $this->check();
84
+        ) {
85
+            return $this->check();
86
+        }
85 87
         return null;
86 88
     }
87 89
 
@@ -93,11 +95,12 @@  discard block
 block discarded – undo
93 95
 
94 96
     private static function validate($unit)
95 97
     {
96
-        if (!isset(static::$units[$unit]))
97
-            throw new \InvalidArgumentException(
98
+        if (!isset(static::$units[$unit])) {
99
+                    throw new \InvalidArgumentException(
98 100
                 'Rate Limit time unit should be '
99 101
                 . implode('|', array_keys(static::$units)) . '.'
100 102
             );
103
+        }
101 104
     }
102 105
 
103 106
     private function check($isAuthenticated = false)
Please login to merge, or discard this patch.