Test Failed
Push — master ( 4aac7f...6a48a0 )
by Mihail
06:45
created
Apps/Controller/Admin/Content/Boot.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public static function boot(): void
27 27
     {
28
-        App::$Event->on(Main::SEARCH_EVENT_NAME, function ($model) {
28
+        App::$Event->on(Main::SEARCH_EVENT_NAME, function($model) {
29 29
             /** @var CollectionSearchResults $model */
30 30
             $limit = $model->getLimit();
31 31
             $query = $model->getQuery();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 $res->setTitle($title);
52 52
                 $res->setSnippet($snippet);
53 53
                 $res->setDate($item->created_at);
54
-                $res->setRelevance((int)$item->relevance);
54
+                $res->setRelevance((int) $item->relevance);
55 55
                 $res->setUrl('content/update', [$item->id]);
56 56
                 $res->setMarker('Content');
57 57
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                 $res->setTitle($title);
79 79
                 $res->setSnippet($snippet);
80 80
                 $res->setDate($item->created_at);
81
-                $res->setRelevance((int)$item->relevance);
81
+                $res->setRelevance((int) $item->relevance);
82 82
                 $res->setUrl('content/categoryupdate', [$item->id]);
83 83
                 $res->setMarker('Content');
84 84
 
Please login to merge, or discard this patch.
Apps/Controller/Front/Content/Boot.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public static function boot(): void
27 27
     {
28
-        App::$Event->on(Search::EVENT_SEARCH_RUN, function ($model) {
28
+        App::$Event->on(Search::EVENT_SEARCH_RUN, function($model) {
29 29
             /** @var EntitySearchMain $model */
30
-            $limit = (int)$model->getConfigs()['itemPerApp'];
30
+            $limit = (int) $model->getConfigs()['itemPerApp'];
31 31
             if ($limit < 1) {
32 32
                 $limit = 1;
33 33
             }
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
                 $res->setTitle($title);
55 55
                 $res->setSnippet($snippet);
56 56
                 $res->setDate($item->created_at);
57
-                $res->setRelevance((int)$item->relevance);
58
-                $res->setUri('/content/read/' . $item->getPath());
57
+                $res->setRelevance((int) $item->relevance);
58
+                $res->setUri('/content/read/'.$item->getPath());
59 59
 
60 60
                 $model->add($res);
61 61
             });
Please login to merge, or discard this patch.
Apps/Controller/Front/Comments.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function boot(): void
26 26
     {
27
-        App::$Event->on(Search::EVENT_SEARCH_RUN, function ($model) {
27
+        App::$Event->on(Search::EVENT_SEARCH_RUN, function($model) {
28 28
             /** @var EntitySearchMain $model */
29
-            $limit = (int)$model->getConfigs()['itemPerApp'];
29
+            $limit = (int) $model->getConfigs()['itemPerApp'];
30 30
             if ($limit < 1) {
31 31
                 $limit = 1;
32 32
             }
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
                 $instance = new AbstractSearchResult();
47 47
                 $instance->setTitle(App::$Translate->get('Search', 'Comment on the page'));
48 48
                 $instance->setSnippet($snippet);
49
-                $instance->setUri('/' . $item->app_name . '/comments/' . $item->app_relation_id);
49
+                $instance->setUri('/'.$item->app_name.'/comments/'.$item->app_relation_id);
50 50
                 $instance->setDate($item->created_at);
51
-                $instance->setRelevance((int)$item->relevance);
51
+                $instance->setRelevance((int) $item->relevance);
52 52
 
53 53
                 // add instance to result set
54 54
                 $model->add($instance);
Please login to merge, or discard this patch.
Apps/Controller/Front/Search.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
     public function actionIndex()
27 27
     {
28 28
         // get search query value from GET headers
29
-        $query = (string)$this->request->query->get('query', null);
29
+        $query = (string) $this->request->query->get('query', null);
30 30
         // strip html tags
31 31
         $query = App::$Security->strip_tags(trim($query));
32 32
         // get configs
33 33
         $configs = $this->getConfigs();
34 34
 
35 35
         // check search query length
36
-        if (!Any::isStr($query) || Str::likeEmpty($query) || Str::length($query) < (int)$configs['minLength']) {
36
+        if (!Any::isStr($query) || Str::likeEmpty($query) || Str::length($query) < (int) $configs['minLength']) {
37 37
             throw new NotFoundException(__('Search query is too short!'));
38 38
         }
39 39
 
Please login to merge, or discard this patch.
Apps/View/Front/default/search/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         <div class="col-md-12">
45 45
             <div class="search-result">
46 46
                 <div class="h4">
47
-                    <a href="<?= \App::$Alias->baseUrl . $item->getUri() ?>"><?= $model->highlightText($item->getTitle(), 'span', ['class' => 'search-highlight']) ?></a>
47
+                    <a href="<?= \App::$Alias->baseUrl.$item->getUri() ?>"><?= $model->highlightText($item->getTitle(), 'span', ['class' => 'search-highlight']) ?></a>
48 48
                     <small class="float-right text-secondary"><?= $item->getDate() ?></small>
49 49
                 </div>
50 50
                 <small><?= $model->highlightText($item->getSnippet(), 'span', ['class' => 'search-highlight']) ?>...</small>
Please login to merge, or discard this patch.
Apps/Model/Admin/Main/CollectionSearchResults.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             /** @var AbstractSearchItem $item */
73 73
             // build unique relevance. Problem: returned relevance from query is integer
74 74
             // and can be duplicated. So, we add random complex float value and make it string to sort in feature
75
-            $uniqueRelevance = (string)($item->getRelevance() + (mt_rand(0, 999) / 10000));
75
+            $uniqueRelevance = (string) ($item->getRelevance() + (mt_rand(0, 999) / 10000));
76 76
             // build response
77 77
             $result[$uniqueRelevance] = $item;
78 78
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $queries = explode(' ', $this->query);
97 97
         $dom = new Dom();
98 98
         foreach ($queries as $query) {
99
-            $highlight = $dom->{$tag}(function () use ($query) {
99
+            $highlight = $dom->{$tag}(function() use ($query) {
100 100
                 return $query;
101 101
             }, $properties);
102 102
             $text = Str::ireplace($query, $highlight, $text);
Please login to merge, or discard this patch.
Apps/Model/Front/Search/EntitySearchMain.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             /** @var AbstractSearchResult $item */
61 61
             // build unique relevance. Problem: returned relevance from query is integer
62 62
             // and can be duplicated. So, we add random complex float value and make it string to sort in feature
63
-            $uniqueRelevance = (string)($item->getRelevance() + (mt_rand(0, 999) / 10000));
63
+            $uniqueRelevance = (string) ($item->getRelevance() + (mt_rand(0, 999) / 10000));
64 64
             // build response
65 65
             $result[$uniqueRelevance] = $item;
66 66
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $queries = explode(' ', $this->query);
85 85
         $dom = new Dom();
86 86
         foreach ($queries as $query) {
87
-            $highlight = $dom->{$tag}(function () use ($query) {
87
+            $highlight = $dom->{$tag}(function() use ($query) {
88 88
                 return $query;
89 89
             }, $properties);
90 90
             $text = Str::ireplace($query, $highlight, $text);
Please login to merge, or discard this patch.
Apps/View/Admin/default/main/yandex_connect.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
 <?php if ($model->appid && !\Ffcms\Core\Helper\Type\Any::isEmpty($model->appid)): ?>
42 42
     <?= $this->bootstrap()->button('a', __('Get Yandex.Metrika token'), [
43
-        'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id=' . $model->appid . '&redirect_uri=' . Url::to('main/yandextoken'),
43
+        'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id='.$model->appid.'&redirect_uri='.Url::to('main/yandextoken'),
44 44
         'class' => 'btn-success'
45 45
     ]) ?>
46 46
 <?php else: ?>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,9 +43,12 @@
 block discarded – undo
43 43
         'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id=' . $model->appid . '&redirect_uri=' . Url::to('main/yandextoken'),
44 44
         'class' => 'btn-success'
45 45
     ]) ?>
46
-<?php else: ?>
46
+<?php else {
47
+    : ?>
47 48
     <?= $this->bootstrap()->alert('warning', __('Create oauth application before get token')) ?>
48
-<?php endif; ?>
49
+<?php endif;
50
+}
51
+?>
49 52
 
50 53
 <?= $form->stop() ?>
51 54
 
Please login to merge, or discard this patch.
Apps/View/Admin/default/main/index.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         <h3><?= __('Directories and files') ?></h3>
57 57
         <?php
58 58
         foreach ($check->chmodCheck as $dir => $status) {
59
-            echo $this->bootstrap()->badge(($status ? 'success' : 'danger'), $dir) . "&nbsp;";
59
+            echo $this->bootstrap()->badge(($status ? 'success' : 'danger'), $dir)."&nbsp;";
60 60
         }
61 61
         ?>
62 62
         <hr />
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     var visitChart = new Chart(visitElement, {
135 135
         type: 'line',
136 136
         data: {
137
-            labels: [<?php foreach ($dates as $date){ echo '"' . $date . '", '; } ?>],
137
+            labels: [<?php foreach ($dates as $date) { echo '"'.$date.'", '; } ?>],
138 138
             datasets: [{
139 139
                 yAxisID: 'units',
140 140
                 label: '<?= __('Views') ?>',
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     var sourceChart = new Chart(sourcesElement, {
182 182
         type: 'pie',
183 183
         data: {
184
-            labels: [<?php foreach ($sourceTypes as $type){ echo '"' . $type . '", '; } ?>],
184
+            labels: [<?php foreach ($sourceTypes as $type) { echo '"'.$type.'", '; } ?>],
185 185
             datasets: [{
186 186
                 data: [<?= implode(',', $sourceUsers) ?>],
187 187
                 label: 'Users',
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,8 @@  discard block
 block discarded – undo
82 82
                 'href' => Url::to('main/yandexconnect'),
83 83
                 'class' => 'btn-danger'
84 84
             ]) ?>
85
-        <?php else: ?>
85
+        <?php else {
86
+    : ?>
86 87
             <div class="row">
87 88
                 <div class="col-md-8">
88 89
                     <canvas id="visitChart" width="100%" height="50"></canvas>
@@ -91,7 +92,9 @@  discard block
 block discarded – undo
91 92
                     <canvas id="sourcesChart" width="100%" height="90"></canvas>
92 93
                 </div>
93 94
             </div>
94
-        <?php endif; ?>
95
+        <?php endif;
96
+}
97
+?>
95 98
     </div>
96 99
 </div>
97 100
 
Please login to merge, or discard this patch.