@@ -25,9 +25,9 @@ discard block |
||
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 |
||
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 | }); |
@@ -24,9 +24,9 @@ discard block |
||
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 |
||
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); |
@@ -26,14 +26,14 @@ |
||
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 |
@@ -44,7 +44,7 @@ |
||
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> |
@@ -72,7 +72,7 @@ discard block |
||
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 |
||
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); |
@@ -60,7 +60,7 @@ discard block |
||
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 |
||
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); |
@@ -40,7 +40,7 @@ |
||
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: ?> |
@@ -56,7 +56,7 @@ discard block |
||
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) . " "; |
|
59 | + echo $this->bootstrap()->badge(($status ? 'success' : 'danger'), $dir)." "; |
|
60 | 60 | } |
61 | 61 | ?> |
62 | 62 | <hr /> |
@@ -134,7 +134,7 @@ discard block |
||
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 |
||
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', |
@@ -28,7 +28,7 @@ |
||
28 | 28 | <div class="row object-lightborder ml-1" id="wall-post-<?= $post->id ?>"> |
29 | 29 | <div class="col-xs-4 col-md-2"> |
30 | 30 | <div class="text-center"> |
31 | - <?= Url::a(['profile/show', [$post->sender_id]], $post->senderUser->profile->getNickname(), ['style' => 'color: ' . $post->senderUser->role->color]) ?> |
|
31 | + <?= Url::a(['profile/show', [$post->sender_id]], $post->senderUser->profile->getNickname(), ['style' => 'color: '.$post->senderUser->role->color]) ?> |
|
32 | 32 | <img class="img-fluid img-rounded" alt="Avatar of <?= $post->senderUser->profile->getNickname() ?>" src="<?= $post->senderUser->profile->getAvatarUrl('small') ?>" /> |
33 | 33 | <div class="text-muted"><?= Date::humanize($post->updated_at); ?></div> |
34 | 34 | </div> |