@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function make() |
38 | 38 | { |
39 | - $itemCount = (int)$this->_configs['itemPerApp']; |
|
39 | + $itemCount = (int) $this->_configs['itemPerApp']; |
|
40 | 40 | // search content items |
41 | 41 | $content = new SearchContent($this->query, $itemCount); |
42 | 42 | $this->results['Content'] = $content->getResult(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** @var AbstractSearchResult $item */ |
64 | 64 | // build unique relevance. Problem: returned relevance from query is integer |
65 | 65 | // and can be duplicated. So, we add random complex float value and make it string to sort in feature |
66 | - $uniqueRelevance = (string)($item->getRelevance() + (mt_rand(0, 999)/10000)); |
|
66 | + $uniqueRelevance = (string) ($item->getRelevance() + (mt_rand(0, 999) / 10000)); |
|
67 | 67 | // build response |
68 | 68 | $result[$uniqueRelevance] = [ |
69 | 69 | 'title' => $item->getTitle(), |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $queries = explode(' ', $this->query); |
94 | 94 | $dom = new Dom(); |
95 | 95 | foreach ($queries as $query) { |
96 | - $highlight = $dom->{$tag}(function () use ($query) { |
|
96 | + $highlight = $dom->{$tag}(function() use ($query) { |
|
97 | 97 | return $query; |
98 | 98 | }, $properties); |
99 | 99 | $text = Str::ireplace($query, $highlight, $text); |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $scan = File::listFiles(static::INDEX_PATH, ['.xml'], true); |
49 | 49 | if (Any::isArray($scan)) { |
50 | 50 | foreach ($scan as $file) { |
51 | - if ($this->_lang !== null && !Str::contains('.' . $this->_lang, $file)) { |
|
51 | + if ($this->_lang !== null && !Str::contains('.'.$this->_lang, $file)) { |
|
52 | 52 | continue; |
53 | 53 | } |
54 | 54 | |
55 | - $this->files[] = static::INDEX_PATH . '/' . $file; |
|
55 | + $this->files[] = static::INDEX_PATH.'/'.$file; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // build file information data |
70 | 70 | foreach ($this->files as $file) { |
71 | 71 | $this->info[] = [ |
72 | - 'loc' => App::$Alias->scriptUrl . $file, |
|
72 | + 'loc' => App::$Alias->scriptUrl.$file, |
|
73 | 73 | 'lastmod' => Date::convertToDatetime(File::mTime($file), 'c') |
74 | 74 | ]; |
75 | 75 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function __construct($captcha = true) |
30 | 30 | { |
31 | - $this->_useCaptcha = (bool)$captcha; |
|
31 | + $this->_useCaptcha = (bool) $captcha; |
|
32 | 32 | parent::__construct(); |
33 | 33 | } |
34 | 34 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if ($this->_content->id === null) { |
60 | 60 | $this->_new = true; |
61 | 61 | if (!$this->galleryFreeId) { |
62 | - $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32)); |
|
62 | + $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32)); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (!$this->authorId) { |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | public function rules(): array |
95 | 95 | { |
96 | 96 | $res = [ |
97 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
98 | - ['text.' . App::$Request->getLanguage(), 'required'], |
|
97 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
98 | + ['text.'.App::$Request->getLanguage(), 'required'], |
|
99 | 99 | ['text', 'used'], |
100 | 100 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
101 | 101 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'], |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | ]; |
109 | 109 | |
110 | 110 | foreach (App::$Properties->get('languages') as $lang) { |
111 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
112 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
113 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
111 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
112 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
113 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $res; |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | $this->_content->meta_keywords = $this->metaKeywords; |
167 | 167 | $this->_content->meta_description = $this->metaDescription; |
168 | 168 | $this->_content->source = $this->source; |
169 | - $this->_content->important = (int)$this->important; |
|
169 | + $this->_content->important = (int) $this->important; |
|
170 | 170 | // check if rating is changed |
171 | - if ((int)$this->addRating !== 0) { |
|
172 | - $this->_content->rating += (int)$this->addRating; |
|
171 | + if ((int) $this->addRating !== 0) { |
|
172 | + $this->_content->rating += (int) $this->addRating; |
|
173 | 173 | } |
174 | 174 | // check if special comment hash is exist |
175 | 175 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | // save poster data |
185 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
185 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
186 | 186 | if (File::exist($posterPath)) { |
187 | 187 | $this->_content->poster = $this->poster; |
188 | 188 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | // move files |
219 | 219 | if ($tmpGalleryId !== $this->_content->id) { |
220 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
220 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ]; |
113 | 113 | |
114 | 114 | // general category |
115 | - if ($this->_new === false && (int)$this->_record->id === 1) { |
|
115 | + if ($this->_new === false && (int) $this->_record->id === 1) { |
|
116 | 116 | $rules[] = ['path', 'used']; |
117 | 117 | } else { |
118 | 118 | $rules[] = ['path', 'required']; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
122 | 122 | } |
123 | 123 | |
124 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
124 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
125 | 125 | |
126 | 126 | |
127 | 127 | return $rules; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $this->_record->title = $this->title; |
136 | 136 | $this->_record->description = $this->description; |
137 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
137 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
138 | 138 | $this->_record->path = $savePath; |
139 | 139 | $this->_record->configs = $this->configs; |
140 | 140 | $this->_record->save(); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // build path with owner category |
170 | 170 | $this->_pathNested = $owner->path; |
171 | 171 | if (Str::length($this->_pathNested) > 0) { |
172 | - $path = $this->_pathNested . '/' . $path; |
|
172 | + $path = $this->_pathNested.'/'.$path; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | // make select for check |
@@ -80,7 +80,7 @@ |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | // get all depended category ids |
83 | - $cats = ContentCategory::where('path', 'like', $this->_record->path . '%')->get(['id'])->toArray(); |
|
83 | + $cats = ContentCategory::where('path', 'like', $this->_record->path.'%')->get(['id'])->toArray(); |
|
84 | 84 | $allCategoryIds = Arr::pluck('id', $cats); |
85 | 85 | |
86 | 86 | // update category_id in content |
@@ -30,8 +30,8 @@ |
||
30 | 30 | */ |
31 | 31 | public function before() |
32 | 32 | { |
33 | - $this->count = (int)$this->_configs['count']; |
|
34 | - $this->cache = (int)$this->_configs['cache']; |
|
33 | + $this->count = (int) $this->_configs['count']; |
|
34 | + $this->cache = (int) $this->_configs['cache']; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -30,7 +30,7 @@ |
||
30 | 30 | { |
31 | 31 | $status = $this->_record->disabled; |
32 | 32 | |
33 | - $this->_record->disabled = (int)!$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
33 | + $this->_record->disabled = (int) !$status; // magic inside: bool to int and reverse - 0 => 1, 1 => 0 |
|
34 | 34 | $this->_record->save(); |
35 | 35 | } |
36 | 36 | } |
@@ -31,9 +31,9 @@ |
||
31 | 31 | */ |
32 | 32 | public function before() |
33 | 33 | { |
34 | - $this->snippet = (int)$this->_configs['snippet']; |
|
35 | - $this->count = (int)$this->_configs['count']; |
|
36 | - $this->cache = (int)$this->_configs['cache']; |
|
34 | + $this->snippet = (int) $this->_configs['snippet']; |
|
35 | + $this->count = (int) $this->_configs['count']; |
|
36 | + $this->cache = (int) $this->_configs['cache']; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |