@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * Custom exception handler. |
13 | 13 | */ |
14 | -set_exception_handler(function ($exception) { |
|
14 | +set_exception_handler(function($exception) { |
|
15 | 15 | errorPage( |
16 | 16 | "<p><b>img.php: Uncaught exception:</b> <p>" |
17 | 17 | . $exception->getMessage() |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * Get configuration options from file, if the file exists, else use $config |
29 | 29 | * if its defined or create an empty $config. |
30 | 30 | */ |
31 | -$configFile = __DIR__.'/'.basename(__FILE__, '.php').'_config.php'; |
|
31 | +$configFile = __DIR__ . '/' . basename(__FILE__, '.php') . '_config.php'; |
|
32 | 32 | |
33 | 33 | if (is_file($configFile)) { |
34 | 34 | $config = require $configFile; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * Manage size constants from config file, use constants to replace values |
405 | 405 | * for width and height. |
406 | 406 | */ |
407 | -$sizeConstant = getConfig('size_constant', function () { |
|
407 | +$sizeConstant = getConfig('size_constant', function() { |
|
408 | 408 | |
409 | 409 | // Set sizes to map constant to value, easier to use with width or height |
410 | 410 | $sizes = array( |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | } |
441 | 441 | |
442 | 442 | // Support width as % of original width |
443 | -if ($newWidth[strlen($newWidth)-1] == '%') { |
|
443 | +if ($newWidth[strlen($newWidth) - 1] == '%') { |
|
444 | 444 | is_numeric(substr($newWidth, 0, -1)) |
445 | 445 | or errorPage('Width % not numeric.', 404); |
446 | 446 | } else { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | } |
466 | 466 | |
467 | 467 | // height |
468 | -if ($newHeight[strlen($newHeight)-1] == '%') { |
|
468 | +if ($newHeight[strlen($newHeight) - 1] == '%') { |
|
469 | 469 | is_numeric(substr($newHeight, 0, -1)) |
470 | 470 | or errorPage('Height % out of range.', 404); |
471 | 471 | } else { |
@@ -482,14 +482,14 @@ discard block |
||
482 | 482 | * aspect-ratio, ar - affecting the resulting image width, height and resize options |
483 | 483 | */ |
484 | 484 | $aspectRatio = get(array('aspect-ratio', 'ar')); |
485 | -$aspectRatioConstant = getConfig('aspect_ratio_constant', function () { |
|
485 | +$aspectRatioConstant = getConfig('aspect_ratio_constant', function() { |
|
486 | 486 | return array( |
487 | - '3:1' => 3/1, |
|
488 | - '3:2' => 3/2, |
|
489 | - '4:3' => 4/3, |
|
490 | - '8:5' => 8/5, |
|
491 | - '16:10' => 16/10, |
|
492 | - '16:9' => 16/9, |
|
487 | + '3:1' => 3 / 1, |
|
488 | + '3:2' => 3 / 2, |
|
489 | + '4:3' => 4 / 3, |
|
490 | + '8:5' => 8 / 5, |
|
491 | + '16:10' => 16 / 10, |
|
492 | + '16:9' => 16 / 9, |
|
493 | 493 | 'golden' => 1.618, |
494 | 494 | ); |
495 | 495 | }); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | if ($fillToFit !== null) { |
569 | 569 | |
570 | 570 | if (!empty($fillToFit)) { |
571 | - $bgColor = $fillToFit; |
|
571 | + $bgColor = $fillToFit; |
|
572 | 572 | verbose("fillToFit changed bgColor to = $bgColor"); |
573 | 573 | } |
574 | 574 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | // Prepare title |
24 | -$title = isset($title) && !empty($title)? $title : null; |
|
24 | +$title = isset($title) && !empty($title) ? $title : null; |
|
25 | 25 | $header = isset($header) ? $header : $title; |
26 | 26 | |
27 | 27 | // Prepare content into text |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $navbar->setDI($di); |
14 | 14 | $html = $navbar->createMenuWithSubMenus($navbarConfig); |
15 | 15 | |
16 | -$classes = "rm-navbar-max rm-navbar rm-max rm-swipe-right " . ( $class ?? null); |
|
16 | +$classes = "rm-navbar-max rm-navbar rm-max rm-swipe-right " . ($class ?? null); |
|
17 | 17 | |
18 | 18 | |
19 | 19 | ?><!-- menu wrapper --> |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $navbar->setDI($di); |
14 | 14 | $html = $navbar->createMenuWithSubMenus($navbarConfig); |
15 | 15 | |
16 | -$classes = "rm-navbar " . ( $class ?? null); |
|
16 | +$classes = "rm-navbar " . ($class ?? null); |
|
17 | 17 | |
18 | 18 | |
19 | 19 |
@@ -211,7 +211,7 @@ |
||
211 | 211 | $sidebarLeft = regionHasContent("sidebar-left"); |
212 | 212 | $sidebarRight = regionHasContent("sidebar-right"); |
213 | 213 | $class = ""; |
214 | -$class .= $sidebarLeft ? "has-sidebar-left " : ""; |
|
214 | +$class .= $sidebarLeft ? "has-sidebar-left " : ""; |
|
215 | 215 | $class .= $sidebarRight ? "has-sidebar-right " : ""; |
216 | 216 | $class .= empty($class) ? "" : "has-sidebar"; |
217 | 217 | ?> |
@@ -21,5 +21,5 @@ |
||
21 | 21 | <pre><?= var_dump($session) ?></pre> |
22 | 22 | |
23 | 23 | <p> |
24 | - <a href="<?= url($mount."session") ?>">Back to session<a> |
|
24 | + <a href="<?= url($mount . "session") ?>">Back to session<a> |
|
25 | 25 | </p> |
@@ -16,9 +16,9 @@ |
||
16 | 16 | <p>Here is a set of utilities to use when learning, developing, testing and debugging Anax.</p> |
17 | 17 | |
18 | 18 | <ul> |
19 | - <li><a href="<?= url($mount."di") ?>">DI (show loaded services in $di)</a></li> |
|
20 | - <li><a href="<?= url($mount."request") ?>">Request (show details on current request)</a></li> |
|
21 | - <li><a href="<?= url($mount."router") ?>">Router (show loaded routes)</a></li> |
|
22 | - <li><a href="<?= url($mount."session") ?>">Session (show session data)</a></li> |
|
23 | - <li><a href="<?= url($mount."view") ?>">View (debug and inspect views)</a></li> |
|
19 | + <li><a href="<?= url($mount . "di") ?>">DI (show loaded services in $di)</a></li> |
|
20 | + <li><a href="<?= url($mount . "request") ?>">Request (show details on current request)</a></li> |
|
21 | + <li><a href="<?= url($mount . "router") ?>">Router (show loaded routes)</a></li> |
|
22 | + <li><a href="<?= url($mount . "session") ?>">Session (show session data)</a></li> |
|
23 | + <li><a href="<?= url($mount . "view") ?>">View (debug and inspect views)</a></li> |
|
24 | 24 | </ul> |
@@ -21,6 +21,6 @@ |
||
21 | 21 | <pre><?= var_dump($session) ?></pre> |
22 | 22 | |
23 | 23 | <p> |
24 | - <a href="<?= url($mount."session/increment") ?>">Add to session and increment<a> | |
|
25 | - <a href="<?= url($mount."session/destroy") ?>">Destroy session<a> |
|
24 | + <a href="<?= url($mount . "session/increment") ?>">Add to session and increment<a> | |
|
25 | + <a href="<?= url($mount . "session/destroy") ?>">Destroy session<a> |
|
26 | 26 | </p> |
@@ -25,5 +25,5 @@ |
||
25 | 25 | <pre><?= var_dump($session) ?></pre> |
26 | 26 | |
27 | 27 | <p> |
28 | - <a href="<?= url($mount."session") ?>">Back to session<a> |
|
28 | + <a href="<?= url($mount . "session") ?>">Back to session<a> |
|
29 | 29 | </p> |