@@ -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 |
@@ -9,14 +9,14 @@ |
||
9 | 9 | // Show incoming variables and view helper functions |
10 | 10 | //echo showEnvironment(get_defined_vars(), get_defined_functions()); |
11 | 11 | |
12 | -$items = $navbarConfig["items"] ?? []; |
|
12 | +$items = $navbarConfig[ "items" ] ?? [ ]; |
|
13 | 13 | |
14 | -$classes = "navbar " . ($navbarConfig["class"] ?? null); |
|
14 | +$classes = "navbar " . ($navbarConfig[ "class" ] ?? null); |
|
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | 18 | ?><navbar <?= classList($classes) ?>> |
19 | 19 | <?php foreach ($items as $item) : ?> |
20 | - <a href="<?= url($item["url"]) ?>" title="<?= $item["title"] ?>"><?= $item["text"] ?></a> |
|
20 | + <a href="<?= url($item[ "url" ]) ?>" title="<?= $item[ "title" ] ?>"><?= $item[ "text" ] ?></a> |
|
21 | 21 | <?php endforeach; ?> |
22 | 22 | </navbar> |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | <?php foreach ($toc as $route => $link) : |
17 | 17 | $url = url($route); |
18 | - $text = $link["title"]; // Should be text? |
|
18 | + $text = $link[ "title" ]; // Should be text? |
|
19 | 19 | $title = null; // Missmatch with $link["title"] |
20 | 20 | /* |
21 | 21 | $title = isset($link["title"]) |
@@ -26,17 +26,17 @@ |
||
26 | 26 | |
27 | 27 | |
28 | 28 | <?php $i = 1; foreach ($columns as $column) : |
29 | - $template = isset($column["template"]) |
|
30 | - ? $column["template"] |
|
29 | + $template = isset($column[ "template" ]) |
|
30 | + ? $column[ "template" ] |
|
31 | 31 | : __DIR__ . "/../block/default"; |
32 | 32 | ?> |
33 | 33 | |
34 | 34 | <div <?= classList("column $outerClass") ?>> |
35 | 35 | |
36 | 36 | <?php |
37 | - $column["classes"] = ["$outerClass-x", "$outerClass-$i"]; |
|
38 | - $data = isset($column["data"]) |
|
39 | - ? $column["data"] |
|
37 | + $column[ "classes" ] = [ "$outerClass-x", "$outerClass-$i" ]; |
|
38 | + $data = isset($column[ "data" ]) |
|
39 | + ? $column[ "data" ] |
|
40 | 40 | : $column; |
41 | 41 | renderView($template, $data); |
42 | 42 | ?> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | // Show incoming variables and view helper functions |
12 | 12 | //echo showEnvironment(get_defined_vars(), get_defined_functions()); |
13 | 13 | |
14 | -$htmlClass = $htmlClass ?? []; |
|
14 | +$htmlClass = $htmlClass ?? [ ]; |
|
15 | 15 | $lang = $lang ?? "sv"; |
16 | 16 | $charset = $charset ?? "utf-8"; |
17 | 17 | $title = ($title ?? "No title") . ($baseTitle ?? " | No base title defined"); |
@@ -22,33 +22,33 @@ discard block |
||
22 | 22 | $session = $di->get("session"); |
23 | 23 | if ($request->getGet("style")) { |
24 | 24 | $session->set("redirect", currentUrl()); |
25 | - redirect("style/update/" . rawurlencode($_GET["style"])); |
|
25 | + redirect("style/update/" . rawurlencode($_GET[ "style" ])); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // Get the active stylesheet, if any. |
29 | 29 | $activeStyle = $session->get(StyleChooserController::getSessionKey(), null); |
30 | 30 | if ($activeStyle) { |
31 | - $stylesheets = []; |
|
32 | - $stylesheets[] = $activeStyle; |
|
31 | + $stylesheets = [ ]; |
|
32 | + $stylesheets[ ] = $activeStyle; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Get hgrid & vgrid |
36 | 36 | if ($request->hasGet("hgrid")) { |
37 | - $htmlClass[] = "hgrid"; |
|
37 | + $htmlClass[ ] = "hgrid"; |
|
38 | 38 | } |
39 | 39 | if ($request->hasGet("vgrid")) { |
40 | - $htmlClass[] = "vgrid"; |
|
40 | + $htmlClass[ ] = "vgrid"; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // Show regions |
44 | 44 | if ($request->hasGet("regions")) { |
45 | - $htmlClass[] = "regions"; |
|
45 | + $htmlClass[ ] = "regions"; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Get flash message if any and add to region flash-message |
49 | 49 | $flashMessage = $session->getOnce("flashmessage"); |
50 | 50 | if ($flashMessage) { |
51 | - $di->get("view")->add(__DIR__ . "/../flashmessage/default", ["message" => $flashMessage], "flash-message"); |
|
51 | + $di->get("view")->add(__DIR__ . "/../flashmessage/default", [ "message" => $flashMessage ], "flash-message"); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // Get current route to make as body class |
@@ -211,7 +211,7 @@ discard block |
||
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 | ?> |
@@ -10,9 +10,9 @@ |
||
10 | 10 | //echo showEnvironment(get_defined_vars(), get_defined_functions()); |
11 | 11 | |
12 | 12 | // Prepare classes |
13 | -$classes[] = "article"; |
|
13 | +$classes[ ] = "article"; |
|
14 | 14 | if (isset($class)) { |
15 | - $classes[] = $class; |
|
15 | + $classes[ ] = $class; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | //echo showEnvironment(get_defined_vars(), get_defined_functions()); |
11 | 11 | |
12 | 12 | // Prepare classes |
13 | -$classes[] = "block"; |
|
13 | +$classes[ ] = "block"; |
|
14 | 14 | if (isset($class)) { |
15 | - $classes[] = $class; |
|
15 | + $classes[ ] = $class; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // Load content details from route |
@@ -21,7 +21,7 @@ discard block |
||
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 |
@@ -6,15 +6,15 @@ discard block |
||
6 | 6 | class User extends ActiveRecordModel |
7 | 7 | { |
8 | 8 | /** |
9 | - * @var string $tableName name of the database table. |
|
10 | - */ |
|
9 | + * @var string $tableName name of the database table. |
|
10 | + */ |
|
11 | 11 | protected $tableName = "User"; |
12 | 12 | |
13 | 13 | /** |
14 | - * Columns in the table. |
|
15 | - * |
|
16 | - * @var integer $id primary key auto incremented. |
|
17 | - */ |
|
14 | + * Columns in the table. |
|
15 | + * |
|
16 | + * @var integer $id primary key auto incremented. |
|
17 | + */ |
|
18 | 18 | public $id; |
19 | 19 | public $username; |
20 | 20 | public $password; |
@@ -27,26 +27,26 @@ discard block |
||
27 | 27 | * A database driven model. |
28 | 28 | */ |
29 | 29 | /** |
30 | - * Set the password. |
|
31 | - * |
|
32 | - * @param string $password the password to use. |
|
33 | - * |
|
34 | - * @return void |
|
35 | - */ |
|
30 | + * Set the password. |
|
31 | + * |
|
32 | + * @param string $password the password to use. |
|
33 | + * |
|
34 | + * @return void |
|
35 | + */ |
|
36 | 36 | public function setPassword($password) |
37 | 37 | { |
38 | 38 | $this->password = password_hash($password, PASSWORD_DEFAULT); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * Verify the acronym and the password, if successful the object contains |
|
43 | - * all details from the database row. |
|
44 | - * |
|
45 | - * @param string $acronym acronym to check. |
|
46 | - * @param string $password the password to use. |
|
47 | - * |
|
48 | - * @return boolean true if acronym and password matches, else false. |
|
49 | - */ |
|
42 | + * Verify the acronym and the password, if successful the object contains |
|
43 | + * all details from the database row. |
|
44 | + * |
|
45 | + * @param string $acronym acronym to check. |
|
46 | + * @param string $password the password to use. |
|
47 | + * |
|
48 | + * @return boolean true if acronym and password matches, else false. |
|
49 | + */ |
|
50 | 50 | public function verifyPassword($username, $password) |
51 | 51 | { |
52 | 52 | $this->find("username", $username); |
@@ -22,7 +22,6 @@ |
||
22 | 22 | * @param string $message with details. |
23 | 23 | * |
24 | 24 | * @throws Anax\Route\Exception\NotFoundException |
25 | - |
|
26 | 25 | * @return object as the response. |
27 | 26 | */ |
28 | 27 | public function catchAll() : object |
@@ -52,13 +52,13 @@ |
||
52 | 52 | $page->add( |
53 | 53 | "anax/v2/error/default", |
54 | 54 | [ |
55 | - "header" => $pages[$path][0], |
|
56 | - "text" => $pages[$path][1], |
|
55 | + "header" => $pages[ $path ][ 0 ], |
|
56 | + "text" => $pages[ $path ][ 1 ], |
|
57 | 57 | ] |
58 | 58 | ); |
59 | 59 | |
60 | 60 | return $page->render([ |
61 | - "title" => $pages[$path][0] . $title |
|
61 | + "title" => $pages[ $path ][ 0 ] . $title |
|
62 | 62 | ], $path); |
63 | 63 | } |
64 | 64 | } |