@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * FormCommentUpdate constructor. Pass record inside the model. |
| 22 | - * @param \Apps\ActiveRecord\CommentPost|\Apps\ActiveRecord\CommentAnswer $record |
|
| 22 | + * @param \Ffcms\Core\Arch\ActiveModel $record |
|
| 23 | 23 | */ |
| 24 | 24 | public function __construct($record, $type = 'comment') |
| 25 | 25 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | // render view output |
| 37 | 37 | return $this->view->render('index', [ |
| 38 | - 'model' => $model |
|
| 38 | + 'model' => $model |
|
| 39 | 39 | ]); |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -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 |
@@ -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) { |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function before() |
| 28 | 28 | { |
| 29 | - $this->count = (int)$this->_configs['count']; |
|
| 30 | - $this->cache = (int)$this->_configs['cache']; |
|
| 29 | + $this->count = (int) $this->_configs['count']; |
|
| 30 | + $this->cache = (int) $this->_configs['cache']; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -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 | } |