@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
23 | - * Pass properties |
|
24 | - */ |
|
23 | + * Pass properties |
|
24 | + */ |
|
25 | 25 | public function before() |
26 | 26 | { |
27 | 27 | $this->id = $this->_record->id; |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * Form label |
|
33 | - */ |
|
32 | + * Form label |
|
33 | + */ |
|
34 | 34 | public function labels() |
35 | 35 | { |
36 | 36 | return [ |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * Typical rules |
|
43 | - */ |
|
42 | + * Typical rules |
|
43 | + */ |
|
44 | 44 | public function rules() |
45 | 45 | { |
46 | 46 | return []; |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * Set model properties based on defaults config values |
|
32 | - */ |
|
31 | + * Set model properties based on defaults config values |
|
32 | + */ |
|
33 | 33 | public function before() |
34 | 34 | { |
35 | 35 | foreach ($this->_configs as $property => $value) { |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * Form labels |
|
44 | - */ |
|
43 | + * Form labels |
|
44 | + */ |
|
45 | 45 | public function labels() |
46 | 46 | { |
47 | 47 | return [ |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Validation rules |
|
61 | - */ |
|
60 | + * Validation rules |
|
61 | + */ |
|
62 | 62 | public function rules() |
63 | 63 | { |
64 | 64 | return [ |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * Set defaults values |
|
27 | - */ |
|
26 | + * Set defaults values |
|
27 | + */ |
|
28 | 28 | public function before() |
29 | 29 | { |
30 | 30 | foreach ($this->_record->toArray() as $property => $value) { |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * Labels |
|
43 | - */ |
|
42 | + * Labels |
|
43 | + */ |
|
44 | 44 | public function labels() |
45 | 45 | { |
46 | 46 | return [ |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * Validation rules |
|
56 | - */ |
|
55 | + * Validation rules |
|
56 | + */ |
|
57 | 57 | public function rules() |
58 | 58 | { |
59 | 59 | $rules = [ |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function delete() |
89 | 89 | { |
90 | - $this->_record->delete(); |
|
90 | + $this->_record->delete(); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -62,8 +62,8 @@ |
||
62 | 62 | ]; |
63 | 63 | |
64 | 64 | foreach (App::$Properties->get('languages') as $lang) { |
65 | - $rules[] = ['name.' . $lang, 'required']; |
|
66 | - $rules[] = ['name.' . $lang, 'length_max', 50]; |
|
65 | + $rules[] = ['name.'.$lang, 'required']; |
|
66 | + $rules[] = ['name.'.$lang, 'length_max', 50]; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $rules; |
@@ -21,8 +21,8 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * Set user data to model property |
|
25 | - */ |
|
24 | + * Set user data to model property |
|
25 | + */ |
|
26 | 26 | public function before() |
27 | 27 | { |
28 | 28 | $this->email = $this->_user->getParam('email'); |
@@ -68,10 +68,10 @@ |
||
68 | 68 | ->orWhere('sender_id', '=', $uid) |
69 | 69 | ->delete(); |
70 | 70 | // delete avatars |
71 | - File::remove('/upload/user/avatar/big/' . $uid . '.jpg'); |
|
72 | - File::remove('/upload/user/avatar/medium/' . $uid . '.jpg'); |
|
73 | - File::remove('/upload/user/avatar/small/' . $uid . '.jpg'); |
|
74 | - File::remove('/upload/user/avatar/original/' . $uid . '.jpg'); |
|
71 | + File::remove('/upload/user/avatar/big/'.$uid.'.jpg'); |
|
72 | + File::remove('/upload/user/avatar/medium/'.$uid.'.jpg'); |
|
73 | + File::remove('/upload/user/avatar/small/'.$uid.'.jpg'); |
|
74 | + File::remove('/upload/user/avatar/original/'.$uid.'.jpg'); |
|
75 | 75 | // delete user profile and auth data |
76 | 76 | $user->getProfile()->delete(); |
77 | 77 | $user->delete(); |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
22 | - * Load configs from app data |
|
23 | - */ |
|
22 | + * Load configs from app data |
|
23 | + */ |
|
24 | 24 | public function before() |
25 | 25 | { |
26 | 26 | foreach ($this->_config as $property => $value) { |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * Example of usage magic labels for future form helper usage |
|
35 | - */ |
|
34 | + * Example of usage magic labels for future form helper usage |
|
35 | + */ |
|
36 | 36 | public function labels() |
37 | 37 | { |
38 | 38 | return [ |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * Example of usage magic rules for future usage in condition $model->validate() |
|
47 | - */ |
|
46 | + * Example of usage magic rules for future usage in condition $model->validate() |
|
47 | + */ |
|
48 | 48 | public function rules() |
49 | 49 | { |
50 | 50 | return [ |
@@ -98,7 +98,7 @@ |
||
98 | 98 | if ($this->newpassword !== null && Str::length($this->newpassword) >= 3) { |
99 | 99 | $this->_user->password = App::$Security->password_hash($this->newpassword); |
100 | 100 | } |
101 | - } elseif($property === 'approve_token') { |
|
101 | + } elseif ($property === 'approve_token') { |
|
102 | 102 | if ($value == "1") { |
103 | 103 | $this->_user->approve_token = '0'; |
104 | 104 | } else { |
@@ -39,8 +39,8 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * Load user data on before method |
|
43 | - */ |
|
42 | + * Load user data on before method |
|
43 | + */ |
|
44 | 44 | public function before() |
45 | 45 | { |
46 | 46 | foreach ($this->getAllProperties() as $property => $old_data) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | /** |
58 | 58 | * Prepare model attributes from passed objects |
59 | 59 | * @throws ForbiddenException |
60 | - */ |
|
60 | + */ |
|
61 | 61 | public function before() |
62 | 62 | { |
63 | 63 | $this->title = Serialize::getDecodeLocale($this->_content->title); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $this->source = $this->_content->source; |
98 | - $this->views = $this->_content->views+1; |
|
98 | + $this->views = $this->_content->views + 1; |
|
99 | 99 | // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n |
100 | 100 | $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath)); |
101 | 101 | if ($catNestingArray > 1) { |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | ]; |
128 | 128 | |
129 | 129 | // get gallery images and poster data |
130 | - $galleryPath = '/upload/gallery/' . $this->_content->id; |
|
130 | + $galleryPath = '/upload/gallery/'.$this->_content->id; |
|
131 | 131 | // check if gallery folder is exist |
132 | 132 | if (Directory::exist($galleryPath)) { |
133 | - $originImages = File::listFiles($galleryPath . '/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
133 | + $originImages = File::listFiles($galleryPath.'/orig/', ['.jpg', '.png', '.gif', '.jpeg', '.bmp', '.webp'], true); |
|
134 | 134 | // generate poster data |
135 | 135 | if (Arr::in($this->_content->poster, $originImages)) { |
136 | 136 | // original poster |
137 | 137 | $posterName = $this->_content->poster; |
138 | - $this->posterFull = $galleryPath . '/orig/' . $posterName; |
|
138 | + $this->posterFull = $galleryPath.'/orig/'.$posterName; |
|
139 | 139 | if (!File::exist($this->posterFull)) { |
140 | 140 | $this->posterFull = null; |
141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $posterSplit = explode('.', $posterName); |
144 | 144 | array_pop($posterSplit); |
145 | 145 | $posterCleanName = implode('.', $posterSplit); |
146 | - $this->posterThumb = $galleryPath . '/thumb/' . $posterCleanName . '.jpg'; |
|
146 | + $this->posterThumb = $galleryPath.'/thumb/'.$posterCleanName.'.jpg'; |
|
147 | 147 | if (!File::exist($this->posterThumb)) { |
148 | 148 | $this->posterThumb = null; |
149 | 149 | } |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | if (Str::startsWith($imageClearName, $this->_content->poster)) { |
159 | 159 | continue; |
160 | 160 | } |
161 | - $thumbPath = $galleryPath . '/thumb/' . $imageClearName . '.jpg'; |
|
161 | + $thumbPath = $galleryPath.'/thumb/'.$imageClearName.'.jpg'; |
|
162 | 162 | if (File::exist($thumbPath)) { |
163 | - $this->galleryItems[$thumbPath] = $galleryPath . '/orig/' . $image; |
|
163 | + $this->galleryItems[$thumbPath] = $galleryPath.'/orig/'.$image; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->rating = $this->_content->rating; |
170 | 170 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
171 | 171 | $this->canRate = true; |
172 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$this->id, $ignoredRate)) { |
|
172 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $this->id, $ignoredRate)) { |
|
173 | 173 | $this->canRate = false; |
174 | 174 | } |
175 | 175 | if (!App::$User->isAuth()) { |
@@ -33,8 +33,8 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | - * Validation rules |
|
37 | - */ |
|
36 | + * Validation rules |
|
37 | + */ |
|
38 | 38 | public function rules() |
39 | 39 | { |
40 | 40 | return [ |
@@ -52,7 +52,7 @@ |
||
52 | 52 | public function save() |
53 | 53 | { |
54 | 54 | // check if target is myself or always exist in block list |
55 | - if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
55 | + if ($this->_user->getId() === (int) $this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | |
21 | 21 | |
22 | 22 | /** |
23 | - * Set post id based on post active record |
|
24 | - */ |
|
23 | + * Set post id based on post active record |
|
24 | + */ |
|
25 | 25 | public function before() |
26 | 26 | { |
27 | 27 | $this->id = $this->_post->id; |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | |
30 | 30 | |
31 | 31 | /** |
32 | - * Pseudo-rules, here is not required |
|
33 | - */ |
|
32 | + * Pseudo-rules, here is not required |
|
33 | + */ |
|
34 | 34 | public function rules() |
35 | 35 | { |
36 | 36 | return []; |