Passed
Push — release-2.1 ( b7b9b9...450da8 )
by Mathias
07:12
created
Sources/Class-Punycode.php 1 patch
Braces   +71 added lines, -31 removed lines patch added patch discarded remove patch
@@ -94,7 +94,8 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $input = mb_strtolower($input, $this->encoding);
96 96
         $parts = explode('.', $input);
97
-        foreach ($parts as &$part) {
97
+        foreach ($parts as &$part)
98
+        {
98 99
             $part = $this->encodePart($part);
99 100
         }
100 101
         $output = implode('.', $parts);
@@ -119,13 +120,16 @@  discard block
 block discarded – undo
119 120
         $h = $b = count($codePoints['basic']);
120 121
 
121 122
         $output = '';
122
-        foreach ($codePoints['basic'] as $code) {
123
+        foreach ($codePoints['basic'] as $code)
124
+        {
123 125
             $output .= $this->codePointToChar($code);
124 126
         }
125
-        if ($input === $output) {
127
+        if ($input === $output)
128
+        {
126 129
             return $output;
127 130
         }
128
-        if ($b > 0) {
131
+        if ($b > 0)
132
+        {
129 133
             $output .= static::DELIMITER;
130 134
         }
131 135
 
@@ -134,20 +138,26 @@  discard block
 block discarded – undo
134 138
 
135 139
         $i = 0;
136 140
         $length = mb_strlen($input, $this->encoding);
137
-        while ($h < $length) {
141
+        while ($h < $length)
142
+        {
138 143
             $m = $codePoints['nonBasic'][$i++];
139 144
             $delta = $delta + ($m - $n) * ($h + 1);
140 145
             $n = $m;
141 146
 
142
-            foreach ($codePoints['all'] as $c) {
143
-                if ($c < $n || $c < static::INITIAL_N) {
147
+            foreach ($codePoints['all'] as $c)
148
+            {
149
+                if ($c < $n || $c < static::INITIAL_N)
150
+                {
144 151
                     $delta++;
145 152
                 }
146
-                if ($c === $n) {
153
+                if ($c === $n)
154
+                {
147 155
                     $q = $delta;
148
-                    for ($k = static::BASE;; $k += static::BASE) {
156
+                    for ($k = static::BASE;; $k += static::BASE)
157
+                    {
149 158
                         $t = $this->calculateThreshold($k, $bias);
150
-                        if ($q < $t) {
159
+                        if ($q < $t)
160
+                        {
151 161
                             break;
152 162
                         }
153 163
 
@@ -182,8 +192,10 @@  discard block
 block discarded – undo
182 192
     {
183 193
         $input = strtolower($input);
184 194
         $parts = explode('.', $input);
185
-        foreach ($parts as &$part) {
186
-            if (strpos($part, static::PREFIX) !== 0) {
195
+        foreach ($parts as &$part)
196
+        {
197
+            if (strpos($part, static::PREFIX) !== 0)
198
+            {
187 199
                 continue;
188 200
             }
189 201
 
@@ -209,24 +221,30 @@  discard block
 block discarded – undo
209 221
         $output = '';
210 222
 
211 223
         $pos = strrpos($input, static::DELIMITER);
212
-        if ($pos !== false) {
224
+        if ($pos !== false)
225
+        {
213 226
             $output = substr($input, 0, $pos++);
214
-        } else {
227
+        }
228
+        else
229
+        {
215 230
             $pos = 0;
216 231
         }
217 232
 
218 233
         $outputLength = strlen($output);
219 234
         $inputLength = strlen($input);
220
-        while ($pos < $inputLength) {
235
+        while ($pos < $inputLength)
236
+        {
221 237
             $oldi = $i;
222 238
             $w = 1;
223 239
 
224
-            for ($k = static::BASE;; $k += static::BASE) {
240
+            for ($k = static::BASE;; $k += static::BASE)
241
+            {
225 242
                 $digit = static::$decodeTable[$input[$pos++]];
226 243
                 $i = $i + ($digit * $w);
227 244
                 $t = $this->calculateThreshold($k, $bias);
228 245
 
229
-                if ($digit < $t) {
246
+                if ($digit < $t)
247
+                {
230 248
                     break;
231 249
                 }
232 250
 
@@ -253,9 +271,12 @@  discard block
 block discarded – undo
253 271
      */
254 272
     protected function calculateThreshold($k, $bias)
255 273
     {
256
-        if ($k <= $bias + static::TMIN) {
274
+        if ($k <= $bias + static::TMIN)
275
+        {
257 276
             return static::TMIN;
258
-        } elseif ($k >= $bias + static::TMAX) {
277
+        }
278
+        elseif ($k >= $bias + static::TMAX)
279
+        {
259 280
             return static::TMAX;
260 281
         }
261 282
         return $k - $bias;
@@ -279,7 +300,8 @@  discard block
 block discarded – undo
279 300
         $delta += (int) ($delta / $numPoints);
280 301
 
281 302
         $k = 0;
282
-        while ($delta > ((static::BASE - static::TMIN) * static::TMAX) / 2) {
303
+        while ($delta > ((static::BASE - static::TMIN) * static::TMAX) / 2)
304
+        {
283 305
             $delta = (int) ($delta / (static::BASE - static::TMIN));
284 306
             $k = $k + static::BASE;
285 307
         }
@@ -303,12 +325,16 @@  discard block
 block discarded – undo
303 325
         );
304 326
 
305 327
         $length = mb_strlen($input, $this->encoding);
306
-        for ($i = 0; $i < $length; $i++) {
328
+        for ($i = 0; $i < $length; $i++)
329
+        {
307 330
             $char = mb_substr($input, $i, 1, $this->encoding);
308 331
             $code = $this->charToCodePoint($char);
309
-            if ($code < 128) {
332
+            if ($code < 128)
333
+            {
310 334
                 $codePoints['all'][] = $codePoints['basic'][] = $code;
311
-            } else {
335
+            }
336
+            else
337
+            {
312 338
                 $codePoints['all'][] = $codePoints['nonBasic'][] = $code;
313 339
             }
314 340
         }
@@ -325,13 +351,20 @@  discard block
 block discarded – undo
325 351
     protected function charToCodePoint($char)
326 352
     {
327 353
         $code = ord($char[0]);
328
-        if ($code < 128) {
354
+        if ($code < 128)
355
+        {
329 356
             return $code;
330
-        } elseif ($code < 224) {
357
+        }
358
+        elseif ($code < 224)
359
+        {
331 360
             return (($code - 192) * 64) + (ord($char[1]) - 128);
332
-        } elseif ($code < 240) {
361
+        }
362
+        elseif ($code < 240)
363
+        {
333 364
             return (($code - 224) * 4096) + ((ord($char[1]) - 128) * 64) + (ord($char[2]) - 128);
334
-        } else {
365
+        }
366
+        else
367
+        {
335 368
             return (($code - 240) * 262144) + ((ord($char[1]) - 128) * 4096) + ((ord($char[2]) - 128) * 64) + (ord($char[3]) - 128);
336 369
         }
337 370
     }
@@ -344,13 +377,20 @@  discard block
 block discarded – undo
344 377
      */
345 378
     protected function codePointToChar($code)
346 379
     {
347
-        if ($code <= 0x7F) {
380
+        if ($code <= 0x7F)
381
+        {
348 382
             return chr($code);
349
-        } elseif ($code <= 0x7FF) {
383
+        }
384
+        elseif ($code <= 0x7FF)
385
+        {
350 386
             return chr(($code >> 6) + 192) . chr(($code & 63) + 128);
351
-        } elseif ($code <= 0xFFFF) {
387
+        }
388
+        elseif ($code <= 0xFFFF)
389
+        {
352 390
             return chr(($code >> 12) + 224) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128);
353
-        } else {
391
+        }
392
+        else
393
+        {
354 394
             return chr(($code >> 18) + 240) . chr((($code >> 12) & 63) + 128) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128);
355 395
         }
356 396
     }
Please login to merge, or discard this patch.
Themes/default/Calendar.template.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -425,7 +425,8 @@  discard block
 block discarded – undo
425 425
 					if (!empty($day['events']))
426 426
 					{
427 427
 						// Sort events by start time (all day events will be listed first)
428
-						uasort($day['events'], function($a, $b) {
428
+						uasort($day['events'], function($a, $b)
429
+						{
429 430
 							if ($a['start_timestamp'] == $b['start_timestamp'])
430 431
 								return 0;
431 432
 
@@ -619,7 +620,8 @@  discard block
 block discarded – undo
619 620
 			if (!empty($day['events']))
620 621
 			{
621 622
 				// Sort events by start time (all day events will be listed first)
622
-				uasort($day['events'], function($a, $b) {
623
+				uasort($day['events'], function($a, $b)
624
+				{
623 625
 					if ($a['start_timestamp'] == $b['start_timestamp'])
624 626
 						return 0;
625 627
 					return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
Please login to merge, or discard this patch.
ssi_examples.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,9 @@
 block discarded – undo
89 89
 						<li><a href="#" onclick="showSSIBlock('ssi_quickSearch'); return false;">Quick Search Box</a></li>
90 90
 						<li><a href="#" onclick="showSSIBlock('ssi_recentAttachments'); return false;">Recent Attachments</a></li>
91 91
 					</ul>
92
-					<?php if ($user_info['is_admin']) { ?>
92
+					<?php if ($user_info['is_admin'])
93
+{
94
+?>
93 95
 					<h3>Advanced Functions <img class="help" title="Functions that require additional tweaking, not just copy and paste." src="<?php echo $settings['images_url']; ?>/helptopics.png" alt=""></h3>
94 96
 					<ul>
95 97
 						<li><a href="#" onclick="showSSIBlock('ssi_showPoll'); return false;">Show Single Poll</a></li>
Please login to merge, or discard this patch.