Completed
Push — master ( 4e5fa6...d508a7 )
by Arman
19s queued 15s
created
src/Libraries/Module/Templates/Demo/Api/Config/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($route) {
3
+return function($route) {
4 4
     $route->get('[:alpha:2]?/posts', 'PostController', 'posts')->name('posts');
5 5
     $route->get('[:alpha:2]?/post/[id=:any]', 'PostController', 'post');
6 6
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     $route->get('[:alpha:2]?/resend/[code=:any]', 'AuthController', 'resend')->middlewares(['Resend']);
13 13
     $route->post('[:alpha:2]?/verify', 'AuthController', 'verify')->middlewares(['Verify']);
14 14
 
15
-    $route->group('auth', function ($route) {
15
+    $route->group('auth', function($route) {
16 16
         $route->get('[:alpha:2]?/me', 'AuthController', 'me');
17 17
         $route->get('[:alpha:2]?/signout', 'AuthController', 'signout')->middlewares(['Signout']);
18 18
         $route->get('[:alpha:2]?/my-posts', 'PostController', 'myPosts')->middlewares(['Editor']);
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Middlewares/Activate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $token = (string) route_param('token');
40 40
 
41 41
         if (!$this->checkToken($token)) {
42
-            stop(function () use ($response) {
42
+            stop(function() use ($response) {
43 43
                 $response->html(partial('errors/404'), 404);
44 44
             });
45 45
         }
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Middlewares/Verify.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,10 +65,10 @@
 block discarded – undo
65 65
                 redirectWith(base_url(true) . '/' . current_lang() . '/verify', $request->all());
66 66
             }
67 67
         } else {
68
-            $token = (string)route_param('code');
68
+            $token = (string) route_param('code');
69 69
 
70 70
             if (!$this->checkToken($token)) {
71
-                stop(function () use ($response) {
71
+                stop(function() use ($response) {
72 72
                     $response->html(partial('errors/404'), 404);
73 73
                 });
74 74
             }
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Middlewares/Signup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $this->validator = new Validator();
45 45
 
46
-        $this->validator->addValidation('uniqueUser', function ($value) {
46
+        $this->validator->addValidation('uniqueUser', function($value) {
47 47
             $userModel = ModelFactory::get(User::class);
48 48
             return empty($userModel->findOneBy('email', $value)->asArray());
49 49
         });
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         if ($request->isMethod('post')) {
83 83
             $captchaName = captcha()->getName();
84 84
 
85
-            if($request->has($captchaName . '-response')) {
85
+            if ($request->has($captchaName . '-response')) {
86 86
                 $request->set('captcha', $request->get($captchaName . '-response'));
87 87
                 $request->delete($captchaName . '-response');
88 88
             }
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Controllers/PostController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
      * @param Response $response
128 128
      * @param ViewFactory $view
129 129
      */
130
-    public function myPosts(Request $request, Response $response, PostTransformer $transformer,ViewFactory $view)
130
+    public function myPosts(Request $request, Response $response, PostTransformer $transformer, ViewFactory $view)
131 131
     {
132
-        $myPosts = $this->postService->getMyPosts((int)auth()->user()->id);
132
+        $myPosts = $this->postService->getMyPosts((int) auth()->user()->id);
133 133
         
134 134
         $view->setParams([
135 135
             'title' => t('common.my_posts') . ' | ' . config()->get('app_name'),
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     public function create(Request $request)
163 163
     {
164 164
         $postData = [
165
-            'user_id' => (int)auth()->user()->id,
165
+            'user_id' => (int) auth()->user()->id,
166 166
             'title' => $request->get('title', null, true),
167 167
             'content' => $request->get('content', null, true),
168 168
             'image' => '',
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
         if ($request->hasFile('image')) {
224 224
             if ($post->image) {
225
-                $this->postService->deleteImage(auth()->user()->uuid . DS .  $post->image);
225
+                $this->postService->deleteImage(auth()->user()->uuid . DS . $post->image);
226 226
             }
227 227
 
228 228
             $imageName = $this->postService->saveImage(
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Controllers/AuthController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@
 block discarded – undo
192 192
     {
193 193
         if ($request->isMethod('post')) {
194 194
             try {
195
-                auth()->verifyOtp((int)$request->get('otp'), $request->get('code'));
195
+                auth()->verifyOtp((int) $request->get('otp'), $request->get('code'));
196 196
                 redirect(base_url(true) . '/' . current_lang());
197 197
             } catch (AuthException $e) {
198 198
                 session()->setFlash('error', $e->getMessage());
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Config/routes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($route) {
3
+return function($route) {
4 4
     $route->get('[:alpha:2]?', 'PageController', 'home')->name('home');
5 5
     $route->get('[:alpha:2]?/about', 'PageController', 'about')->name('about');
6 6
 
7 7
     $route->get('[:alpha:2]?/posts', 'PostController', 'posts')->name('posts');
8 8
     $route->get('[:alpha:2]?/post/[id=:any]', 'PostController', 'post');
9 9
 
10
-    $route->group('guest', function ($route) {
10
+    $route->group('guest', function($route) {
11 11
         $route->add('[:alpha:2]?/signin', 'GET|POST', 'AuthController', 'signin')->name('signin');
12 12
         $route->add('[:alpha:2]?/signup', 'GET|POST', 'AuthController', 'signup')->middlewares(['Signup'])->name('signup');
13 13
         $route->get('[:alpha:2]?/activate/[token=:any]', 'AuthController', 'activate')->middlewares(['Activate']);
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $route->add('[:alpha:2]?/verify/[code=:any]?', 'GET|POST', 'AuthController', 'verify')->middlewares(['Verify']);
18 18
     })->middlewares(['Guest']);
19 19
 
20
-    $route->group('auth', function ($route) {
20
+    $route->group('auth', function($route) {
21 21
         $route->get('[:alpha:2]?/signout', 'AuthController', 'signout');
22 22
         $route->get('[:alpha:2]?/my-posts', 'PostController', 'myPosts')->middlewares(['Editor']);
23 23
         $route->get('[:alpha:2]?/my-posts/create', 'PostController', 'createFrom')->middlewares(['Editor']);
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Views/partials/sidebar.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@  discard block
 block discarded – undo
30 30
             </li>
31 31
         </ul>
32 32
     </li>
33
-    <?php else : ?>
33
+    <?php else {
34
+    : ?>
34 35
         <?php if (route_name() != 'signup') : ?>
35 36
             <li>
36 37
                 <a href="<?php echo base_url(true) . '/' . current_lang() ?>/signup">
@@ -38,7 +39,9 @@  discard block
 block discarded – undo
38 39
                     <?php _t('common.signup') ?>
39 40
                 </a>
40 41
             </li>
41
-        <?php endif; ?>
42
+        <?php endif;
43
+}
44
+?>
42 45
         <?php if (route_name() != 'signin') : ?>
43 46
             <li>
44 47
                 <a href="<?php echo base_url(true) . '/' . current_lang() ?>/signin">
Please login to merge, or discard this patch.
src/Libraries/Module/Templates/Demo/Web/Views/partials/messages/error.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,11 @@
 block discarded – undo
9 9
                     <?php endforeach; ?>
10 10
                 <?php endforeach; ?>
11 11
             </ul>
12
-        <?php else: ?>
12
+        <?php else {
13
+    : ?>
13 14
             <?php echo $error ?>
14
-        <?php endif; ?>
15
+        <?php endif;
16
+}
17
+?>
15 18
     <?php endif; ?>
16 19
 </div>';
17 20
\ No newline at end of file
Please login to merge, or discard this patch.