@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | public function check() |
| 49 | 49 | { |
| 50 | 50 | // check if user is auth'd or guest name is defined |
| 51 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 51 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
| 52 | 52 | throw new JsonException(__('Guest name is not defined')); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // guest moderation |
| 56 | - if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) { |
|
| 56 | + if (!App::$User->isAuth() && (bool) $this->_configs['guestModerate']) { |
|
| 57 | 57 | $captcha = App::$Request->request->get('captcha'); |
| 58 | 58 | if (!App::$Captcha->validate($captcha)) { |
| 59 | 59 | throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again')); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check if message length is correct |
| 69 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
| 69 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
| 70 | 70 | throw new JsonException(__('Message length is incorrect. Current: %cur%, min - %min%, max - %max%', [ |
| 71 | 71 | 'cur' => Str::length($this->message), |
| 72 | 72 | 'min' => $this->_configs['minLength'], |
@@ -111,15 +111,15 @@ discard block |
||
| 111 | 111 | $record->lang = App::$Request->getLanguage(); |
| 112 | 112 | $record->ip = $this->ip; |
| 113 | 113 | // check if premoderation is enabled and user is guest |
| 114 | - if ((bool)$this->_configs['guestModerate'] && $this->_userId < 1) { |
|
| 114 | + if ((bool) $this->_configs['guestModerate'] && $this->_userId < 1) { |
|
| 115 | 115 | $record->moderate = 1; |
| 116 | 116 | } |
| 117 | 117 | $record->save(); |
| 118 | 118 | |
| 119 | 119 | // add notification for comment post owner |
| 120 | 120 | $commentPost = $record->post; |
| 121 | - if ($commentPost !== null && (int)$commentPost->user_id !== 0 && (int)$commentPost->user_id !== $this->_userId) { |
|
| 122 | - $notify = new EntityAddNotification((int)$commentPost->user_id); |
|
| 121 | + if ($commentPost !== null && (int) $commentPost->user_id !== 0 && (int) $commentPost->user_id !== $this->_userId) { |
|
| 122 | + $notify = new EntityAddNotification((int) $commentPost->user_id); |
|
| 123 | 123 | $notify->add($commentPost->pathway, EntityAddNotification::MSG_ADD_COMMENTANSWER, [ |
| 124 | 124 | 'snippet' => Text::snippet($this->message, 50), |
| 125 | 125 | 'post' => Text::snippet($commentPost->message, 50) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function __construct($record, $calcAnswers = true) |
| 30 | 30 | { |
| 31 | 31 | $this->_record = $record; |
| 32 | - $this->_calcAnswers = (bool)$calcAnswers; |
|
| 32 | + $this->_calcAnswers = (bool) $calcAnswers; |
|
| 33 | 33 | if ($this->_record instanceof CommentPost) { |
| 34 | 34 | $this->_type = 'post'; |
| 35 | 35 | } elseif ($this->_record instanceof CommentAnswer) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // build user data |
| 54 | 54 | $userName = __('Unknown'); |
| 55 | - $userAvatar = App::$Alias->scriptUrl . '/upload/user/avatar/small/default.jpg'; |
|
| 55 | + $userAvatar = App::$Alias->scriptUrl.'/upload/user/avatar/small/default.jpg'; |
|
| 56 | 56 | $userColor = 0; |
| 57 | 57 | if ($this->_record->user !== null && $this->_record->user->id > 0) { |
| 58 | 58 | $userName = $this->_record->user->profile->getNickname(); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'text' => $this->_record->message, |
| 72 | 72 | 'date' => Date::convertToDatetime($this->_record->created_at, Date::FORMAT_TO_HOUR), |
| 73 | 73 | 'pathway' => $this->_record->pathway, |
| 74 | - 'moderate' => (int)$this->_record->moderate, |
|
| 74 | + 'moderate' => (int) $this->_record->moderate, |
|
| 75 | 75 | 'user' => [ |
| 76 | 76 | 'id' => $this->_record->user_id, |
| 77 | 77 | 'name' => $userName, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $this->_path = $path; |
| 60 | 60 | $this->_configs = $configs; |
| 61 | - $this->_page = (int)$offset; |
|
| 61 | + $this->_page = (int) $offset; |
|
| 62 | 62 | $this->_sort = $sort; |
| 63 | 63 | parent::__construct(); |
| 64 | 64 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function before() |
| 72 | 72 | { |
| 73 | 73 | // find one or more categories where we must looking for content items |
| 74 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
| 74 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
| 75 | 75 | $this->findCategories(); |
| 76 | 76 | } else { |
| 77 | 77 | $this->findCategory(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function setItemLimit($limit) |
| 92 | 92 | { |
| 93 | - $this->_customItemLimit = (int)$limit; |
|
| 93 | + $this->_customItemLimit = (int) $limit; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | private function findCategories() |
| 119 | 119 | { |
| 120 | 120 | // get all categories for current path and child of it |
| 121 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
| 121 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
| 122 | 122 | if ($query->count() < 1) { |
| 123 | 123 | throw new NotFoundException(__('Category is not founded')); |
| 124 | 124 | } |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | // calculate selection offset |
| 154 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
| 154 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
| 155 | 155 | // check if custom itemlimit defined over model api |
| 156 | 156 | if ($this->_customItemLimit !== false) { |
| 157 | - $itemPerPage = (int)$this->_customItemLimit; |
|
| 157 | + $itemPerPage = (int) $this->_customItemLimit; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $offset = $this->_page * $itemPerPage; |
@@ -197,15 +197,15 @@ discard block |
||
| 197 | 197 | $catConfigs = $this->_currentCategory->configs; |
| 198 | 198 | // prepare rss url link for current category if enabled |
| 199 | 199 | $rssUrl = false; |
| 200 | - if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) { |
|
| 201 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
| 200 | + if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) { |
|
| 201 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
| 202 | 202 | $rssUrl = rtrim($rssUrl, '/'); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // prepare sorting urls |
| 206 | 206 | $catSortParams = []; |
| 207 | 207 | if (App::$Request->query->get('page')) { |
| 208 | - $catSortParams['page'] = (int)App::$Request->query->get('page'); |
|
| 208 | + $catSortParams['page'] = (int) App::$Request->query->get('page'); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | $catSortUrls = [ |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | ]; |
| 226 | 226 | |
| 227 | 227 | // check if this category is hidden |
| 228 | - if (!(bool)$this->category['configs']['showCategory']) { |
|
| 228 | + if (!(bool) $this->category['configs']['showCategory']) { |
|
| 229 | 229 | throw new ForbiddenException(__('This category is not available to view')); |
| 230 | 230 | } |
| 231 | 231 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | // check if current user can rate item |
| 279 | 279 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 280 | 280 | $canRate = true; |
| 281 | - if (Any::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
| 281 | + if (Any::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
| 282 | 282 | $canRate = false; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -299,13 +299,13 @@ discard block |
||
| 299 | 299 | 'poster' => $row->getPosterUri(), |
| 300 | 300 | 'thumb' => $row->getPosterThumbUri(), |
| 301 | 301 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
| 302 | - 'views' => (int)$row->views, |
|
| 303 | - 'rating' => (int)$row->rating, |
|
| 302 | + 'views' => (int) $row->views, |
|
| 303 | + 'rating' => (int) $row->rating, |
|
| 304 | 304 | 'canRate' => $canRate, |
| 305 | 305 | 'category' => $this->categories[$row->category_id], |
| 306 | - 'uri' => '/content/read/' . $itemPath, |
|
| 306 | + 'uri' => '/content/read/'.$itemPath, |
|
| 307 | 307 | 'tags' => $tags, |
| 308 | - 'important' => (bool)$row->important |
|
| 308 | + 'important' => (bool) $row->important |
|
| 309 | 309 | ]; |
| 310 | 310 | } |
| 311 | 311 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->id = $this->_content->id; |
| 73 | 73 | $this->title = $this->_content->getLocaled('title'); |
| 74 | 74 | $this->text = $this->_content->getLocaled('text'); |
| 75 | - $this->display = (bool)$this->_content->display; |
|
| 75 | + $this->display = (bool) $this->_content->display; |
|
| 76 | 76 | |
| 77 | 77 | // check if title and text are exists |
| 78 | 78 | if (Str::length($this->title) < 1 || Str::length($this->text) < 1) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $this->source = $this->_content->source; |
| 105 | - $this->views = $this->_content->views+1; |
|
| 105 | + $this->views = $this->_content->views + 1; |
|
| 106 | 106 | // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n |
| 107 | 107 | $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath)); |
| 108 | 108 | if ($catNestingArray > 1) { |
@@ -134,15 +134,15 @@ discard block |
||
| 134 | 134 | ]; |
| 135 | 135 | |
| 136 | 136 | // get gallery images and poster data |
| 137 | - $galleryPath = '/upload/gallery/' . $this->_content->id; |
|
| 137 | + $galleryPath = '/upload/gallery/'.$this->_content->id; |
|
| 138 | 138 | // check if gallery folder is exist |
| 139 | 139 | if (Directory::exist($galleryPath)) { |
| 140 | - $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
| 140 | + $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
| 141 | 141 | // generate poster data |
| 142 | 142 | if (Arr::in($this->_content->poster, $originImages)) { |
| 143 | 143 | // original poster |
| 144 | 144 | $posterName = $this->_content->poster; |
| 145 | - $this->posterFull = $galleryPath . '/orig/' . $posterName; |
|
| 145 | + $this->posterFull = $galleryPath.'/orig/'.$posterName; |
|
| 146 | 146 | if (!File::exist($this->posterFull)) { |
| 147 | 147 | $this->posterFull = null; |
| 148 | 148 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $posterSplit = explode('.', $posterName); |
| 152 | 152 | array_pop($posterSplit); |
| 153 | 153 | $posterCleanName = implode('.', $posterSplit); |
| 154 | - $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg'; |
|
| 154 | + $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg'; |
|
| 155 | 155 | if (!File::exist($this->posterThumb)) { |
| 156 | 156 | $this->posterThumb = null; |
| 157 | 157 | } |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | continue; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg'; |
|
| 170 | + $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg'; |
|
| 171 | 171 | if (File::exist($thumbPath)) { |
| 172 | - $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image; |
|
| 172 | + $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image; |
|
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $this->rating = $this->_content->rating; |
| 179 | 179 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
| 180 | 180 | $this->canRate = true; |
| 181 | - if (Any::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) { |
|
| 181 | + if (Any::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) { |
|
| 182 | 182 | $this->canRate = false; |
| 183 | 183 | } |
| 184 | 184 | if (!App::$User->isAuth()) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $index = implode('-', $this->_skip); |
| 63 | 63 | // try to get this slow query from cache |
| 64 | - $cache = App::$Cache->getItem('entity.content.search.index.' . $index); |
|
| 64 | + $cache = App::$Cache->getItem('entity.content.search.index.'.$index); |
|
| 65 | 65 | if (!$cache->isHit()) { |
| 66 | 66 | $cache->set($this->makeSearch()); |
| 67 | 67 | $cache->expiresAfter(static::CACHE_TIME); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $this->items[] = [ |
| 95 | 95 | 'title' => $item->getLocaled('title'), |
| 96 | 96 | 'snippet' => Text::snippet($text), |
| 97 | - 'uri' => '/content/read/' . $item->getPath(), |
|
| 97 | + 'uri' => '/content/read/'.$item->getPath(), |
|
| 98 | 98 | 'thumb' => $item->getPosterThumbUri() |
| 99 | 99 | ]; |
| 100 | 100 | } |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | // set current user id |
| 58 | 58 | $this->authorId = App::$User->identity()->getId(); |
| 59 | 59 | // set true if it is a new content item |
| 60 | - if ($this->_record->id === null || (int)$this->_record->id < 1) { |
|
| 60 | + if ($this->_record->id === null || (int) $this->_record->id < 1) { |
|
| 61 | 61 | $this->_new = true; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // set random path slug if not defined |
| 65 | 65 | if ($this->path === null || Str::likeEmpty($this->path)) { |
| 66 | - $randPath = date('d-m-Y') . '-' . Str::randomLatin(mt_rand(8, 12)); |
|
| 66 | + $randPath = date('d-m-Y').'-'.Str::randomLatin(mt_rand(8, 12)); |
|
| 67 | 67 | $this->path = Str::lowerCase($randPath); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $r = [ |
| 109 | 109 | [['path', 'categoryId'], 'required'], |
| 110 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
| 111 | - ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
|
| 110 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
| 111 | + ['text.'.App::$Request->getLanguage(), 'required', null, true, true], |
|
| 112 | 112 | ['text', 'used', null, true, true], |
| 113 | 113 | ['path', 'direct_match', '/^[a-zA-Z0-9\-]+$/'], |
| 114 | 114 | ['categoryId', 'in', $this->categoryIds()], |
| 115 | 115 | ['path', 'Apps\Model\Front\Content\FormNarrowContentUpdate::validatePath'], |
| 116 | 116 | ['poster', 'used'], |
| 117 | 117 | ['poster', 'isFile', ['jpg', 'png', 'gif', 'jpeg']], |
| 118 | - ['poster', 'sizeFile', (int)$this->_configs['gallerySize'] * 1024] // in bytes |
|
| 118 | + ['poster', 'sizeFile', (int) $this->_configs['gallerySize'] * 1024] // in bytes |
|
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | 121 | foreach (App::$Properties->get('languages') as $lang) { |
| 122 | - $r[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
| 123 | - $r[] = ['keywords.' . $lang, 'length_max', 150]; |
|
| 124 | - $r[] = ['description.' . $lang, 'length_max', 250]; |
|
| 122 | + $r[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
| 123 | + $r[] = ['keywords.'.$lang, 'length_max', 150]; |
|
| 124 | + $r[] = ['description.'.$lang, 'length_max', 250]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $r; |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | $this->_record->title = $this->title; |
| 148 | 148 | $this->_record->text = $this->text; |
| 149 | 149 | $this->_record->path = $this->path; |
| 150 | - $this->_record->category_id = (int)$this->categoryId; |
|
| 150 | + $this->_record->category_id = (int) $this->categoryId; |
|
| 151 | 151 | $this->_record->display = 0; // set to premoderation |
| 152 | - $this->_record->author_id = (int)$this->authorId; |
|
| 152 | + $this->_record->author_id = (int) $this->authorId; |
|
| 153 | 153 | if ($this->_new) { |
| 154 | 154 | $this->_record->comment_hash = $this->generateCommentHash(); |
| 155 | 155 | } |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | // work with poster data |
| 160 | 160 | if ($this->poster !== null) { |
| 161 | 161 | // lets move poster from tmp to gallery |
| 162 | - $originDir = '/upload/gallery/' . $this->_record->id . '/orig/'; |
|
| 163 | - $thumbDir = '/upload/gallery/' . $this->_record->id . '/thumb/'; |
|
| 162 | + $originDir = '/upload/gallery/'.$this->_record->id.'/orig/'; |
|
| 163 | + $thumbDir = '/upload/gallery/'.$this->_record->id.'/thumb/'; |
|
| 164 | 164 | if (!Directory::exist($originDir)) { |
| 165 | 165 | Directory::create($originDir); |
| 166 | 166 | } |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | Directory::create($thumbDir); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName() . $this->poster->getSize()); |
|
| 173 | - $newFullName = $fileName . '.' . $this->poster->guessExtension(); |
|
| 172 | + $fileName = App::$Security->simpleHash($this->poster->getClientOriginalName().$this->poster->getSize()); |
|
| 173 | + $newFullName = $fileName.'.'.$this->poster->guessExtension(); |
|
| 174 | 174 | // move poster to upload gallery directory |
| 175 | 175 | $this->poster->move(Normalize::diskFullPath($originDir), $newFullName); |
| 176 | 176 | // initialize image resizer |
| 177 | 177 | $thumb = new Image(); |
| 178 | - $thumb->setCacheDir(root . '/Private/Cache/images'); |
|
| 178 | + $thumb->setCacheDir(root.'/Private/Cache/images'); |
|
| 179 | 179 | |
| 180 | 180 | // open original file, resize it and save |
| 181 | - $thumbSaveName = Normalize::diskFullPath($thumbDir) . '/' . $fileName . '.jpg'; |
|
| 182 | - $thumb->open(Normalize::diskFullPath($originDir) . DIRECTORY_SEPARATOR . $newFullName) |
|
| 181 | + $thumbSaveName = Normalize::diskFullPath($thumbDir).'/'.$fileName.'.jpg'; |
|
| 182 | + $thumb->open(Normalize::diskFullPath($originDir).DIRECTORY_SEPARATOR.$newFullName) |
|
| 183 | 183 | ->cropResize($this->_configs['galleryResize']) |
| 184 | 184 | ->save($thumbSaveName, 'jpg', 90); |
| 185 | 185 | $thumb = null; |
@@ -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 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function __construct($recordPost, $userId = 0) |
| 32 | 32 | { |
| 33 | 33 | $this->_post = $recordPost; |
| 34 | - $this->_userId = (int)$userId; |
|
| 34 | + $this->_userId = (int) $userId; |
|
| 35 | 35 | parent::__construct(); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | // add notification msg |
| 100 | 100 | $targetId = $this->_post->user_id; |
| 101 | - if ($targetId !== null && (int)$targetId > 0 && $targetId !== $this->_userId) { |
|
| 101 | + if ($targetId !== null && (int) $targetId > 0 && $targetId !== $this->_userId) { |
|
| 102 | 102 | $notify = new EntityAddNotification($targetId); |
| 103 | - $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id; |
|
| 103 | + $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id; |
|
| 104 | 104 | $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [ |
| 105 | 105 | 'snippet' => Text::snippet($this->message, 50), |
| 106 | 106 | 'post' => Text::snippet($this->_post->message, 50) |