@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | if (!$this->count) { |
40 | - $this->count = (int)$cfg['count']; |
|
40 | + $this->count = (int) $cfg['count']; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if (!$this->cache) { |
44 | - $this->cache = (int)$cfg['cache']; |
|
44 | + $this->cache = (int) $cfg['cache']; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (!$this->lang) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | - $this->_cacheName = 'widget.newcomment.' . $this->createStringClassSnapshotHash(); |
|
52 | + $this->_cacheName = 'widget.newcomment.'.$this->createStringClassSnapshotHash(); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | { |
63 | 63 | // work with cache and make query |
64 | 64 | $records = null; |
65 | - if ((int)$this->cache > 0) { |
|
65 | + if ((int) $this->cache > 0) { |
|
66 | 66 | // process caching data |
67 | 67 | $cache = App::$Cache->getItem($this->_cacheName); |
68 | 68 | if (!$cache->isHit()) { |
69 | 69 | $cache->set($this->makeQuery()); |
70 | - $cache->expiresAfter((int)$this->cache); |
|
70 | + $cache->expiresAfter((int) $this->cache); |
|
71 | 71 | App::$Cache->save($cache); |
72 | 72 | } |
73 | 73 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ->where('moderate', false); |
104 | 104 | |
105 | 105 | $cfg = AppRecord::getConfigs('widget', 'Comments'); |
106 | - if ((bool)$cfg['onlyLocale']) { |
|
106 | + if ((bool) $cfg['onlyLocale']) { |
|
107 | 107 | $records->where('lang', $this->lang); |
108 | 108 | } |
109 | 109 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | ])->row([ |
33 | 33 | ['text' => $model->getUser()->id], |
34 | 34 | ['text' => $model->getUser()->email], |
35 | - ['text' => $model->getUser()->profile->nick ?? 'id' . $model->getUser()->id], |
|
35 | + ['text' => $model->getUser()->profile->nick ?? 'id'.$model->getUser()->id], |
|
36 | 36 | ['text' => Date::convertToDatetime($model->getUser()->created_at, Date::FORMAT_TO_HOUR)], |
37 | 37 | ])->display() ?> |
38 | 38 | </div> |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public static function boot(): void |
24 | 24 | { |
25 | - App::$Event->on(Main::SEARCH_EVENT_NAME, function ($model) { |
|
25 | + App::$Event->on(Main::SEARCH_EVENT_NAME, function($model) { |
|
26 | 26 | /** @var CollectionSearchResults $model */ |
27 | 27 | $records = User::with('profile') |
28 | 28 | ->search($model->getQuery()) |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | /** @var User[]|Collection $records */ |
33 | 33 | $records->each(function($item) use ($model) { |
34 | 34 | /** @var User $item */ |
35 | - $title = $item->email . '(id=' . $item->id . ')'; |
|
35 | + $title = $item->email.'(id='.$item->id.')'; |
|
36 | 36 | $text = App::$Translate->get('User', 'Email: %email%, nick: %nick%', [ |
37 | 37 | 'email' => $item->email, |
38 | - 'nick' => $item->profile->nick ?? 'id' . $item->id |
|
38 | + 'nick' => $item->profile->nick ?? 'id'.$item->id |
|
39 | 39 | ]); |
40 | 40 | |
41 | 41 | // initialize abstract response pattern |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $res->setTitle($title); |
44 | 44 | $res->setSnippet($text); |
45 | 45 | $res->setDate($item->created_at); |
46 | - $res->setRelevance((int)$item->relevance); |
|
46 | + $res->setRelevance((int) $item->relevance); |
|
47 | 47 | $res->setUrl('user/update', [$item->id]); |
48 | 48 | $res->setMarker('User'); |
49 | 49 |
@@ -30,11 +30,11 @@ |
||
30 | 30 | // check if search query passed |
31 | 31 | $query = $this->request->query->get('search', null); |
32 | 32 | if ($query && Any::isStr($query) && Str::length($query) > 1) { |
33 | - $record = $record->where('email', 'like', '%' . $query . '%'); |
|
33 | + $record = $record->where('email', 'like', '%'.$query.'%'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // set current page num and offset |
37 | - $page = (int)$this->request->query->get('page', 0); |
|
37 | + $page = (int) $this->request->query->get('page', 0); |
|
38 | 38 | $offset = $page * self::ITEM_PER_PAGE; |
39 | 39 | |
40 | 40 | // prepare pagination data |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public function up() |
18 | 18 | { |
19 | 19 | // set nullable varchar type for token column |
20 | - $this->getSchema()->table('users', function($table){ |
|
20 | + $this->getSchema()->table('users', function($table) { |
|
21 | 21 | $table->string('approve_token', 128)->nullable()->default(null)->change(); |
22 | 22 | }); |
23 | 23 | // set approve_token = null where it like '0' str or '' |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | }); |
32 | 32 | } |
33 | 33 | if (!$this->getSchema()->hasColumn('comment_answers', 'app_relation_id')) { |
34 | - $this->getSchema()->table('comment_answers', function($table){ |
|
34 | + $this->getSchema()->table('comment_answers', function($table) { |
|
35 | 35 | $table->integer('app_relation_id')->unsigned()->default(0)->after('app_name'); |
36 | 36 | }); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | // @todo: add algo to find app_name & app_id for oldest comments |
43 | 43 | if ($this->getSchema()->hasColumn('comment_posts', 'pathway')) { |
44 | - $this->getSchema()->table('comment_posts', function($table){ |
|
44 | + $this->getSchema()->table('comment_posts', function($table) { |
|
45 | 45 | $table->dropColumn('pathway'); |
46 | 46 | }); |
47 | 47 | } |