@@ -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 && $newWidth[strlen($newWidth)-1] == '%') { |
|
443 | +if ($newWidth && $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 && $newHeight[strlen($newHeight)-1] == '%') { |
|
468 | +if ($newHeight && $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 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * Showing message Hello World, not using the standard page layout. |
11 | 11 | */ |
12 | -$app->router->get("lek/hello-world", function () use ($app) { |
|
12 | +$app->router->get("lek/hello-world", function() use ($app) { |
|
13 | 13 | // echo "Some debugging information"; |
14 | 14 | return "Hello World"; |
15 | 15 | }); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * Returning a JSON message with Hello World. |
21 | 21 | */ |
22 | -$app->router->get("lek/hello-world-json", function () use ($app) { |
|
22 | +$app->router->get("lek/hello-world-json", function() use ($app) { |
|
23 | 23 | // echo "Some debugging information"; |
24 | 24 | return [["message" => "Hello World"]]; |
25 | 25 | }); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Showing message Hello World, rendered within the standard page layout. |
31 | 31 | */ |
32 | -$app->router->get("lek/hello-world-page", function () use ($app) { |
|
32 | +$app->router->get("lek/hello-world-page", function() use ($app) { |
|
33 | 33 | $title = "Hello World as a page"; |
34 | 34 | $data = [ |
35 | 35 | "class" => "hello-world", |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Init the game redirect to play the game. |
9 | 9 | */ |
10 | -$app->router->get("guess/init", function () use ($app) { |
|
10 | +$app->router->get("guess/init", function() use ($app) { |
|
11 | 11 | $_SESSION["res"] = null; |
12 | 12 | // Init the game |
13 | 13 | $game = new Bashar\Guess\Guess(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Play the game. show game status |
24 | 24 | */ |
25 | -$app->router->get("guess/play", function () use ($app) { |
|
25 | +$app->router->get("guess/play", function() use ($app) { |
|
26 | 26 | $title = "Play the game"; |
27 | 27 | |
28 | 28 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Play the game. Make a guess (POST method) |
49 | 49 | */ |
50 | -$app->router->post("guess/play", function () use ($app) { |
|
50 | +$app->router->post("guess/play", function() use ($app) { |
|
51 | 51 | |
52 | 52 | // Deal with incoming variables |
53 | 53 | $guess = $_POST["guess"] ?? null; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Make a guess (make-guess) |
79 | 79 | */ |
80 | -$app->router->get("guess/make-guess", function () use ($app) { |
|
80 | +$app->router->get("guess/make-guess", function() use ($app) { |
|
81 | 81 | $number = $_SESSION["number"] ?? null; |
82 | 82 | $tries = $_SESSION["tries"] ?? null; |
83 | 83 | $guess = $_SESSION["guess"] ?? null; |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | /** |
111 | 111 | * Wining the game |
112 | 112 | */ |
113 | -$app->router->get("guess/win", function () use ($app) { |
|
114 | - $title =" You won the game!"; |
|
113 | +$app->router->get("guess/win", function() use ($app) { |
|
114 | + $title = " You won the game!"; |
|
115 | 115 | |
116 | 116 | $data = [ |
117 | 117 | "number" => $_SESSION["number"] ?? null |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | /** |
130 | 130 | * In case of losing the game |
131 | 131 | */ |
132 | -$app->router->get("guess/fail", function () use ($app) { |
|
133 | - $title =" You have lost the game!"; |
|
132 | +$app->router->get("guess/fail", function() use ($app) { |
|
133 | + $title = " You have lost the game!"; |
|
134 | 134 | |
135 | 135 | $data = [ |
136 | 136 | "tries" => $_SESSION["tries"] ?? null, |
@@ -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> |