@@ -62,7 +62,7 @@ |
||
62 | 62 | // add user notification |
63 | 63 | if ($target->id !== $viewer->id) { |
64 | 64 | $notify = new EntityAddNotification($target->id); |
65 | - $notify->add('profile/show/' . $target->id . '#wall-post-' . $record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]); |
|
65 | + $notify->add('profile/show/'.$target->id.'#wall-post-'.$record->id, EntityAddNotification::MSG_ADD_WALLPOST, ['snippet' => Text::snippet($this->message, 50)]); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // cleanup message |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public static function all($columns = ['*']) |
30 | 30 | { |
31 | - $cacheName = 'activerecord.profilefield.all.' . implode('.', $columns); |
|
31 | + $cacheName = 'activerecord.profilefield.all.'.implode('.', $columns); |
|
32 | 32 | $records = MemoryObject::instance()->get($cacheName); |
33 | 33 | if ($records === null) { |
34 | 34 | $records = parent::all($columns); |
@@ -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), |
@@ -27,8 +27,8 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * Load configs from app data |
|
31 | - */ |
|
30 | + * Load configs from app data |
|
31 | + */ |
|
32 | 32 | public function before() |
33 | 33 | { |
34 | 34 | if ($this->_config === null) { |
@@ -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 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | // labels for custom fields |
73 | 73 | foreach (ProfileField::all() as $custom) { |
74 | - $labels['custom_data.' . $custom->id] = $custom->getLocaled('name'); |
|
74 | + $labels['custom_data.'.$custom->id] = $custom->getLocaled('name'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $labels; |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | // custom profile fields |
98 | 98 | foreach (ProfileField::all() as $custom) { |
99 | 99 | $rules[] = [ |
100 | - 'custom_data.' . $custom->id, |
|
100 | + 'custom_data.'.$custom->id, |
|
101 | 101 | 'used' |
102 | 102 | ]; |
103 | 103 | $rules[] = [ |
104 | - 'custom_data.' . $custom->id, |
|
105 | - (int)$custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
104 | + 'custom_data.'.$custom->id, |
|
105 | + (int) $custom->reg_cond === 1 ? 'direct_match' : 'reverse_match', |
|
106 | 106 | $custom->reg_exp |
107 | 107 | ]; |
108 | 108 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function before() |
44 | 44 | { |
45 | 45 | foreach ($this->_apps as $app) { |
46 | - $this->_definedControllers[] = (string)$app->sys_name; |
|
46 | + $this->_definedControllers[] = (string) $app->sys_name; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | parent::before(); |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | public function make() |
80 | 80 | { |
81 | 81 | $cName = ucfirst(Str::lowerCase($this->sysname)); |
82 | - $cPath = 'Apps\Controller\Admin\\' . $cName; |
|
82 | + $cPath = 'Apps\Controller\Admin\\'.$cName; |
|
83 | 83 | // if object class is not loaded - prevent install |
84 | - if (!class_exists($cPath) || !defined($cPath . '::VERSION')) { |
|
84 | + if (!class_exists($cPath) || !defined($cPath.'::VERSION')) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | |
88 | 88 | // get ext version |
89 | - $cVersion = constant($cPath . '::VERSION'); |
|
89 | + $cVersion = constant($cPath.'::VERSION'); |
|
90 | 90 | if ($cVersion === null || Str::likeEmpty($cVersion)) { |
91 | 91 | $cVersion = '1.0.0'; |
92 | 92 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // callback to install method in extension |
104 | 104 | if (method_exists($cPath, 'install')) { |
105 | - call_user_func($cPath . '::install'); |
|
105 | + call_user_func($cPath.'::install'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return true; |
@@ -34,12 +34,12 @@ |
||
34 | 34 | */ |
35 | 35 | public function make() |
36 | 36 | { |
37 | - $archive = $this->name . '.zip'; |
|
37 | + $archive = $this->name.'.zip'; |
|
38 | 38 | // download archive |
39 | - File::saveFromUrl($this->url, '/' . $archive); |
|
39 | + File::saveFromUrl($this->url, '/'.$archive); |
|
40 | 40 | // extract archive |
41 | 41 | $zip = new \ZipArchive(); |
42 | - if ($zip->open(root . '/' . $archive) === true) { |
|
42 | + if ($zip->open(root.'/'.$archive) === true) { |
|
43 | 43 | $zip->extractTo(root); |
44 | 44 | $zip->close(); |
45 | 45 | // cleanup cache |
@@ -76,7 +76,7 @@ |
||
76 | 76 | $this->_content->save(); |
77 | 77 | |
78 | 78 | // update content author rating |
79 | - $authorId = (int)$this->_content->author_id; |
|
79 | + $authorId = (int) $this->_content->author_id; |
|
80 | 80 | if ($authorId > 0 && App::$User->isExist($authorId)) { |
81 | 81 | $authorObject = App::$User->identity($authorId); |
82 | 82 | if ($authorObject !== null) { |