@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function actionIndex() |
44 | 44 | { |
45 | 45 | // set current page and offset |
46 | - $page = (int)$this->request->query->get('page'); |
|
46 | + $page = (int) $this->request->query->get('page'); |
|
47 | 47 | $offset = $page * self::ITEM_PER_PAGE; |
48 | 48 | |
49 | 49 | $query = null; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } elseif ($type === 'moderate') { // only items on moderate |
55 | 55 | $query = ContentEntity::where('display', '=', 0); |
56 | 56 | } elseif (Obj::isLikeInt($type)) { // sounds like category id ;) |
57 | - $query = ContentEntity::where('category_id', '=', (int)$type); |
|
57 | + $query = ContentEntity::where('category_id', '=', (int) $type); |
|
58 | 58 | } else { |
59 | 59 | $query = new ContentEntity(); |
60 | 60 | $type = 'all'; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | public function actionCategoryupdate($id = null) |
269 | 269 | { |
270 | 270 | // get owner id for new rows |
271 | - $parentId = (int)$this->request->query->get('parent'); |
|
271 | + $parentId = (int) $this->request->query->get('parent'); |
|
272 | 272 | |
273 | 273 | // get relation and pass to model |
274 | 274 | $record = ContentCategory::findOrNew($id); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $search = \Apps\ActiveRecord\App::getItem('widget', $controller); |
88 | 88 | |
89 | 89 | // check what we got |
90 | - if ($search === null || (int)$search->id < 1) { |
|
90 | + if ($search === null || (int) $search->id < 1) { |
|
91 | 91 | throw new NotFoundException('Widget is not founded'); |
92 | 92 | } |
93 | 93 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $record = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'widget')->first(); |
122 | 122 | |
123 | 123 | // check if widget admin controller exists |
124 | - if ($record === null || (int)$record->id < 1) { |
|
124 | + if ($record === null || (int) $record->id < 1) { |
|
125 | 125 | throw new ForbiddenException('Widget is not founded'); |
126 | 126 | } |
127 | 127 |
@@ -37,9 +37,9 @@ |
||
37 | 37 | $record->save(); |
38 | 38 | |
39 | 39 | // add user notification |
40 | - if ((int)$this->_post->user_id > 0 && $this->_userId !== (int)$this->_post->user_id) { |
|
41 | - $notify = new EntityAddNotification((int)$this->_post->user_id); |
|
42 | - $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id; |
|
40 | + if ((int) $this->_post->user_id > 0 && $this->_userId !== (int) $this->_post->user_id) { |
|
41 | + $notify = new EntityAddNotification((int) $this->_post->user_id); |
|
42 | + $uri = '/feedback/read/'.$this->_post->id.'/'.$this->_post->hash.'#feedback-answer-'.$record->id; |
|
43 | 43 | |
44 | 44 | $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [ |
45 | 45 | 'snippet' => Text::snippet($this->message, 50), |
@@ -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 | } |
37 | 37 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if ($this->_content->id === null) { |
60 | 60 | $this->_new = true; |
61 | 61 | if (null === $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 | if (null === $this->authorId) { |
65 | 65 | $this->authorId = App::$User->identity()->getId(); |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | public function rules() |
92 | 92 | { |
93 | 93 | $res = [ |
94 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
95 | - ['text.' . App::$Request->getLanguage(), 'required'], |
|
94 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
95 | + ['text.'.App::$Request->getLanguage(), 'required'], |
|
96 | 96 | ['text', 'used'], |
97 | 97 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
98 | 98 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'], |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | ]; |
106 | 106 | |
107 | 107 | foreach (App::$Properties->get('languages') as $lang) { |
108 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
109 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
110 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
108 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
109 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
110 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $res; |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $this->_content->meta_description = Serialize::encode($this->metaDescription); |
164 | 164 | $this->_content->source = $this->source; |
165 | 165 | // check if rating is changed |
166 | - if ((int)$this->addRating !== 0) { |
|
167 | - $this->_content->rating += (int)$this->addRating; |
|
166 | + if ((int) $this->addRating !== 0) { |
|
167 | + $this->_content->rating += (int) $this->addRating; |
|
168 | 168 | } |
169 | 169 | // check if special comment hash is exist |
170 | 170 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | // save poster data |
179 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
179 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
180 | 180 | if (File::exist($posterPath)) { |
181 | 181 | $this->_content->poster = $this->poster; |
182 | 182 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | // move files |
213 | 213 | if ($tmpGalleryId !== $this->_content->id) { |
214 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
214 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $data = ContentCategory::getSortedCategories(); |
225 | 225 | $response = []; |
226 | 226 | foreach ($data as $key=>$val) { |
227 | - $response[] = (string)$key; |
|
227 | + $response[] = (string) $key; |
|
228 | 228 | } |
229 | 229 | return $response; |
230 | 230 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | // remove gallery files if exists |
45 | 45 | foreach ($this->_records->get() as $record) { |
46 | - $galleryPath = '/upload/gallery/' . (int)$record->id; |
|
46 | + $galleryPath = '/upload/gallery/'.(int) $record->id; |
|
47 | 47 | if (Directory::exist($galleryPath)) { |
48 | 48 | Directory::remove($galleryPath); |
49 | 49 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // labels for custom fields |
79 | 79 | foreach (ProfileField::all() as $custom) { |
80 | - $labels['custom_data.' . $custom->id] = Serialize::getDecodeLocale($custom->name); |
|
80 | + $labels['custom_data.'.$custom->id] = Serialize::getDecodeLocale($custom->name); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | return $labels; |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | // custom profile fields |
104 | 104 | foreach (ProfileField::all() as $custom) { |
105 | 105 | $rules[] = [ |
106 | - 'custom_data.' . $custom->id, |
|
106 | + 'custom_data.'.$custom->id, |
|
107 | 107 | 'used' |
108 | 108 | ]; |
109 | 109 | $rules[] = [ |
110 | - 'custom_data.' . $custom->id, |
|
111 | - (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
110 | + 'custom_data.'.$custom->id, |
|
111 | + (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
112 | 112 | $custom->reg_exp |
113 | 113 | ]; |
114 | 114 | } |