Completed
Branch develop (aa6d31)
by
unknown
24:05
created
htdocs/includes/restler/framework/Luracast/Restler/Explorer.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
             $filename == 'index.html'
153 153
         ) {
154 154
             $status = 302;
155
-            $url = $this->restler->getBaseUrl() . '/' . $this->base() . '/';
156
-            header("{$_SERVER['SERVER_PROTOCOL']} $status " . RestException::$codes[$status]);
155
+            $url = $this->restler->getBaseUrl().'/'.$this->base().'/';
156
+            header("{$_SERVER['SERVER_PROTOCOL']} $status ".RestException::$codes[$status]);
157 157
             header("Location: $url");
158 158
             exit;
159 159
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         ) {
164 164
             $filename .= '.js';
165 165
         }
166
-        PassThrough::file(__DIR__ . '/explorer/' . (empty($filename) ? 'index.html' : $filename), false,
166
+        PassThrough::file(__DIR__.'/explorer/'.(empty($filename) ? 'index.html' : $filename), false,
167 167
             0); //60 * 60 * 24);
168 168
     }
169 169
 
@@ -173,15 +173,15 @@  discard block
 block discarded – undo
173 173
     public function swagger()
174 174
     {
175 175
         $r = new stdClass();
176
-        $version = (string)$this->restler->getRequestedApiVersion();
176
+        $version = (string) $this->restler->getRequestedApiVersion();
177 177
         $r->swagger = static::SWAGGER;
178 178
 
179 179
         $info = parse_url($this->restler->getBaseUrl());
180 180
         $r->host = $info['host'];
181 181
         if (isset($info['port'])) {
182
-            $r->host .= ':' . $info['port'];
182
+            $r->host .= ':'.$info['port'];
183 183
         }
184
-        $r->basePath = isset($info['path']) ?  $info['path'] : '';
184
+        $r->basePath = isset($info['path']) ? $info['path'] : '';
185 185
         if (!empty(static::$schemes)) {
186 186
             $r->schemes = static::$schemes;
187 187
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $r->consumes = $this->restler->getReadableMimeTypes();
191 191
 
192 192
         $r->paths = $this->paths($version);
193
-        $r->definitions = (object)$this->models;
193
+        $r->definitions = (object) $this->models;
194 194
         $r->securityDefinitions = $this->securityDefinitions();
195 195
         $r->info = compact('version') + array_filter(get_class_vars(static::$infoClass));
196 196
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
                     $description = ''; //'<section class="body-param">';
303 303
                     foreach ($firstChild['children'] as $child) {
304 304
                         $description .= isset($child['required']) && $child['required']
305
-                            ? '**' . $child['name'] . '** (required)  '.PHP_EOL
306
-                            : $child['name'] . '  '.PHP_EOL;
305
+                            ? '**'.$child['name'].'** (required)  '.PHP_EOL
306
+                            : $child['name'].'  '.PHP_EOL;
307 307
                     }
308 308
                     //$description .= '</section>';
309 309
                 }
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
                 $description = ''; //'<section class="body-param">';
313 313
                 foreach ($children as $child) {
314 314
                     $description .= isset($child['required']) && $child['required']
315
-                        ? '**' . $child['name'] . '** (required)  '.PHP_EOL
316
-                        : $child['name'] . '  '.PHP_EOL;
315
+                        ? '**'.$child['name'].'** (required)  '.PHP_EOL
316
+                        : $child['name'].'  '.PHP_EOL;
317 317
                 }
318 318
                 //$description .= '</section>';
319 319
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         //$p->allowMultiple = false;
367 367
 
368 368
         if (isset($p->{'$ref'})) {
369
-            $p->schema = (object)array('$ref' => ($p->{'$ref'}));
369
+            $p->schema = (object) array('$ref' => ($p->{'$ref'}));
370 370
             unset($p->{'$ref'});
371 371
         }
372 372
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     {
378 378
         $code = '200';
379 379
         $r = array(
380
-            $code => (object)array(
380
+            $code => (object) array(
381 381
                 'description' => 'Success',
382 382
                 'schema'      => new stdClass()
383 383
             )
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             if ($info->children) {
446 446
                 $contentType = Util::getShortName($info->contentType);
447 447
                 $model = $this->model($contentType, $info->children);
448
-                $object->items = (object)array(
448
+                $object->items = (object) array(
449 449
                     '$ref' => "#/definitions/$contentType"
450 450
                 );
451 451
             } elseif ($info->contentType && $info->contentType == 'associative') {
@@ -463,23 +463,23 @@  discard block
 block discarded – undo
463 463
                 if (is_string($info->contentType) && $t = Util::nestedValue(static::$dataTypeAlias,
464 464
                         strtolower($info->contentType))) {
465 465
                     if (is_array($t)) {
466
-                        $object->items = (object)array(
466
+                        $object->items = (object) array(
467 467
                             'type'   => $t[0],
468 468
                             'format' => $t[1],
469 469
                         );
470 470
                     } else {
471
-                        $object->items = (object)array(
471
+                        $object->items = (object) array(
472 472
                             'type' => $t,
473 473
                         );
474 474
                     }
475 475
                 } else {
476 476
                     $contentType = Util::getShortName($info->contentType);
477
-                    $object->items = (object)array(
477
+                    $object->items = (object) array(
478 478
                         '$ref' => "#/definitions/$contentType"
479 479
                     );
480 480
                 }
481 481
             } else {
482
-                $object->items = (object)array(
482
+                $object->items = (object) array(
483 483
                     'type' => 'string'
484 484
                 );
485 485
             }
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
     private function operationId(array $route)
514 514
     {
515 515
         static $hash = array();
516
-        $id = $route['httpMethod'] . ' ' . $route['url'];
516
+        $id = $route['httpMethod'].' '.$route['url'];
517 517
         if (isset($hash[$id])) {
518 518
             return $hash[$id];
519 519
         }
@@ -521,14 +521,14 @@  discard block
 block discarded – undo
521 521
         $method = $route['methodName'];
522 522
 
523 523
         if (isset(static::$prefixes[$method])) {
524
-            $method = static::$prefixes[$method] . $class;
524
+            $method = static::$prefixes[$method].$class;
525 525
         } else {
526 526
             $method = str_replace(
527 527
                 array_keys(static::$prefixes),
528 528
                 array_values(static::$prefixes),
529 529
                 $method
530 530
             );
531
-            $method = lcfirst($class) . ucfirst($method);
531
+            $method = lcfirst($class).ucfirst($method);
532 532
         }
533 533
         $hash[$id] = $method;
534 534
 
@@ -537,13 +537,13 @@  discard block
 block discarded – undo
537 537
 
538 538
     private function modelName(array $route)
539 539
     {
540
-        return $this->operationId($route) . 'Model';
540
+        return $this->operationId($route).'Model';
541 541
     }
542 542
 
543 543
     private function securityDefinitions()
544 544
     {
545 545
         $r = new stdClass();
546
-        $r->api_key = (object)array(
546
+        $r->api_key = (object) array(
547 547
             'type' => 'apiKey',
548 548
             'name' => 'api_key',
549 549
             'in'   => 'query',
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/ApcCache.php 1 patch
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,9 +38,8 @@  discard block
 block discarded – undo
38 38
         function_exists('apc_store') || $this->apcNotAvailable();
39 39
 
40 40
         try {
41
-            return apc_store(self::$namespace . "-" . $name, $data);
42
-        } catch
43
-        (\Exception $exception) {
41
+            return apc_store(self::$namespace."-".$name, $data);
42
+        } catch (\Exception $exception) {
44 43
             return false;
45 44
         }
46 45
     }
@@ -65,7 +64,7 @@  discard block
 block discarded – undo
65 64
         function_exists('apc_fetch') || $this->apcNotAvailable();
66 65
 
67 66
         try {
68
-            return apc_fetch(self::$namespace . "-" . $name);
67
+            return apc_fetch(self::$namespace."-".$name);
69 68
         } catch (\Exception $exception) {
70 69
             if (!$ignoreErrors) {
71 70
                 throw $exception;
@@ -89,7 +88,7 @@  discard block
 block discarded – undo
89 88
         function_exists('apc_delete') || $this->apcNotAvailable();
90 89
 
91 90
         try {
92
-            apc_delete(self::$namespace . "-" . $name);
91
+            apc_delete(self::$namespace."-".$name);
93 92
         } catch (\Exception $exception) {
94 93
             if (!$ignoreErrors) {
95 94
                 throw $exception;
@@ -108,7 +107,7 @@  discard block
 block discarded – undo
108 107
     public function isCached($name)
109 108
     {
110 109
         function_exists('apc_exists') || $this->apcNotAvailable();
111
-        return apc_exists(self::$namespace . "-" . $name);
110
+        return apc_exists(self::$namespace."-".$name);
112 111
     }
113 112
 
114 113
 }
115 114
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/Util.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             }
40 40
             return false;
41 41
         }
42
-        return !(boolean)strpos('|bool|boolean|int|float|string|', $type);
42
+        return !(boolean) strpos('|bool|boolean|int|float|string|', $type);
43 43
     }
44 44
 
45 45
     /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         if (strlen($resourcePath) > 0) {
103 103
             $resourcePath .= '/';
104 104
         }
105
-        return $prefix . $resourcePath;
105
+        return $prefix.$resourcePath;
106 106
     }
107 107
 
108 108
     /**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                 $key = strtolower(trim($part[0]));
234 234
                 $parameters[$key] = trim($part[1], ' "');
235 235
             }
236
-            $quality = isset($parameters['q']) ? (float)$parameters['q'] : (1000 - $pos) / 1000;
236
+            $quality = isset($parameters['q']) ? (float) $parameters['q'] : (1000 - $pos) / 1000;
237 237
             $acceptList[$type] = $quality;
238 238
         }
239 239
         arsort($acceptList);
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,14 +177,14 @@
 block discarded – undo
177 177
 					break;
178 178
 				case 1 :
179 179
 					if ($addNewline) {
180
-						$line = ' ' . $line;
180
+						$line = ' '.$line;
181 181
 					}
182 182
 					$longDescription[] = $line;
183 183
 					break;
184 184
 				case 2 :
185 185
 					$newParam
186 186
 						? $params[] = $line
187
-						: $params[count($params) - 1] .= ' ' . $line;
187
+						: $params[count($params) - 1] .= ' '.$line;
188 188
 			}
189 189
 			$addNewline = false;
190 190
 		}
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/UI/Tags.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
                 if ($child instanceof $this) {
104 104
                     $child->prefix = $prefix;
105 105
                     $child->indent = $this->indent;
106
-                    $children .= PHP_EOL . $child;
106
+                    $children .= PHP_EOL.$child;
107 107
                     $lineBreak = true;
108 108
                 } else {
109 109
                     $children .= $child;
110 110
                 }
111 111
             }
112 112
             if ($lineBreak)
113
-                $children .= PHP_EOL . $this->prefix;
113
+                $children .= PHP_EOL.$this->prefix;
114 114
         } else {
115 115
             $children = implode('', $this->children);
116 116
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         }
208 208
         $this->attributes[$attribute] = is_bool($value)
209 209
             ? ($value ? 'true' : 'false')
210
-            : @(string)$value;
210
+            : @(string) $value;
211 211
         return $this;
212 212
     }
213 213
 
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/UI/Nav.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             $restler = Scope::get('Restler');
60 60
             if (static::$addExtension)
61 61
                 static::$extension = isset($restler->responseFormat)
62
-                    ? '.' . $restler->responseFormat->getExtension()
62
+                    ? '.'.$restler->responseFormat->getExtension()
63 63
                     : '.html';
64 64
             static::$url = $restler->getBaseUrl();
65 65
             if (empty(static::$url))
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 : $activeTrail;
73 73
             if (static::$addExtension)
74 74
                 static::$extension = isset($restler->responseFormat)
75
-                    ? '.' . $restler->responseFormat->getExtension()
75
+                    ? '.'.$restler->responseFormat->getExtension()
76 76
                     : '.html';
77 77
             static::addUrls(static::$prepends);
78 78
             $map = Routes::findAll(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 $label = Text::title(static::$root);
184 184
                 $url = static::$url;
185 185
             } else {
186
-                $url = static::$url . '/' . ltrim($url, '/');
186
+                $url = static::$url.'/'.ltrim($url, '/');
187 187
             }
188 188
         }
189 189
         if (is_null($label)) {
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/UI/Forms.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             $info = false;
136 136
         }
137 137
         if (!$info) {
138
-            throw new RestException(500, 'invalid action path for form `' . $method . ' ' . $action . '`');
138
+            throw new RestException(500, 'invalid action path for form `'.$method.' '.$action.'`');
139 139
         }
140 140
         static::$info = $info;
141 141
         $m = $info->metadata;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             if (empty(Defaults::$httpMethodOverrideProperty)) {
145 145
                 throw new RestException(
146 146
                     500,
147
-                    'Forms require `Defaults::\$httpMethodOverrideProperty`' .
147
+                    'Forms require `Defaults::\$httpMethodOverrideProperty`'.
148 148
                     "for supporting HTTP $method"
149 149
                 );
150 150
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         }
196 196
         $r[] = $s;
197 197
         $t = array(
198
-            'action' => $restler->getBaseUrl() . '/' . rtrim($action, '/'),
198
+            'action' => $restler->getBaseUrl().'/'.rtrim($action, '/'),
199 199
             'method' => $method,
200 200
         );
201 201
         if (static::$fileUpload) {
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
         if (isset($metadata[CommentParser::$embeddedDataName][$name])) {
222 222
             return $metadata[CommentParser::$embeddedDataName][$name];
223 223
         }
224
-        $style = static::$style . '::' . $name;
225
-        $typedStyle = $style . '_' . $type;
224
+        $style = static::$style.'::'.$name;
225
+        $typedStyle = $style.'_'.$type;
226 226
         if (defined($typedStyle)) {
227 227
             return constant($typedStyle);
228 228
         }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                     if ($vc->from == 'path') {
267 267
                         continue;
268 268
                     }
269
-                    $vc->name = $v->name . '[' . $vc->name . ']';
269
+                    $vc->name = $v->name.'['.$vc->name.']';
270 270
                     $t [] = static::field($vc, $dataOnly);
271 271
                 }
272 272
                 $r[] = $t;
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         }
436 436
         $target = "$method $action";
437 437
         if (empty(static::$key[$target])) {
438
-            static::$key[$target] = md5($target . User::getIpAddress() . uniqid(mt_rand()));
438
+            static::$key[$target] = md5($target.User::getIpAddress().uniqid(mt_rand()));
439 439
         }
440 440
         $_SESSION[static::FORM_KEY] = static::$key;
441 441
         return static::$key[$target];
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         if (!empty($_POST) && $check) {
474 474
             if (
475 475
                 isset($_POST[static::FORM_KEY]) &&
476
-                ($target = Util::getRequestMethod() . ' ' . $restler->url) &&
476
+                ($target = Util::getRequestMethod().' '.$restler->url) &&
477 477
                 isset($_SESSION[static::FORM_KEY][$target]) &&
478 478
                 $_POST[static::FORM_KEY] == $_SESSION[static::FORM_KEY][$target]
479 479
             ) {
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/UI/Emmet.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             return array();
30 30
 
31 31
         $implicitTag =
32
-            function () use (& $tag) {
32
+            function() use (& $tag) {
33 33
                 if (empty($tag->tag)) {
34 34
                     switch ($tag->parent->tag) {
35 35
                         case 'ul':
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             };
60 60
 
61 61
         $parseText =
62
-            function (
62
+            function(
63 63
                 $text, $round, $total, $data, $delimiter = null
64 64
             )
65 65
             use (
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                                 }
107 107
                             }
108 108
                             if (is_numeric($data)) {
109
-                                $text .= sprintf("%0{$digits}d", (int)$data);
109
+                                $text .= sprintf("%0{$digits}d", (int) $data);
110 110
                             } elseif (is_string($data)) {
111 111
                                 $text .= $data;
112 112
                             }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             };
133 133
 
134 134
         $parseAttributes =
135
-            function (Callable $self, $round, $total, $data)
135
+            function(Callable $self, $round, $total, $data)
136 136
             use (& $tokens, & $tag, $parseText) {
137 137
                 $a = $parseText(
138 138
                     '', $round, $total, $data
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $parent = $root = new T;
174 174
 
175 175
         $parse =
176
-            function (
176
+            function(
177 177
                 Callable $self, $round = 1, $total = 1
178 178
             )
179 179
             use (
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                                 if (is_string($times)) {
296 296
                                     if (!isset($delimiter[$times])) {
297 297
                                         $data = Util::nestedValue($data, $times)
298
-                                            ? : $data;
298
+                                            ?: $data;
299 299
                                     } else {
300 300
                                         array_unshift($tokens, $times);
301 301
                                         $removeCount = 1;
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                                 $data = is_array($sourceData)
331 331
                                 && isset($sourceData[$i - 1])
332 332
                                     ? $sourceData[$i - 1]
333
-                                    : @(string)$sourceData;
333
+                                    : @(string) $sourceData;
334 334
                                 $tokens = array_values($remainingTokens);
335 335
                                 $self($self, $i, $times);
336 336
                             }
Please login to merge, or discard this patch.
htdocs/includes/restler/framework/Luracast/Restler/Filter/RateLimit.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function __setAuthenticationStatus($isAuthenticated = false)
86 86
     {
87
-        header('X-Auth-Status: ' . ($isAuthenticated ? 'true' : 'false'));
87
+        header('X-Auth-Status: '.($isAuthenticated ? 'true' : 'false'));
88 88
         $this->check($isAuthenticated);
89 89
     }
90 90
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         if (!isset(static::$units[$unit]))
94 94
             throw new \InvalidArgumentException(
95 95
                 'Rate Limit time unit should be '
96
-                . implode('|', array_keys(static::$units)) . '.'
96
+                . implode('|', array_keys(static::$units)).'.'
97 97
             );
98 98
     }
99 99
 
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
             if (!method_exists($user, 'getUniqueIdentifier')) {
118 118
                 throw new \UnexpectedValueException('`Defaults::$userIdentifierClass` must implement `iIdentifyUser` interface');
119 119
             }
120
-            $id = "RateLimit_" . $maxPerUnit . '_per_' . static::$unit
121
-                . '_for_' . static::$group
122
-                . '_' . $user::getUniqueIdentifier();
120
+            $id = "RateLimit_".$maxPerUnit.'_per_'.static::$unit
121
+                . '_for_'.static::$group
122
+                . '_'.$user::getUniqueIdentifier();
123 123
             $lastRequest = $this->restler->cache->get($id, true)
124
-                ? : array('time' => 0, 'used' => 0);
124
+                ?: array('time' => 0, 'used' => 0);
125 125
             $time = $lastRequest['time'];
126 126
             $diff = time() - $time; # in seconds
127 127
             $used = $lastRequest['used'];
128 128
 
129
-            header("X-RateLimit-Limit: $maxPerUnit per " . static::$unit);
129
+            header("X-RateLimit-Limit: $maxPerUnit per ".static::$unit);
130 130
             if ($diff >= $timeUnit) {
131 131
                 $used = 1;
132 132
                 $time = time();
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
                 $wait = $timeUnit - $diff;
136 136
                 sleep(1);
137 137
                 throw new RestException(429,
138
-                    'Rate limit of ' . $maxPerUnit . ' request' .
139
-                    ($maxPerUnit > 1 ? 's' : '') . ' per '
140
-                    . static::$unit . ' exceeded. Please wait for '
141
-                    . static::duration($wait) . '.'
138
+                    'Rate limit of '.$maxPerUnit.' request'.
139
+                    ($maxPerUnit > 1 ? 's' : '').' per '
140
+                    . static::$unit.' exceeded. Please wait for '
141
+                    . static::duration($wait).'.'
142 142
                 );
143 143
             } else {
144 144
                 $used++;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     private function duration($secs)
155 155
     {
156 156
         $units = array(
157
-            'week' => (int)($secs / 86400 / 7),
157
+            'week' => (int) ($secs / 86400 / 7),
158 158
             'day' => $secs / 86400 % 7,
159 159
             'hour' => $secs / 3600 % 24,
160 160
             'minute' => $secs / 60 % 60,
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
         $i = count($ret) - 1;
173 173
         if ($i) {
174
-            $ret[$i] = 'and ' . $ret[$i];
174
+            $ret[$i] = 'and '.$ret[$i];
175 175
         }
176 176
         return implode(' ', $ret); //." $unit.";
177 177
     }
Please login to merge, or discard this patch.