@@ -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 [ |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * Load user data on before method |
|
| 39 | - */ |
|
| 38 | + * Load user data on before method |
|
| 39 | + */ |
|
| 40 | 40 | public function before() |
| 41 | 41 | { |
| 42 | 42 | foreach ($this->getAllProperties() as $property => $old_data) { |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * Example of usage magic rules for future usage in condition $model->validate() |
|
| 68 | - */ |
|
| 67 | + * Example of usage magic rules for future usage in condition $model->validate() |
|
| 68 | + */ |
|
| 69 | 69 | public function rules() |
| 70 | 70 | { |
| 71 | 71 | 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 { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $this->scanFiles = json_decode(File::read('/Private/Antivirus/ScanFiles.json')); |
| 48 | 48 | if (File::exist('/Private/Antivirus/Infected.json')) { |
| 49 | - $this->infected = (array)json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
| 49 | + $this->infected = (array) json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $detected = true; |
| 115 | 115 | $pos = $found[0][1]; |
| 116 | 116 | $this->infected[$path][] = [ |
| 117 | - 'pos' => (int)$pos, |
|
| 117 | + 'pos' => (int) $pos, |
|
| 118 | 118 | 'sigId' => $attrId, |
| 119 | 119 | 'sigRule' => $sigContent, |
| 120 | 120 | 'sever' => $attrSever, |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | (($pos = strpos($normalized, $sigContent)) !== false) |
| 129 | 129 | ) { |
| 130 | 130 | $this->infected[$path][] = [ |
| 131 | - 'pos' => (int)$pos, |
|
| 131 | + 'pos' => (int) $pos, |
|
| 132 | 132 | 'sigId' => $attrId, |
| 133 | 133 | 'sigRule' => $sigContent, |
| 134 | 134 | 'sever' => $attrSever, |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | private function prepareScanlist() |
| 150 | 150 | { |
| 151 | - $files = (object)File::listFiles(root, $this->affectedExt); |
|
| 151 | + $files = (object) File::listFiles(root, $this->affectedExt); |
|
| 152 | 152 | File::write('/Private/Antivirus/ScanFiles.json', json_encode($files)); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -42,10 +42,10 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Prepare passed data in __construct |
|
| 46 | - * @throws ForbiddenException |
|
| 47 | - * @throws NotFoundException |
|
| 48 | - */ |
|
| 45 | + * Prepare passed data in __construct |
|
| 46 | + * @throws ForbiddenException |
|
| 47 | + * @throws NotFoundException |
|
| 48 | + */ |
|
| 49 | 49 | public function before() |
| 50 | 50 | { |
| 51 | 51 | $this->categoryData = [ |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | // check if this category is hidden |
| 59 | - if ((int)$this->categoryData['configs']['showCategory'] !== 1) { |
|
| 59 | + if ((int) $this->categoryData['configs']['showCategory'] !== 1) { |
|
| 60 | 60 | throw new ForbiddenException(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // find first paragraph ending |
| 82 | 82 | $breakPosition = mb_strpos($text, '</p>', null, 'UTF-8'); |
| 83 | 83 | // cut text from position caret before </p> (+4 symbols to save item as valid) |
| 84 | - $text = Str::substr($text, 0, $breakPosition+4); |
|
| 84 | + $text = Str::substr($text, 0, $breakPosition + 4); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $itemPath = $this->_allCategories[$row->category_id]['path']; |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | 'author' => App::$User->identity($row->author_id), |
| 129 | 129 | 'poster' => $poster, |
| 130 | 130 | 'thumb' => $thumb, |
| 131 | - 'views' => (int)$row->views, |
|
| 132 | - 'rating' => (int)$row->rating, |
|
| 131 | + 'views' => (int) $row->views, |
|
| 132 | + 'rating' => (int) $row->rating, |
|
| 133 | 133 | 'category' => $this->_allCategories[$row->category_id], |
| 134 | 134 | 'uri' => '/content/read/' . $itemPath, |
| 135 | 135 | 'tags' => $tags |
@@ -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); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | $this->authorName = Str::likeEmpty($profile->nick) ? __('No name') : $profile->nick; |
| 87 | 87 | } |
| 88 | 88 | $this->source = $this->_content->source; |
| 89 | - $this->views = $this->_content->views+1; |
|
| 89 | + $this->views = $this->_content->views + 1; |
|
| 90 | 90 | // check for dependence, add '' for general cat, ex: general/depend1/depend2/.../depend-n |
| 91 | 91 | $catNestingArray = Arr::merge([0 => ''], explode('/', $this->catPath)); |
| 92 | 92 | if ($catNestingArray > 1) { |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | const COMPRESS_QUALITY = 90; |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * Example of usage magic labels for future form helper usage |
|
| 20 | - */ |
|
| 19 | + * Example of usage magic labels for future form helper usage |
|
| 20 | + */ |
|
| 21 | 21 | public function labels() |
| 22 | 22 | { |
| 23 | 23 | return [ |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * Example of usage magic rules for future usage in condition $model->validate() |
|
| 30 | - */ |
|
| 29 | + * Example of usage magic rules for future usage in condition $model->validate() |
|
| 30 | + */ |
|
| 31 | 31 | public function rules() |
| 32 | 32 | { |
| 33 | 33 | return [ |
@@ -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 | |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * Set default data |
|
| 34 | - */ |
|
| 33 | + * Set default data |
|
| 34 | + */ |
|
| 35 | 35 | public function before() |
| 36 | 36 | { |
| 37 | 37 | $profile = $this->_user->getProfile()->toArray(); // object to array (property's is protected of access) |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Labels |
|
| 56 | - */ |
|
| 55 | + * Labels |
|
| 56 | + */ |
|
| 57 | 57 | public function labels() |
| 58 | 58 | { |
| 59 | 59 | $labels = [ |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Rules for validation |
|
| 79 | - */ |
|
| 78 | + * Rules for validation |
|
| 79 | + */ |
|
| 80 | 80 | public function rules() |
| 81 | 81 | { |
| 82 | 82 | $rules = [ |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function labels() |
| 58 | 58 | { |
| 59 | - $labels = [ |
|
| 59 | + $labels = [ |
|
| 60 | 60 | 'nick' => __('Nickname'), |
| 61 | 61 | 'sex' => __('Sex'), |
| 62 | 62 | 'birthday' => __('Birthday'), |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | ]; |
| 99 | 99 | $rules[] = [ |
| 100 | 100 | 'custom_data.' . $custom->id, |
| 101 | - (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
| 101 | + (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
| 102 | 102 | $custom->reg_exp |
| 103 | 103 | ]; |
| 104 | 104 | } |
@@ -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 []; |