Test Failed
Push — master ( c2af76...a0e4e3 )
by Mihail
05:19
created
Apps/Controller/Admin/Comments/ActionPublish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function publish(string $type, ?string $id = null): ?string
33 33
     {
34 34
         // check if it multiple accept ids
35
-        if (!$id || (int)$id < 1) {
35
+        if (!$id || (int) $id < 1) {
36 36
             $ids = $this->request->query->get('selected');
37 37
             if (!Any::isArray($ids) || !Arr::onlyNumericValues($ids)) {
38 38
                 throw new NotFoundException('Bad conditions');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         if ($model->send()) {
66 66
             $model->make();
67 67
             App::$Session->getFlashBag()->add('success', __('Comments or answers are successful published'));
68
-            $this->response->redirect('comments/' . ($type === 'answer' ? 'answerlist' : 'index'));
68
+            $this->response->redirect('comments/'.($type === 'answer' ? 'answerlist' : 'index'));
69 69
         }
70 70
 
71 71
         return $this->view->render('comments/publish', [
Please login to merge, or discard this patch.
Apps/Controller/Admin/Comments/ActionAnswerList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function answerList(): ?string
24 24
     {
25 25
         // set current page and offset
26
-        $page = (int)$this->request->query->get('page');
26
+        $page = (int) $this->request->query->get('page');
27 27
         $offset = $page * self::ITEM_PER_PAGE;
28 28
 
29 29
         // get result as active records object with offset
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 foreach ($records as $item) {
47 47
     $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75);
48 48
 
49
-    $moderate = (bool)$item->moderate;
49
+    $moderate = (bool) $item->moderate;
50 50
     // if even one moderate item is found - change global flag to true
51 51
     if ($moderate) {
52 52
         $moderateIsFound = true;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     $table->row([
67 67
         ['text' => $item->id],
68 68
         ['text' => Url::a(['comments/read', [$item->id]], $message), 'html' => true],
69
-        ['text' => '<span class="badge badge-light">' . $item->getAnswerCount() . '</span>', 'html' => true],
70
-        ['text' => Simplify::parseUserLink((int)$item->user_id, $item->guest_name, 'user/update'), 'html' => true],
71
-        ['text' => '<a href="'.Url::stringUrl($item->app_name . '/comments/' . $item->app_relation_id).'" target="_blank">' . $item->app_name . '/' . $item->app_relation_id . '</a>', 'html' => true],
69
+        ['text' => '<span class="badge badge-light">'.$item->getAnswerCount().'</span>', 'html' => true],
70
+        ['text' => Simplify::parseUserLink((int) $item->user_id, $item->guest_name, 'user/update'), 'html' => true],
71
+        ['text' => '<a href="'.Url::stringUrl($item->app_name.'/comments/'.$item->app_relation_id).'" target="_blank">'.$item->app_name.'/'.$item->app_relation_id.'</a>', 'html' => true],
72 72
         ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)],
73 73
         ['text' => $btngrp->display(), 'html' => true
74 74
         ],
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/answer_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 foreach ($records as $item) {
46 46
     /** @var \Apps\ActiveRecord\CommentAnswer $item */
47 47
     $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75);
48
-    $moderate = (bool)$item->moderate;
48
+    $moderate = (bool) $item->moderate;
49 49
     if ($moderate) {
50 50
         $moderateIsFound = true;
51 51
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 
62 62
     $table->row([
63 63
         ['text' => $item->id],
64
-        ['text' => '<div>' . Url::a(['comments/read', [$item->comment_id]], $message) . '</div><small class="text-muted">&rarr;' . Text::snippet(\App::$Security->strip_tags($item->post->message), 50) . '</small>' , 'html' => true],
65
-        ['text' => Simplify::parseUserLink((int)$item->user_id, $item->guest_name, 'user/update'), 'html' => true],
64
+        ['text' => '<div>'.Url::a(['comments/read', [$item->comment_id]], $message).'</div><small class="text-muted">&rarr;'.Text::snippet(\App::$Security->strip_tags($item->post->message), 50).'</small>', 'html' => true],
65
+        ['text' => Simplify::parseUserLink((int) $item->user_id, $item->guest_name, 'user/update'), 'html' => true],
66 66
         ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)],
67 67
         ['text' => $btngrp->display(), 'html' => true
68 68
         ]
Please login to merge, or discard this patch.
Apps/View/Admin/default/comments/read.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             $author = Url::a(['user/update', [$record->user_id]], $author);
32 32
         }
33 33
         ?>
34
-        <?= $author . ', ' . Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>
34
+        <?= $author.', '.Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>
35 35
         <div class="pull-right">
36 36
             <?php
37 37
             $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm']);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             ?>
45 45
         </div>
46 46
     </div>
47
-    <div class="card-body<?= ((bool)$record->moderate ? ' text-warning' : null) ?>">
47
+    <div class="card-body<?= ((bool) $record->moderate ? ' text-warning' : null) ?>">
48 48
         <?= $record->message ?>
49 49
     </div>
50 50
 </div>
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             <?php
65 65
             $answerAuthor = Simplify::parseUserLink($answer->user_id, $answer->guest_name, 'user/update');
66 66
             ?>
67
-            <?= $answerAuthor . ', ' . Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?>
67
+            <?= $answerAuthor.', '.Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?>
68 68
             <div class="pull-right">
69 69
                 <?php
70 70
                 $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm']);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 ?>
78 78
             </div>
79 79
         </div>
80
-        <div class="card-body<?= ((bool)$answer->moderate ? ' text-warning' : null)?>">
80
+        <div class="card-body<?= ((bool) $answer->moderate ? ' text-warning' : null)?>">
81 81
             <?= $answer->message ?>
82 82
         </div>
83 83
     </div>
Please login to merge, or discard this patch.
Apps/Controller/Admin/Contenttag.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         
35 35
         // render view output
36 36
         return $this->view->render('contenttag/index', [
37
-           'model' => $model
37
+            'model' => $model
38 38
         ]);
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
Apps/Controller/Front/Content/ScheduledActions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
         }
40 40
 
41 41
         // build sitemap items using iteration - 5000 rows per each one
42
-        $iterations = (int)($contentCount / self::$contentRowsEachRun);
42
+        $iterations = (int) ($contentCount / self::$contentRowsEachRun);
43 43
         for ($i = 0; $i <= $iterations; $i++) {
44 44
             // check if lifetime is expired for current sitemap index
45
-            $xmlTime = File::mTime('/upload/sitemap/content.' . $i . '.' . $langs[0] . '.xml');
45
+            $xmlTime = File::mTime('/upload/sitemap/content.'.$i.'.'.$langs[0].'.xml');
46 46
             $updateDelay = self::$updateSitemapDelay * 60;
47 47
             $updateDelay += mt_rand(0, 1800); // +- 0-30 rand min for caching update
48 48
             // do not process if cache time is not expired
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 /** @var \Apps\ActiveRecord\Content $content */
63 63
                 $uri = '/content/read/';
64 64
                 if (!Str::likeEmpty($content->category->path)) {
65
-                    $uri .= $content->category->path . '/';
65
+                    $uri .= $content->category->path.'/';
66 66
                 }
67 67
                 $uri .= $content->path;
68 68
                 $sitemap->add($uri, $content->created_at, 'weekly', 0.7);
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
             // add categories
71 71
             $categories = ContentCategory::all();
72 72
             foreach ($categories as $item) {
73
-                if ((bool)$item->getProperty('showCategory')) {
74
-                    $uri = '/content/list/' . $item->path;
73
+                if ((bool) $item->getProperty('showCategory')) {
74
+                    $uri = '/content/list/'.$item->path;
75 75
                     $sitemap->add($uri, date('c'), 'daily', 0.9);
76 76
                 }
77 77
             }
78 78
             // save data to xml file
79
-            $sitemap->save('content.' . $i);
79
+            $sitemap->save('content.'.$i);
80 80
         }
81 81
     }
82 82
 }
Please login to merge, or discard this patch.
Widgets/Front/Contenttag/Contenttag.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $cfg = $this->getConfigs();
35 35
         // check cache is defined
36
-        if (!$this->cache|| !Any::isInt($this->cache)) {
37
-            $this->cache = (int)$cfg['cache'];
36
+        if (!$this->cache || !Any::isInt($this->cache)) {
37
+            $this->cache = (int) $cfg['cache'];
38 38
         }
39 39
 
40 40
         // check tag count is defined
41 41
         if (!$this->count || !Any::isInt($this->count)) {
42
-            $this->count = (int)$cfg['count'];
42
+            $this->count = (int) $cfg['count'];
43 43
         }
44 44
 
45 45
         $this->_lang = App::$Request->getLanguage();
46
-        $this->_cacheName = 'widget.contenttag.' . $this->createStringClassSnapshotHash();
46
+        $this->_cacheName = 'widget.contenttag.'.$this->createStringClassSnapshotHash();
47 47
     }
48 48
 
49 49
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         } else {
61 61
             $cache = App::$Cache->getItem($this->_cacheName);
62 62
             if (!$cache->isHit()) {
63
-                $cache->set($this->makeQuery())->expiresAfter((int)$this->cache);
63
+                $cache->set($this->makeQuery())->expiresAfter((int) $this->cache);
64 64
                 App::$Cache->save($cache);
65 65
             }
66 66
             $records = $cache->get();
Please login to merge, or discard this patch.
Extend/Core/Arch/AdminController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
         $user = App::$User->identity();
93 93
         // user is not authed ?
94 94
         if (!$user || !App::$User->isAuth()) {
95
-            $redirectUrl = App::$Alias->scriptUrl . '/user/login';
95
+            $redirectUrl = App::$Alias->scriptUrl.'/user/login';
96 96
             App::$Response->redirect($redirectUrl, true);
97 97
             exit();
98 98
         }
99 99
 
100
-        $permission = env_name . '/' . App::$Request->getController() . '/' . App::$Request->getAction();
100
+        $permission = env_name.'/'.App::$Request->getController().'/'.App::$Request->getAction();
101 101
         // doesn't have permission? get the f*ck out
102 102
         if (!$user->role->can($permission)) {
103 103
             throw new ForbiddenException(__('You got no access rights to this page'));
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function getConfigs(): ?array
149 149
     {
150
-        $configs = $this->type === 'widget' ? (array)$this->widget->configs : (array)$this->application->configs;
150
+        $configs = $this->type === 'widget' ? (array) $this->widget->configs : (array) $this->application->configs;
151 151
         foreach ($configs as $cfg => $value) {
152 152
             if (Any::isInt($value)) {
153 153
                 $configs[$cfg] = $value;
Please login to merge, or discard this patch.