@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | // number of points in the polygon |
30 | 30 | $n = count($polygon); |
31 | 31 | $poly1 = $polygon[0]; |
32 | - for ($i = 1; $i <= $n; $i ++) { |
|
32 | + for ($i = 1; $i <= $n; $i++) { |
|
33 | 33 | $poly1XY = explode(' ', $poly1); |
34 | 34 | $poly1x = $poly1XY[0]; |
35 | 35 | $poly1y = $poly1XY[1]; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | if ($poly1y != $poly2y) { |
45 | 45 | $xinters = ($py - $poly1y) * ($poly2x - $poly1x) / ($poly2y - $poly1y) + $poly1x; |
46 | 46 | if ($poly1x == $poly2x || $px <= $xinters) { |
47 | - $counter ++; |
|
47 | + $counter++; |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | } |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | if (!$newcoord) { |
522 | 522 | $newcoord = $coords[$coordpos]; |
523 | 523 | } |
524 | - ++ $coordpos; |
|
524 | + ++$coordpos; |
|
525 | 525 | } |
526 | 526 | if ($newcoord) { |
527 | 527 | $distance = geomath::calcDistance( |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $original = count($coords) - 1; |
555 | 555 | $lastlogdate = $logs[count($logs) - 1]['order_date']; |
556 | 556 | while ($original > 0 && $coords[$original - 1]['date'] < $lastlogdate) { |
557 | - -- $original; |
|
557 | + --$original; |
|
558 | 558 | } |
559 | 559 | $coord = new coordinate($coords[$original]['latitude'], $coords[$original]['longitude']); |
560 | 560 | $logs[] = [ |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | $logTypes[$i]['selected'] = ($logtype == $defaultLogType) ? true : false; |
956 | 956 | $logTypes[$i]['name'] = $logtypeNames[$logtype]; |
957 | 957 | $logTypes[$i]['id'] = $logtype; |
958 | - $i ++; |
|
958 | + $i++; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | // return |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | // min. 4 different chars |
36 | 36 | $chars = array(); |
37 | - for ($i = 0; $i < mb_strlen($pw); $i ++) { |
|
37 | + for ($i = 0; $i < mb_strlen($pw); $i++) { |
|
38 | 38 | $chars[mb_substr($pw, $i, 1)] = true; |
39 | 39 | } |
40 | 40 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'description' => $item->description |
67 | 67 | ); |
68 | 68 | // increment counter |
69 | - $i ++; |
|
69 | + $i++; |
|
70 | 70 | // htmlspecialchars_decode() works around inconsistent HTML encoding |
71 | 71 | // e.g. in SMF Forum Threads |
72 | 72 | } elseif (!in_array(htmlspecialchars_decode($item->title), $headlines) && |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | $headlines[] = "" . htmlspecialchars_decode($item->title); |
82 | 82 | // increment counter |
83 | - $i ++; |
|
83 | + $i++; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function t($message, $style, $resource_name, $line, $plural = '', $count = 1, $lang = null) |
34 | 34 | { |
35 | - global $opt, $locale; // $locale is for lib1 compatibility |
|
35 | + global $opt, $locale; // $locale is for lib1 compatibility |
|
36 | 36 | |
37 | 37 | if ($message == '') { |
38 | 38 | return ''; |
@@ -159,10 +159,10 @@ |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
162 | - * @param $message |
|
163 | - * @param $style |
|
164 | - * @param $resource_name |
|
165 | - * @param $line |
|
162 | + * @param string $message |
|
163 | + * @param string $style |
|
164 | + * @param string $resource_name |
|
165 | + * @param string $line |
|
166 | 166 | * @param string $plural |
167 | 167 | * @param int $count |
168 | 168 | * @param null $lang |
@@ -2273,38 +2273,38 @@ discard block |
||
2273 | 2273 | |
2274 | 2274 | foreach ($option as $k => $v) { |
2275 | 2275 | switch ($k) { |
2276 | - case 'encoding': |
|
2277 | - switch ($v) { |
|
2278 | - case 'utf8': |
|
2279 | - case 'ucs4_string': |
|
2280 | - case 'ucs4_array': |
|
2281 | - $this->_api_encoding = $v; |
|
2282 | - break; |
|
2276 | + case 'encoding': |
|
2277 | + switch ($v) { |
|
2278 | + case 'utf8': |
|
2279 | + case 'ucs4_string': |
|
2280 | + case 'ucs4_array': |
|
2281 | + $this->_api_encoding = $v; |
|
2282 | + break; |
|
2283 | 2283 | |
2284 | - default: |
|
2285 | - throw new InvalidArgumentException('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
2286 | - } |
|
2284 | + default: |
|
2285 | + throw new InvalidArgumentException('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
2286 | + } |
|
2287 | 2287 | |
2288 | 2288 | break; |
2289 | 2289 | |
2290 | - case 'overlong': |
|
2291 | - $this->_allow_overlong = ($v) ? true : false; |
|
2292 | - break; |
|
2290 | + case 'overlong': |
|
2291 | + $this->_allow_overlong = ($v) ? true : false; |
|
2292 | + break; |
|
2293 | 2293 | |
2294 | - case 'strict': |
|
2295 | - $this->_strict_mode = ($v) ? true : false; |
|
2296 | - break; |
|
2294 | + case 'strict': |
|
2295 | + $this->_strict_mode = ($v) ? true : false; |
|
2296 | + break; |
|
2297 | 2297 | |
2298 | - case 'version': |
|
2299 | - if (in_array($v, array('2003', '2008'))) { |
|
2300 | - $this->_version = $v; |
|
2301 | - } else { |
|
2302 | - throw new InvalidArgumentException('Set Parameter: Invalid parameter '.$v.' for option '.$k); |
|
2303 | - } |
|
2304 | - break; |
|
2298 | + case 'version': |
|
2299 | + if (in_array($v, array('2003', '2008'))) { |
|
2300 | + $this->_version = $v; |
|
2301 | + } else { |
|
2302 | + throw new InvalidArgumentException('Set Parameter: Invalid parameter '.$v.' for option '.$k); |
|
2303 | + } |
|
2304 | + break; |
|
2305 | 2305 | |
2306 | - default: |
|
2307 | - return false; |
|
2306 | + default: |
|
2307 | + return false; |
|
2308 | 2308 | } |
2309 | 2309 | } |
2310 | 2310 | |
@@ -2328,15 +2328,15 @@ discard block |
||
2328 | 2328 | // Forcing conversion of input to UCS4 array |
2329 | 2329 | // If one time encoding is given, use this, else the objects property |
2330 | 2330 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
2331 | - case 'utf8': |
|
2332 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
2333 | - break; |
|
2334 | - case 'ucs4_string': |
|
2335 | - $decoded = $this->_ucs4_string_to_ucs4($decoded); |
|
2336 | - case 'ucs4_array': // No break; before this line. Catch case, but do nothing |
|
2337 | - break; |
|
2338 | - default: |
|
2339 | - throw new InvalidArgumentException('Unsupported input format'); |
|
2331 | + case 'utf8': |
|
2332 | + $decoded = $this->_utf8_to_ucs4($decoded); |
|
2333 | + break; |
|
2334 | + case 'ucs4_string': |
|
2335 | + $decoded = $this->_ucs4_string_to_ucs4($decoded); |
|
2336 | + case 'ucs4_array': // No break; before this line. Catch case, but do nothing |
|
2337 | + break; |
|
2338 | + default: |
|
2339 | + throw new InvalidArgumentException('Unsupported input format'); |
|
2340 | 2340 | } |
2341 | 2341 | |
2342 | 2342 | // No input, no output, what else did you expect? |
@@ -2350,35 +2350,35 @@ discard block |
||
2350 | 2350 | foreach ($decoded as $k => $v) { |
2351 | 2351 | // Make sure to use just the plain dot |
2352 | 2352 | switch($v) { |
2353 | - case 0x3002: |
|
2354 | - case 0xFF0E: |
|
2355 | - case 0xFF61: |
|
2356 | - $decoded[$k] = 0x2E; |
|
2357 | - // It's right, no break here |
|
2358 | - // The codepoints above have to be converted to dots anyway |
|
2359 | - |
|
2360 | - // Stumbling across an anchoring character |
|
2361 | - case 0x2E: |
|
2362 | - case 0x2F: |
|
2363 | - case 0x3A: |
|
2364 | - case 0x3F: |
|
2365 | - case 0x40: |
|
2366 | - // Neither email addresses nor URLs allowed in strict mode |
|
2367 | - if ($this->_strict_mode) { |
|
2368 | - throw new InvalidArgumentException('Neither email addresses nor URLs are allowed in strict mode.'); |
|
2369 | - } |
|
2370 | - // Skip first char |
|
2371 | - if ($k) { |
|
2372 | - $encoded = ''; |
|
2373 | - $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2374 | - if ($encoded) { |
|
2375 | - $output .= $encoded; |
|
2376 | - } else { |
|
2377 | - $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2353 | + case 0x3002: |
|
2354 | + case 0xFF0E: |
|
2355 | + case 0xFF61: |
|
2356 | + $decoded[$k] = 0x2E; |
|
2357 | + // It's right, no break here |
|
2358 | + // The codepoints above have to be converted to dots anyway |
|
2359 | + |
|
2360 | + // Stumbling across an anchoring character |
|
2361 | + case 0x2E: |
|
2362 | + case 0x2F: |
|
2363 | + case 0x3A: |
|
2364 | + case 0x3F: |
|
2365 | + case 0x40: |
|
2366 | + // Neither email addresses nor URLs allowed in strict mode |
|
2367 | + if ($this->_strict_mode) { |
|
2368 | + throw new InvalidArgumentException('Neither email addresses nor URLs are allowed in strict mode.'); |
|
2378 | 2369 | } |
2379 | - $output .= chr($decoded[$k]); |
|
2380 | - } |
|
2381 | - $last_begin = $k + 1; |
|
2370 | + // Skip first char |
|
2371 | + if ($k) { |
|
2372 | + $encoded = ''; |
|
2373 | + $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2374 | + if ($encoded) { |
|
2375 | + $output .= $encoded; |
|
2376 | + } else { |
|
2377 | + $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2378 | + } |
|
2379 | + $output .= chr($decoded[$k]); |
|
2380 | + } |
|
2381 | + $last_begin = $k + 1; |
|
2382 | 2382 | } |
2383 | 2383 | } |
2384 | 2384 | // Catch the rest of the string |
@@ -2416,12 +2416,12 @@ discard block |
||
2416 | 2416 | // Optionally set |
2417 | 2417 | if ($one_time_encoding) { |
2418 | 2418 | switch ($one_time_encoding) { |
2419 | - case 'utf8': |
|
2420 | - case 'ucs4_string': |
|
2421 | - case 'ucs4_array': |
|
2422 | - break; |
|
2423 | - default: |
|
2424 | - throw new InvalidArgumentException('Unknown encoding '.$one_time_encoding); |
|
2419 | + case 'utf8': |
|
2420 | + case 'ucs4_string': |
|
2421 | + case 'ucs4_array': |
|
2422 | + break; |
|
2423 | + default: |
|
2424 | + throw new InvalidArgumentException('Unknown encoding '.$one_time_encoding); |
|
2425 | 2425 | } |
2426 | 2426 | } |
2427 | 2427 | // Make sure to drop any newline characters around |
@@ -2473,17 +2473,17 @@ discard block |
||
2473 | 2473 | // The output is UTF-8 by default, other output formats need conversion here |
2474 | 2474 | // If one time encoding is given, use this, else the objects property |
2475 | 2475 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
2476 | - case 'utf8': |
|
2477 | - return $return; |
|
2478 | - break; |
|
2479 | - case 'ucs4_string': |
|
2480 | - return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); |
|
2481 | - break; |
|
2482 | - case 'ucs4_array': |
|
2483 | - return $this->_utf8_to_ucs4($return); |
|
2484 | - break; |
|
2485 | - default: |
|
2486 | - throw new InvalidArgumentException('Unsupported output format'); |
|
2476 | + case 'utf8': |
|
2477 | + return $return; |
|
2478 | + break; |
|
2479 | + case 'ucs4_string': |
|
2480 | + return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); |
|
2481 | + break; |
|
2482 | + case 'ucs4_array': |
|
2483 | + return $this->_utf8_to_ucs4($return); |
|
2484 | + break; |
|
2485 | + default: |
|
2486 | + throw new InvalidArgumentException('Unsupported output format'); |
|
2487 | 2487 | } |
2488 | 2488 | } |
2489 | 2489 |
@@ -272,16 +272,16 @@ discard block |
||
272 | 272 | * @access private |
273 | 273 | */ |
274 | 274 | private static $_np_prohibit_ranges = array( |
275 | - array(0x80, 0x9F ), |
|
276 | - array(0x2060, 0x206F ), |
|
277 | - array(0x1D173, 0x1D17A ), |
|
278 | - array(0xE000, 0xF8FF ), |
|
279 | - array(0xF0000, 0xFFFFD ), |
|
275 | + array(0x80, 0x9F), |
|
276 | + array(0x2060, 0x206F), |
|
277 | + array(0x1D173, 0x1D17A), |
|
278 | + array(0xE000, 0xF8FF), |
|
279 | + array(0xF0000, 0xFFFFD), |
|
280 | 280 | array(0x100000, 0x10FFFD), |
281 | - array(0xFDD0, 0xFDEF ), |
|
282 | - array(0xD800, 0xDFFF ), |
|
283 | - array(0x2FF0, 0x2FFB ), |
|
284 | - array(0xE0020, 0xE007F ) |
|
281 | + array(0xFDD0, 0xFDEF), |
|
282 | + array(0xD800, 0xDFFF), |
|
283 | + array(0x2FF0, 0x2FFB), |
|
284 | + array(0xE0020, 0xE007F) |
|
285 | 285 | ); |
286 | 286 | |
287 | 287 | /** |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | break; |
2283 | 2283 | |
2284 | 2284 | default: |
2285 | - throw new InvalidArgumentException('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
2285 | + throw new InvalidArgumentException('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
2286 | 2286 | } |
2287 | 2287 | |
2288 | 2288 | break; |
@@ -2299,7 +2299,7 @@ discard block |
||
2299 | 2299 | if (in_array($v, array('2003', '2008'))) { |
2300 | 2300 | $this->_version = $v; |
2301 | 2301 | } else { |
2302 | - throw new InvalidArgumentException('Set Parameter: Invalid parameter '.$v.' for option '.$k); |
|
2302 | + throw new InvalidArgumentException('Set Parameter: Invalid parameter ' . $v . ' for option ' . $k); |
|
2303 | 2303 | } |
2304 | 2304 | break; |
2305 | 2305 | |
@@ -2328,8 +2328,7 @@ discard block |
||
2328 | 2328 | // Forcing conversion of input to UCS4 array |
2329 | 2329 | // If one time encoding is given, use this, else the objects property |
2330 | 2330 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
2331 | - case 'utf8': |
|
2332 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
2331 | + case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded); |
|
2333 | 2332 | break; |
2334 | 2333 | case 'ucs4_string': |
2335 | 2334 | $decoded = $this->_ucs4_string_to_ucs4($decoded); |
@@ -2349,7 +2348,7 @@ discard block |
||
2349 | 2348 | |
2350 | 2349 | foreach ($decoded as $k => $v) { |
2351 | 2350 | // Make sure to use just the plain dot |
2352 | - switch($v) { |
|
2351 | + switch ($v) { |
|
2353 | 2352 | case 0x3002: |
2354 | 2353 | case 0xFF0E: |
2355 | 2354 | case 0xFF61: |
@@ -2370,11 +2369,11 @@ discard block |
||
2370 | 2369 | // Skip first char |
2371 | 2370 | if ($k) { |
2372 | 2371 | $encoded = ''; |
2373 | - $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2372 | + $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k) - $last_begin))); |
|
2374 | 2373 | if ($encoded) { |
2375 | 2374 | $output .= $encoded; |
2376 | 2375 | } else { |
2377 | - $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); |
|
2376 | + $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k) - $last_begin))); |
|
2378 | 2377 | } |
2379 | 2378 | $output .= chr($decoded[$k]); |
2380 | 2379 | } |
@@ -2385,11 +2384,11 @@ discard block |
||
2385 | 2384 | if ($last_begin) { |
2386 | 2385 | $inp_len = sizeof($decoded); |
2387 | 2386 | $encoded = ''; |
2388 | - $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); |
|
2387 | + $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len) - $last_begin))); |
|
2389 | 2388 | if ($encoded) { |
2390 | 2389 | $output .= $encoded; |
2391 | 2390 | } else { |
2392 | - $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); |
|
2391 | + $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len) - $last_begin))); |
|
2393 | 2392 | } |
2394 | 2393 | return $output; |
2395 | 2394 | } |
@@ -2421,7 +2420,7 @@ discard block |
||
2421 | 2420 | case 'ucs4_array': |
2422 | 2421 | break; |
2423 | 2422 | default: |
2424 | - throw new InvalidArgumentException('Unknown encoding '.$one_time_encoding); |
|
2423 | + throw new InvalidArgumentException('Unknown encoding ' . $one_time_encoding); |
|
2425 | 2424 | } |
2426 | 2425 | } |
2427 | 2426 | // Make sure to drop any newline characters around |
@@ -2473,8 +2472,7 @@ discard block |
||
2473 | 2472 | // The output is UTF-8 by default, other output formats need conversion here |
2474 | 2473 | // If one time encoding is given, use this, else the objects property |
2475 | 2474 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
2476 | - case 'utf8': |
|
2477 | - return $return; |
|
2475 | + case 'utf8' : return $return; |
|
2478 | 2476 | break; |
2479 | 2477 | case 'ucs4_string': |
2480 | 2478 | return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); |
@@ -2629,9 +2627,8 @@ discard block |
||
2629 | 2627 | $delta++; |
2630 | 2628 | } else if ($decoded[$i] == $cur_code) { |
2631 | 2629 | for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { |
2632 | - $t = ($k <= $bias)? |
|
2633 | - $this->_tmin : |
|
2634 | - (($k >= $bias + $this->_tmax)? $this->_tmax : $k - $bias); |
|
2630 | + $t = ($k <= $bias) ? |
|
2631 | + $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
2635 | 2632 | |
2636 | 2633 | if ($q < $t) { |
2637 | 2634 | break; |
@@ -2699,14 +2696,13 @@ discard block |
||
2699 | 2696 | $idx = 0; |
2700 | 2697 | $char = $this->_initial_n; |
2701 | 2698 | |
2702 | - for ($enco_idx = ($delim_pos)? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { |
|
2703 | - for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { |
|
2699 | + for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { |
|
2700 | + for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) { |
|
2704 | 2701 | $digit = $this->_decodeDigit($encoded{$enco_idx++}); |
2705 | 2702 | $idx += $digit * $w; |
2706 | 2703 | |
2707 | 2704 | $t = ($k <= $bias) ? |
2708 | - $this->_tmin : |
|
2709 | - (($k >= $bias + $this->_tmax)? $this->_tmax : ($k - $bias)); |
|
2705 | + $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
2710 | 2706 | |
2711 | 2707 | if ($digit < $t) { |
2712 | 2708 | break; |
@@ -2717,7 +2713,7 @@ discard block |
||
2717 | 2713 | |
2718 | 2714 | $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first); |
2719 | 2715 | $is_first = false; |
2720 | - $char += (int) ($idx / ($deco_len + 1)); |
|
2716 | + $char += (int)($idx / ($deco_len + 1)); |
|
2721 | 2717 | $idx %= ($deco_len + 1); |
2722 | 2718 | |
2723 | 2719 | if ($deco_len > 0) { |
@@ -2745,14 +2741,14 @@ discard block |
||
2745 | 2741 | */ |
2746 | 2742 | private function _adapt($delta, $npoints, $is_first) |
2747 | 2743 | { |
2748 | - $delta = (int) ($is_first ? ($delta / $this->_damp) : ($delta / 2)); |
|
2749 | - $delta += (int) ($delta / $npoints); |
|
2744 | + $delta = (int)($is_first ? ($delta / $this->_damp) : ($delta / 2)); |
|
2745 | + $delta += (int)($delta / $npoints); |
|
2750 | 2746 | |
2751 | 2747 | for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) { |
2752 | - $delta = (int) ($delta / ($this->_base - $this->_tmin)); |
|
2748 | + $delta = (int)($delta / ($this->_base - $this->_tmin)); |
|
2753 | 2749 | } |
2754 | 2750 | |
2755 | - return (int) ($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew)); |
|
2751 | + return (int)($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew)); |
|
2756 | 2752 | } |
2757 | 2753 | |
2758 | 2754 | /** |
@@ -2779,7 +2775,7 @@ discard block |
||
2779 | 2775 | private function _decodeDigit($cp) |
2780 | 2776 | { |
2781 | 2777 | $cp = ord($cp); |
2782 | - return ($cp - 48 < 10)? $cp - 22 : (($cp - 65 < 26)? $cp - 65 : (($cp - 97 < 26)? $cp - 97 : $this->_base)); |
|
2778 | + return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base)); |
|
2783 | 2779 | } |
2784 | 2780 | |
2785 | 2781 | /** |
@@ -2862,7 +2858,7 @@ discard block |
||
2862 | 2858 | // Rewind the for loop by one, since there can be more possible compositions |
2863 | 2859 | $i--; |
2864 | 2860 | $out_len--; |
2865 | - $last_class = ($i == $last_starter)? 0 : $this->_getCombiningClass($output[$i - 1]); |
|
2861 | + $last_class = ($i == $last_starter) ? 0 : $this->_getCombiningClass($output[$i - 1]); |
|
2866 | 2862 | |
2867 | 2863 | continue; |
2868 | 2864 | } |
@@ -2899,7 +2895,7 @@ discard block |
||
2899 | 2895 | |
2900 | 2896 | $result = array(); |
2901 | 2897 | $T = $this->_tbase + $sindex % $this->_tcount; |
2902 | - $result[] = (int)($this->_lbase + $sindex / $this->_ncount); |
|
2898 | + $result[] = (int)($this->_lbase + $sindex / $this->_ncount); |
|
2903 | 2899 | $result[] = (int)($this->_vbase + ($sindex % $this->_ncount) / $this->_tcount); |
2904 | 2900 | |
2905 | 2901 | if ($T != $this->_tbase) { |
@@ -2985,7 +2981,7 @@ discard block |
||
2985 | 2981 | */ |
2986 | 2982 | private function _getCombiningClass($char) |
2987 | 2983 | { |
2988 | - return isset(self::$_np_norm_combcls[$char])? self::$_np_norm_combcls[$char] : 0; |
|
2984 | + return isset(self::$_np_norm_combcls[$char]) ? self::$_np_norm_combcls[$char] : 0; |
|
2989 | 2985 | } |
2990 | 2986 | |
2991 | 2987 | /** |
@@ -3119,7 +3115,7 @@ discard block |
||
3119 | 3115 | $output[$out_len] = $v; |
3120 | 3116 | ++$out_len; |
3121 | 3117 | if ('add' == $mode) { |
3122 | - throw new UnexpectedValueException('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
3118 | + throw new UnexpectedValueException('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
3123 | 3119 | } |
3124 | 3120 | continue; |
3125 | 3121 | } |
@@ -3143,10 +3139,10 @@ discard block |
||
3143 | 3139 | $next_byte = 4; |
3144 | 3140 | $v = ($v - 252) << 30; |
3145 | 3141 | } else { |
3146 | - throw new UnexpectedValueException('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
3142 | + throw new UnexpectedValueException('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
3147 | 3143 | } |
3148 | 3144 | if ('add' == $mode) { |
3149 | - $output[$out_len] = (int) $v; |
|
3145 | + $output[$out_len] = (int)$v; |
|
3150 | 3146 | ++$out_len; |
3151 | 3147 | continue; |
3152 | 3148 | } |
@@ -3155,7 +3151,7 @@ discard block |
||
3155 | 3151 | if (!$this->_allow_overlong && $test == 'range') { |
3156 | 3152 | $test = 'none'; |
3157 | 3153 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
3158 | - throw new OutOfRangeException('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
3154 | + throw new OutOfRangeException('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
3159 | 3155 | } |
3160 | 3156 | } |
3161 | 3157 | if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx |
@@ -3163,7 +3159,7 @@ discard block |
||
3163 | 3159 | $output[($out_len - 1)] += $v; |
3164 | 3160 | --$next_byte; |
3165 | 3161 | } else { |
3166 | - throw new UnexpectedValueException('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
3162 | + throw new UnexpectedValueException('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
3167 | 3163 | } |
3168 | 3164 | if ($next_byte < 0) { |
3169 | 3165 | $mode = 'next'; |
@@ -3205,14 +3201,14 @@ discard block |
||
3205 | 3201 | // 4 bytes |
3206 | 3202 | $output .= chr(240 + ($v >> 18)) |
3207 | 3203 | . chr(128 + (($v >> 12) & 63)) |
3208 | - . chr(128 + (($v >> 6) & 63)) |
|
3204 | + . chr(128 + (($v >> 6) & 63)) |
|
3209 | 3205 | . chr(128 + ($v & 63)); |
3210 | 3206 | } else if ($v < 1 << 26) { |
3211 | 3207 | // 5 bytes |
3212 | 3208 | $output .= chr(248 + ($v >> 24)) |
3213 | 3209 | . chr(128 + (($v >> 18) & 63)) |
3214 | 3210 | . chr(128 + (($v >> 12) & 63)) |
3215 | - . chr(128 + (($v >> 6) & 63)) |
|
3211 | + . chr(128 + (($v >> 6) & 63)) |
|
3216 | 3212 | . chr(128 + ($v & 63)); |
3217 | 3213 | } else if ($v < 1 << 31) { |
3218 | 3214 | // 6 bytes |
@@ -3220,7 +3216,7 @@ discard block |
||
3220 | 3216 | . chr(128 + (($v >> 24) & 63)) |
3221 | 3217 | . chr(128 + (($v >> 18) & 63)) |
3222 | 3218 | . chr(128 + (($v >> 12) & 63)) |
3223 | - . chr(128 + (($v >> 6) & 63)) |
|
3219 | + . chr(128 + (($v >> 6) & 63)) |
|
3224 | 3220 | . chr(128 + ($v & 63)); |
3225 | 3221 | } else { |
3226 | 3222 | throw new UnexpectedValueException('Conversion from UCS-4 to UTF-8 failed: malformed input'); |
@@ -3280,7 +3276,7 @@ discard block |
||
3280 | 3276 | $out_len++; |
3281 | 3277 | $output[$out_len] = 0; |
3282 | 3278 | } |
3283 | - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); |
|
3279 | + $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4))); |
|
3284 | 3280 | } |
3285 | 3281 | return $output; |
3286 | 3282 | } |
@@ -3331,7 +3327,7 @@ discard block |
||
3331 | 3327 | $return = ''; |
3332 | 3328 | |
3333 | 3329 | for ($i = $w; $i > -1; $i--) { |
3334 | - $return .= ($octet & (1 << $i))? '1' : '0'; |
|
3330 | + $return .= ($octet & (1 << $i)) ? '1' : '0'; |
|
3335 | 3331 | } |
3336 | 3332 | |
3337 | 3333 | return $return; |
@@ -112,7 +112,7 @@ |
||
112 | 112 | $errorlog_dir = $opt['rootpath'] . 'var/errorlog'; |
113 | 113 | $errorlog_path = $errorlog_dir . "/errorlog-" . date("Y-m-d"); |
114 | 114 | |
115 | - $error_mail_limit = 32768; // send max 32 KB = ca. 5-20 errors per day/logfile |
|
115 | + $error_mail_limit = 32768; // send max 32 KB = ca. 5-20 errors per day/logfile |
|
116 | 116 | |
117 | 117 | // All errors which may happen here are ignored, to avoid error recursions. |
118 | 118 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public $main_template = 'sys_main'; |
18 | 18 | public $bench = null; |
19 | 19 | public $compile_id = null; |
20 | - public $cache_id = null; // This is a smarty caching ID, not a caches.cache_id. |
|
20 | + public $cache_id = null; // This is a smarty caching ID, not a caches.cache_id. |
|
21 | 21 | public $title = ''; |
22 | 22 | public $menuitem = null; |
23 | 23 | public $nowpsearch = false; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | $args = func_get_args(); |
387 | 387 | unset($args[0]); |
388 | - for ($i = 1; isset($args[$i]); $i ++) { |
|
388 | + for ($i = 1; isset($args[$i]); $i++) { |
|
389 | 389 | $this->assign('p' . $i, $args[$i]); |
390 | 390 | } |
391 | 391 |
@@ -114,8 +114,8 @@ |
||
114 | 114 | /* ATTENTION: copied from internal implementation! |
115 | 115 | */ |
116 | 116 | /** |
117 | - * @param $resource_name |
|
118 | - * @param null $compile_id |
|
117 | + * @param string $resource_name |
|
118 | + * @param string $compile_id |
|
119 | 119 | */ |
120 | 120 | public function compile($resource_name, $compile_id = null) |
121 | 121 | { |
@@ -120,9 +120,9 @@ |
||
120 | 120 | { |
121 | 121 | $nLine = 1; |
122 | 122 | |
123 | - for ($n = 0; $n < $nPos; $n ++) { |
|
123 | + for ($n = 0; $n < $nPos; $n++) { |
|
124 | 124 | if (substr($this->msContent, $n, 1) == "\n") { |
125 | - $nLine ++; |
|
125 | + $nLine++; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * @param $sCode |
|
90 | - * @param $nStartSearch |
|
89 | + * @param string $sCode |
|
90 | + * @param integer $nStartSearch |
|
91 | 91 | * |
92 | 92 | * @return bool|int |
93 | 93 | */ |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | // TODO: performance ... scan once at __construct and store line positions |
134 | 134 | /** |
135 | - * @param $nPos |
|
135 | + * @param integer $nPos |
|
136 | 136 | * |
137 | 137 | * @return int |
138 | 138 | */ |