Passed
Branch master (c37d37)
by Alexey
04:13
created
src/Page/PageRender.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $view->add("layout/layout", $data, "layout");
58 58
         $body = $view->renderBuffered("layout");
59 59
         $this->di->get("response")->setBody($body)
60
-                       ->send($status);
60
+                        ->send($status);
61 61
         exit;
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @SuppressWarnings("exit")
27 27
      */
28
-    public function renderPage($data = [], $status = 200)
28
+    public function renderPage($data = [ ], $status = 200)
29 29
     {
30
-        $data["stylesheets"] = [
30
+        $data[ "stylesheets" ] = [
31 31
             "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css",
32 32
             "lib/css/font-awesome.min.css",
33 33
             "https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css",
34 34
             "css/style.css",
35 35
         ];
36 36
 
37
-        $data["title"] = isset($data["title"]) ? "Anax | " . $data["title"] : "Anax";
37
+        $data[ "title" ] = isset($data[ "title" ]) ? "Anax | " . $data[ "title" ] : "Anax";
38 38
 
39
-        $data["scripts"] = [
39
+        $data[ "scripts" ] = [
40 40
             "https://code.jquery.com/jquery-3.2.1.slim.min.js",
41 41
             "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js",
42 42
             "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js",
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
         $user = $this->di->get("user")->getUser();
51 51
         $userId = $this->di->get("session")->get('userId', null);
52 52
 
53
-        $view->add("common/navbar", ["user" => $user, "userId" => $userId], "navbar");
54
-        $view->add("common/footer", [], "footer");
53
+        $view->add("common/navbar", [ "user" => $user, "userId" => $userId ], "navbar");
54
+        $view->add("common/footer", [ ], "footer");
55 55
 
56 56
         // Add layout, render it, add to response and send.
57 57
         $view->add("layout/layout", $data, "layout");
Please login to merge, or discard this patch.
config/route2/userController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,25 +8,25 @@
 block discarded – undo
8 8
             "info" => "User Profile.",
9 9
             "requestMethod" => "get|post",
10 10
             "path" => "",
11
-            "callable" => ["userController", "getIndex"],
11
+            "callable" => [ "userController", "getIndex" ],
12 12
         ],
13 13
         [
14 14
             "info" => "Login a user.",
15 15
             "requestMethod" => "get|post",
16 16
             "path" => "login",
17
-            "callable" => ["userController", "getPostLogin"],
17
+            "callable" => [ "userController", "getPostLogin" ],
18 18
         ],
19 19
         [
20 20
             "info" => "Create a user.",
21 21
             "requestMethod" => "get|post",
22 22
             "path" => "create",
23
-            "callable" => ["userController", "getPostCreateUser"],
23
+            "callable" => [ "userController", "getPostCreateUser" ],
24 24
         ],
25 25
         [
26 26
             "info" => "Logout",
27 27
             "requestMethod" => "get",
28 28
             "path" => "logout",
29
-            "callable" => ["userController", "logout"],
29
+            "callable" => [ "userController", "logout" ],
30 30
         ],
31 31
     ]
32 32
 ];
Please login to merge, or discard this patch.
config/route2/admin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@
 block discarded – undo
6 6
             "info" => "Check if admin",
7 7
             "requestMethod" => "get",
8 8
             "path" => "**",
9
-            "callable" => ["admin", "isAdmin"],
9
+            "callable" => [ "admin", "isAdmin" ],
10 10
         ],
11 11
         [
12 12
             "info" => "Get all users",
13 13
             "requestMethod" => "get",
14 14
             "path" => null,
15
-            "callable" => ["admin", "getIndex"],
15
+            "callable" => [ "admin", "getIndex" ],
16 16
         ],
17 17
         [
18 18
             "info" => "Delte a user",
19 19
             "requestMethod" => "get",
20 20
             "path" => "delete/{id:digit}",
21
-            "callable" => ["admin", "deleteUser"],
21
+            "callable" => [ "admin", "deleteUser" ],
22 22
         ],
23 23
         [
24 24
             "info" => "Edit a user",
25 25
             "requestMethod" => "get|post",
26 26
             "path" => "edit/{id:digit}",
27
-            "callable" => ["admin", "editUser"],
27
+            "callable" => [ "admin", "editUser" ],
28 28
         ],
29 29
     ]
30 30
 ];
Please login to merge, or discard this patch.
config/route2/commentsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@
 block discarded – undo
12 12
             "info" => "Get all comments",
13 13
             "requestMethod" => "get|post",
14 14
             "path" => null,
15
-            "callable" => ["comment", "getIndex"],
15
+            "callable" => [ "comment", "getIndex" ],
16 16
         ],
17 17
         [
18 18
             "info" => "Delte a comment",
19 19
             "requestMethod" => "get",
20 20
             "path" => "delete/{id:digit}",
21
-            "callable" => ["comment", "deleteItem"],
21
+            "callable" => [ "comment", "deleteItem" ],
22 22
         ],
23 23
         [
24 24
             "info" => "Edit a comment",
25 25
             "requestMethod" => "get|post",
26 26
             "path" => "edit/{id:digit}",
27
-            "callable" => ["comment", "editItem"],
27
+            "callable" => [ "comment", "editItem" ],
28 28
         ],
29 29
     ]
30 30
 ];
Please login to merge, or discard this patch.
config/di.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 return [
6 6
     "userController" => [
7 7
         "shared" => true,
8
-        "callback" => function () {
8
+        "callback" => function() {
9 9
             $obj = new \Alvo\User\UserController();
10 10
             $obj->setDI($this);
11 11
             $obj->init();
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     ],
15 15
     "user" => [
16 16
         "shared" => false,
17
-        "callback" => function () {
17
+        "callback" => function() {
18 18
             $obj = new \Alvo\User\User();
19 19
             $obj->setDI($this);
20 20
             $obj->setDb($this->get("db"));
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     ],
24 24
     "comment" => [
25 25
         "shared" => true,
26
-        "callback" => function () {
26
+        "callback" => function() {
27 27
             $obj = new Alvo\Comment\CommentController();
28 28
             $obj->setDI($this);
29 29
             $obj->init();
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     ],
33 33
     "admin" => [
34 34
         "shared" => true,
35
-        "callback" => function () {
35
+        "callback" => function() {
36 36
             $obj = new Alvo\User\AdminController();
37 37
             $obj->setDI($this);
38 38
             $obj->init();
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     ],
42 42
     "db" => [
43 43
         "shared" => true,
44
-        "callback" => function () {
44
+        "callback" => function() {
45 45
             $obj = new \Anax\Database\DatabaseQueryBuilder();
46 46
             $obj->configure("database.php");
47 47
             return $obj;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     ],
50 50
     "pageRender" => [
51 51
         "shared" => true,
52
-        "callback" => function () {
52
+        "callback" => function() {
53 53
             $obj = new \Alvo\Page\PageRender();
54 54
             $obj->setDI($this);
55 55
             return $obj;
Please login to merge, or discard this patch.
config/testDi.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
     "services" => [
9 9
         "request" => [
10 10
             "shared" => true,
11
-            "callback" => function () {
11
+            "callback" => function() {
12 12
                 $request = new \Anax\Request\Request();
13 13
                 $request->init();
14 14
                 return $request;
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         ],
17 17
         "response" => [
18 18
             "shared" => true,
19
-            "callback" => function () {
19
+            "callback" => function() {
20 20
                 $obj = new \Anax\Response\ResponseUtility();
21 21
                 $obj->setDI($this);
22 22
                 return $obj;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         ],
25 25
         "bookController" => [
26 26
             "shared" => true,
27
-            "callback" => function () {
27
+            "callback" => function() {
28 28
                 $obj = new \Alvo\Book\BookController();
29 29
                 $obj->setDI($this);
30 30
                 return $obj;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         ],
33 33
         "userController" => [
34 34
             "shared" => true,
35
-            "callback" => function () {
35
+            "callback" => function() {
36 36
                 $obj = new \Alvo\User\UserController();
37 37
                 $obj->setDI($this);
38 38
                 $obj->init();
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         ],
42 42
         "user" => [
43 43
             "shared" => false,
44
-            "callback" => function () {
44
+            "callback" => function() {
45 45
                 $obj = new \Alvo\User\User();
46 46
                 $obj->setDI($this);
47 47
                 $obj->setDb($this->get("db"));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         ],
51 51
         "url" => [
52 52
             "shared" => true,
53
-            "callback" => function () {
53
+            "callback" => function() {
54 54
                 $url = new \Anax\Url\Url();
55 55
                 $request = $this->get("request");
56 56
                 $url->setSiteUrl($request->getSiteUrl());
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         ],
66 66
         "router" => [
67 67
             "shared" => true,
68
-            "callback" => function () {
68
+            "callback" => function() {
69 69
                 $router = new \Anax\Route\Router();
70 70
                 $router->setDI($this);
71 71
                 $router->configure("route.php");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         ],
75 75
         "view" => [
76 76
             "shared" => true,
77
-            "callback" => function () {
77
+            "callback" => function() {
78 78
                 $view = new \Anax\View\ViewCollection();
79 79
                 $view->setDI($this);
80 80
                 $view->configure("view.php");
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         ],
84 84
         "viewRenderFile" => [
85 85
             "shared" => true,
86
-            "callback" => function () {
86
+            "callback" => function() {
87 87
                 $viewRender = new \Anax\View\ViewRenderFile2();
88 88
                 $viewRender->setDI($this);
89 89
                 return $viewRender;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         "session" => [
93 93
             "shared" => true,
94 94
             "active" => true,
95
-            "callback" => function () {
95
+            "callback" => function() {
96 96
                 $session = new \Anax\Session\SessionConfigurable();
97 97
                 $session->configure("session.php");
98 98
                 $session->start();
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         ],
106 106
         "errorController" => [
107 107
             "shared" => true,
108
-            "callback" => function () {
108
+            "callback" => function() {
109 109
                 $obj = new \Anax\Page\ErrorController();
110 110
                 $obj->setDI($this);
111 111
                 return $obj;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         ],
114 114
         "debugController" => [
115 115
             "shared" => true,
116
-            "callback" => function () {
116
+            "callback" => function() {
117 117
                 $obj = new \Anax\Page\DebugController();
118 118
                 $obj->setDI($this);
119 119
                 return $obj;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         ],
122 122
         "flatFileContentController" => [
123 123
             "shared" => true,
124
-            "callback" => function () {
124
+            "callback" => function() {
125 125
                 $obj = new \Alvo\Page\FlatFileContentController();
126 126
                 $obj->setDI($this);
127 127
                 return $obj;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         ],
130 130
         "pageRender" => [
131 131
             "shared" => true,
132
-            "callback" => function () {
132
+            "callback" => function() {
133 133
                 $obj = new \Alvo\Page\PageRender();
134 134
                 $obj->setDI($this);
135 135
                 return $obj;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         ],
138 138
         "db" => [
139 139
             "shared" => true,
140
-            "callback" => function () {
140
+            "callback" => function() {
141 141
                 $obj = new \Anax\Database\DatabaseQueryBuilder();
142 142
                 $obj->configure("database.php");
143 143
                 return $obj;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         ],
146 146
         "comment" => [
147 147
             "shared" => true,
148
-            "callback" => function () {
148
+            "callback" => function() {
149 149
                 $obj = new Alvo\Comment\CommentController();
150 150
                 $obj->setDI($this);
151 151
                 $obj->init();
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         ],
155 155
         "admin" => [
156 156
             "shared" => true,
157
-            "callback" => function () {
157
+            "callback" => function() {
158 158
                 $obj = new Alvo\User\AdminController();
159 159
                 $obj->setDI($this);
160 160
                 $obj->init();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         ],
164 164
         "rem" => [
165 165
             "shared" => true,
166
-            "callback" => function () {
166
+            "callback" => function() {
167 167
                 $rem = new \Anax\RemServer\RemServer();
168 168
                 $rem->configure("remserver.php");
169 169
                 $rem->injectSession($this->get("session"));
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         ],
173 173
         "remController" => [
174 174
             "shared" => false,
175
-            "callback" => function () {
175
+            "callback" => function() {
176 176
                 $rem = new \Anax\RemServer\RemServerController();
177 177
                 $rem->setDI($this);
178 178
                 return $rem;
Please login to merge, or discard this patch.