@@ -253,8 +253,7 @@ |
||
253 | 253 | { |
254 | 254 | $this->vars[$k] = $escape ? esc($v, $context, $this->escaper) : $v; |
255 | 255 | } |
256 | - } |
|
257 | - else |
|
256 | + } else |
|
258 | 257 | { |
259 | 258 | $this->vars[$name] = $escape ? esc($value, $context, $this->escaper) : $value; |
260 | 259 | } |
@@ -193,20 +193,17 @@ |
||
193 | 193 | if (is_bool($result)) |
194 | 194 | { |
195 | 195 | $output .= $result === true ? lang('done') ."\n" : lang('failed') ."\n"; |
196 | - } |
|
197 | - else if (is_string($result)) |
|
196 | + } else if (is_string($result)) |
|
198 | 197 | { |
199 | 198 | $output .= sprintf( lang('cron.done_with_msg'), $result); |
200 | 199 | } |
201 | - } |
|
202 | - catch (\Exception $e) |
|
200 | + } catch (\Exception $e) |
|
203 | 201 | { |
204 | 202 | $output .= "[Exception] ". $e->getMessage() ."\n"; |
205 | 203 | } |
206 | 204 | |
207 | 205 | $count++; |
208 | - } |
|
209 | - else |
|
206 | + } else |
|
210 | 207 | { |
211 | 208 | $output .= sprintf( lang('cron.not_scheduled_until'), $alias, $task->nextRunDate() ); |
212 | 209 | } |
@@ -288,8 +288,7 @@ discard block |
||
288 | 288 | if (date('Y-m-d H:i', $next) == date('Y-m-d H:i', $current_time)) |
289 | 289 | { |
290 | 290 | $return = $next; |
291 | - } |
|
292 | - else { |
|
291 | + } else { |
|
293 | 292 | $return = $next + $diff; |
294 | 293 | } |
295 | 294 | break; |
@@ -321,7 +320,9 @@ discard block |
||
321 | 320 | { |
322 | 321 | $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
323 | 322 | |
324 | - if (empty($schedule)) return null; |
|
323 | + if (empty($schedule)) { |
|
324 | + return null; |
|
325 | + } |
|
325 | 326 | |
326 | 327 | // Loop through months in reverse, checking each one to |
327 | 328 | // see if the ordinal is in the past. If so - wer'e done. |
@@ -262,7 +262,9 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function registerFormatter($callback = null, $cascade = false) |
264 | 264 | { |
265 | - if (empty($callback)) return; |
|
265 | + if (empty($callback)) { |
|
266 | + return; |
|
267 | + } |
|
266 | 268 | |
267 | 269 | $this->formatters[] = [ |
268 | 270 | 'callable' => $callback, |
@@ -282,7 +284,9 @@ discard block |
||
282 | 284 | */ |
283 | 285 | public function format($str) |
284 | 286 | { |
285 | - if (! is_array($this->formatters)) return $str; |
|
287 | + if (! is_array($this->formatters)) { |
|
288 | + return $str; |
|
289 | + } |
|
286 | 290 | |
287 | 291 | foreach ($this->formatters as $formatter) { |
288 | 292 | $method = $formatter['callable']; |
@@ -290,7 +294,9 @@ discard block |
||
290 | 294 | |
291 | 295 | $str = call_user_func($method, $str); |
292 | 296 | |
293 | - if (! $cascade) return $str; |
|
297 | + if (! $cascade) { |
|
298 | + return $str; |
|
299 | + } |
|
294 | 300 | } |
295 | 301 | |
296 | 302 | return $str; |
@@ -237,7 +237,9 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function registerFormatter($callback_name = '', $cascade = false) |
239 | 239 | { |
240 | - if (empty($callback_name)) return; |
|
240 | + if (empty($callback_name)) { |
|
241 | + return; |
|
242 | + } |
|
241 | 243 | |
242 | 244 | $this->formatters[] = array($callback_name => $cascade); |
243 | 245 | |
@@ -254,7 +256,9 @@ discard block |
||
254 | 256 | */ |
255 | 257 | public function format($str) |
256 | 258 | { |
257 | - if (! is_array($this->formatters)) return $str; |
|
259 | + if (! is_array($this->formatters)) { |
|
260 | + return $str; |
|
261 | + } |
|
258 | 262 | |
259 | 263 | foreach ($this->formatters as $formatter) { |
260 | 264 | $method = key($formatter); |
@@ -262,7 +266,9 @@ discard block |
||
262 | 266 | |
263 | 267 | $str = call_user_func($method, $str); |
264 | 268 | |
265 | - if (! $cascade) return $str; |
|
269 | + if (! $cascade) { |
|
270 | + return $str; |
|
271 | + } |
|
266 | 272 | } |
267 | 273 | |
268 | 274 | return $str; |
@@ -75,8 +75,7 @@ discard block |
||
75 | 75 | [$priority], |
76 | 76 | [$callback] |
77 | 77 | ]; |
78 | - } |
|
79 | - else |
|
78 | + } else |
|
80 | 79 | { |
81 | 80 | self::$listeners[$event_name][0] = false; // Not sorted |
82 | 81 | self::$listeners[$event_name][1][] = $priority; |
@@ -200,8 +199,7 @@ discard block |
||
200 | 199 | if (! is_null($event_name)) |
201 | 200 | { |
202 | 201 | unset(self::$listeners[$event_name]); |
203 | - } |
|
204 | - else { |
|
202 | + } else { |
|
205 | 203 | self::$listeners = []; |
206 | 204 | } |
207 | 205 | } |
@@ -217,8 +217,7 @@ discard block |
||
217 | 217 | if (count($db->queries) == 0) |
218 | 218 | { |
219 | 219 | $output = $this->CI->lang->line('profiler_no_queries'); |
220 | - } |
|
221 | - else |
|
220 | + } else |
|
222 | 221 | { |
223 | 222 | $total = 0; // total query time |
224 | 223 | |
@@ -261,16 +260,14 @@ discard block |
||
261 | 260 | if (count($get) == 0 || $get === false) |
262 | 261 | { |
263 | 262 | $output = $this->CI->lang->line('profiler_no_get'); |
264 | - } |
|
265 | - else |
|
263 | + } else |
|
266 | 264 | { |
267 | 265 | foreach ($get as $key => $val) |
268 | 266 | { |
269 | 267 | if (is_array($val)) |
270 | 268 | { |
271 | 269 | $output[$key] = "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>"; |
272 | - } |
|
273 | - else |
|
270 | + } else |
|
274 | 271 | { |
275 | 272 | $output[$key] = htmlspecialchars(stripslashes($val)); |
276 | 273 | } |
@@ -294,8 +291,7 @@ discard block |
||
294 | 291 | if (count($_POST) == 0) |
295 | 292 | { |
296 | 293 | $output = $this->CI->lang->line('profiler_no_post'); |
297 | - } |
|
298 | - else |
|
294 | + } else |
|
299 | 295 | { |
300 | 296 | foreach ($_POST as $key => $val) |
301 | 297 | { |
@@ -307,8 +303,7 @@ discard block |
||
307 | 303 | if (is_array($val)) |
308 | 304 | { |
309 | 305 | $output['$_POST['. $key .']'] = '<pre>'. htmlspecialchars(stripslashes(print_r($val, TRUE))) . '</pre>'; |
310 | - } |
|
311 | - else |
|
306 | + } else |
|
312 | 307 | { |
313 | 308 | $output['$_POST['. $key .']'] = htmlspecialchars(stripslashes($val)); |
314 | 309 | } |
@@ -330,8 +325,7 @@ discard block |
||
330 | 325 | if ($this->CI->uri->uri_string == '') |
331 | 326 | { |
332 | 327 | $output = $this->CI->lang->line('profiler_no_uri'); |
333 | - } |
|
334 | - else |
|
328 | + } else |
|
335 | 329 | { |
336 | 330 | $output = $this->CI->uri->uri_string; |
337 | 331 | } |
@@ -367,8 +361,7 @@ discard block |
||
367 | 361 | if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') |
368 | 362 | { |
369 | 363 | $output = number_format($usage) .' bytes'; |
370 | - } |
|
371 | - else |
|
364 | + } else |
|
372 | 365 | { |
373 | 366 | $output = $this->CI->lang->line('profiler_no_memory_usage'); |
374 | 367 | } |
@@ -448,8 +441,7 @@ discard block |
||
448 | 441 | if ($log['type'] == 'log') |
449 | 442 | { |
450 | 443 | $logs['console'][$key]['data'] = print_r($log['data'], true); |
451 | - } |
|
452 | - elseif ($log['type'] == 'memory') |
|
444 | + } elseif ($log['type'] == 'memory') |
|
453 | 445 | { |
454 | 446 | $logs['console'][$key]['data'] = $this->get_file_size($log['data']); |
455 | 447 | } |
@@ -482,8 +474,7 @@ discard block |
||
482 | 474 | if (is_array($val) || is_object($val)) |
483 | 475 | { |
484 | 476 | $output[$key] = htmlspecialchars(stripslashes(print_r($val, true))); |
485 | - } |
|
486 | - else |
|
477 | + } else |
|
487 | 478 | { |
488 | 479 | $output[$key] = htmlspecialchars(stripslashes($val)); |
489 | 480 | } |
@@ -517,8 +508,7 @@ discard block |
||
517 | 508 | if (is_array($val) || is_object($val)) |
518 | 509 | { |
519 | 510 | $output[$key] = htmlspecialchars(stripslashes(print_r($val, true))); |
520 | - } |
|
521 | - else |
|
511 | + } else |
|
522 | 512 | { |
523 | 513 | $output[$key] = htmlspecialchars(stripslashes($val)); |
524 | 514 | } |
@@ -565,7 +555,9 @@ discard block |
||
565 | 555 | if ($this->_compile_{$section} !== FALSE) |
566 | 556 | { |
567 | 557 | $func = "_compile_{$section}"; |
568 | - if ($section == 'http_headers') $section = 'headers'; |
|
558 | + if ($section == 'http_headers') { |
|
559 | + $section = 'headers'; |
|
560 | + } |
|
569 | 561 | $this->_sections[$section] = $this->{$func}(); |
570 | 562 | $fields_displayed++; |
571 | 563 | } |
@@ -257,9 +257,12 @@ discard block |
||
257 | 257 | <?php endforeach; ?> |
258 | 258 | </table> |
259 | 259 | |
260 | - <?php else : ?> |
|
260 | + <?php else { |
|
261 | + : ?> |
|
261 | 262 | |
262 | - <?php echo $sections['console']; ?> |
|
263 | + <?php echo $sections['console']; |
|
264 | +} |
|
265 | +?> |
|
263 | 266 | |
264 | 267 | <?php endif; ?> |
265 | 268 | </div> |
@@ -288,9 +291,12 @@ discard block |
||
288 | 291 | <?php endforeach; ?> |
289 | 292 | </table> |
290 | 293 | |
291 | - <?php else : ?> |
|
294 | + <?php else { |
|
295 | + : ?> |
|
292 | 296 | |
293 | - <?php echo $sections['console']; ?> |
|
297 | + <?php echo $sections['console']; |
|
298 | +} |
|
299 | +?> |
|
294 | 300 | |
295 | 301 | <?php endif; ?> |
296 | 302 | </div> |
@@ -309,9 +315,12 @@ discard block |
||
309 | 315 | <?php endforeach; ?> |
310 | 316 | </table> |
311 | 317 | |
312 | - <?php else : ?> |
|
318 | + <?php else { |
|
319 | + : ?> |
|
313 | 320 | |
314 | - <?php echo $sections['benchmarks']; ?> |
|
321 | + <?php echo $sections['benchmarks']; |
|
322 | +} |
|
323 | +?> |
|
315 | 324 | |
316 | 325 | <?php endif; ?> |
317 | 326 | </div> |
@@ -332,9 +341,12 @@ discard block |
||
332 | 341 | <?php endforeach; ?> |
333 | 342 | </table> |
334 | 343 | |
335 | - <?php else : ?> |
|
344 | + <?php else { |
|
345 | + : ?> |
|
336 | 346 | |
337 | - <?php echo $sections['queries']; ?> |
|
347 | + <?php echo $sections['queries']; |
|
348 | +} |
|
349 | +?> |
|
338 | 350 | |
339 | 351 | <?php endif; ?> |
340 | 352 | </div> |
@@ -394,8 +406,11 @@ discard block |
||
394 | 406 | <?php foreach ($sections[$section] as $key => $val) : ?> |
395 | 407 | <tr><td class="hilight"><?php echo $key ?></td><td><?php echo htmlspecialchars($val) ?></td></tr> |
396 | 408 | <?php endforeach; ?> |
397 | - <?php else : ?> |
|
398 | - <tr><td><?php echo $sections[$section]; ?></td></tr> |
|
409 | + <?php else { |
|
410 | + : ?> |
|
411 | + <tr><td><?php echo $sections[$section]; |
|
412 | +} |
|
413 | +?></td></tr> |
|
399 | 414 | <?php endif; ?> |
400 | 415 | </table> |
401 | 416 | <?php endif; ?> |
@@ -422,19 +437,25 @@ discard block |
||
422 | 437 | <?php endforeach; ?> |
423 | 438 | </table> |
424 | 439 | |
425 | - <?php else : ?> |
|
440 | + <?php else { |
|
441 | + : ?> |
|
426 | 442 | |
427 | - <?php echo $sections['files']; ?> |
|
443 | + <?php echo $sections['files']; |
|
444 | +} |
|
445 | +?> |
|
428 | 446 | |
429 | 447 | <?php endif; ?> |
430 | 448 | </div> |
431 | 449 | <?php endif; ?> |
432 | 450 | |
433 | 451 | |
434 | -<?php else: ?> |
|
452 | +<?php else { |
|
453 | + : ?> |
|
435 | 454 | |
436 | 455 | <p class="ci-profiler-box"><?php echo lang('profiler_no_profiles') ?></p> |
437 | 456 | |
438 | -<?php endif; ?> |
|
457 | +<?php endif; |
|
458 | +} |
|
459 | +?> |
|
439 | 460 | |
440 | 461 | </div> <!-- /codeigniter_profiler --> |
@@ -153,8 +153,7 @@ discard block |
||
153 | 153 | if ($overwrite && $file_exists) |
154 | 154 | { |
155 | 155 | CLI::write( CLI::color("\t". strtolower( lang('overwrote') ) ." ", 'light_red') . str_replace(APPPATH, '', $path ) ); |
156 | - } |
|
157 | - else |
|
156 | + } else |
|
158 | 157 | { |
159 | 158 | CLI::write( CLI::color("\t". strtolower( lang('created') ) ." ", 'yellow') . str_replace(APPPATH, '', $path ) ); |
160 | 159 | } |
@@ -266,8 +265,7 @@ discard block |
||
266 | 265 | if (is_string($options)) |
267 | 266 | { |
268 | 267 | $action = $options; |
269 | - } |
|
270 | - else if (is_array($options) && count($options)) |
|
268 | + } else if (is_array($options) && count($options)) |
|
271 | 269 | { |
272 | 270 | $keys = array_keys($options); |
273 | 271 | $action = array_shift( $keys ); |
@@ -300,8 +298,7 @@ discard block |
||
300 | 298 | if ($success) |
301 | 299 | { |
302 | 300 | CLI::write( CLI::color("\t". strtolower( lang('modified') ) ." ", 'cyan') . str_replace(APPPATH, '', $path ) ); |
303 | - } |
|
304 | - else |
|
301 | + } else |
|
305 | 302 | { |
306 | 303 | CLI::write( CLI::color("\t". strtolower( lang('error') ) ." ", 'light_red') . str_replace(APPPATH, '', $path ) ); |
307 | 304 | } |
@@ -616,17 +613,14 @@ discard block |
||
616 | 613 | if (is_array($value)) |
617 | 614 | { |
618 | 615 | $str .= $this->stringify($value, $depth); |
619 | - } |
|
620 | - else if (is_bool($value)) |
|
616 | + } else if (is_bool($value)) |
|
621 | 617 | { |
622 | 618 | $b = $value === true ? 'true' : 'false'; |
623 | 619 | $str .= "{$b},\n"; |
624 | - } |
|
625 | - else if (is_numeric($value)) |
|
620 | + } else if (is_numeric($value)) |
|
626 | 621 | { |
627 | 622 | $str .= "{$value},\n"; |
628 | - } |
|
629 | - else |
|
623 | + } else |
|
630 | 624 | { |
631 | 625 | $str .= "'{$value}',\n"; |
632 | 626 | } |
@@ -676,8 +670,7 @@ discard block |
||
676 | 670 | if(is_null($test)) |
677 | 671 | { |
678 | 672 | $parts[] = $segment; |
679 | - } |
|
680 | - else if ($segment == '..') |
|
673 | + } else if ($segment == '..') |
|
681 | 674 | { |
682 | 675 | if ($test == '..') |
683 | 676 | { |
@@ -688,8 +681,7 @@ discard block |
||
688 | 681 | { |
689 | 682 | $parts[] = $segment; |
690 | 683 | } |
691 | - } |
|
692 | - else |
|
684 | + } else |
|
693 | 685 | { |
694 | 686 | $parts[] = $test; |
695 | 687 | $parts[] = $segment; |