@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * FormCommentUpdate constructor. Pass record inside the model. |
| 18 | - * @param Apps\ActiveRecord\CommentPost|Apps\ActiveRecord\CommentAnswer $record |
|
| 18 | + * @param \Ffcms\Core\Arch\ActiveModel $record |
|
| 19 | 19 | */ |
| 20 | 20 | public function __construct($record, $type = 'comment') |
| 21 | 21 | { |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Set default values from active record data |
|
| 28 | - */ |
|
| 27 | + * Set default values from active record data |
|
| 28 | + */ |
|
| 29 | 29 | public function before() |
| 30 | 30 | { |
| 31 | 31 | $this->message = $this->_record->message; |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * Labels to display in view |
|
| 37 | - */ |
|
| 36 | + * Labels to display in view |
|
| 37 | + */ |
|
| 38 | 38 | public function labels() |
| 39 | 39 | { |
| 40 | 40 | return [ |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * Validation rules for comment body |
|
| 48 | - */ |
|
| 47 | + * Validation rules for comment body |
|
| 48 | + */ |
|
| 49 | 49 | public function rules() |
| 50 | 50 | { |
| 51 | 51 | return [ |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | foreach ($records as $item) { |
| 33 | 33 | $message = Str::sub(\App::$Security->strip_tags($item->message), 0, 50); |
| 34 | 34 | $author = Simplify::parseUserNick($item->user_id, $item->guest_name); |
| 35 | - if ((int)$item->user_id > 0) { |
|
| 36 | - $author = Url::link(['user/update', (int)$item->user_id], $author); |
|
| 35 | + if ((int) $item->user_id > 0) { |
|
| 36 | + $author = Url::link(['user/update', (int) $item->user_id], $author); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | foreach ($records as $item) { |
| 32 | 32 | $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75); |
| 33 | 33 | $userArr = []; |
| 34 | - if ((int)$item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 34 | + if ((int) $item->user_id > 0 && \App::$User->isExist($item->user_id)) { |
|
| 35 | 35 | $userName = \App::$User->identity($item->user_id)->getProfile()->getNickname(); |
| 36 | 36 | $userArr = ['text' => Url::link(['user/update', $item->user_id], $userName), 'html' => true]; |
| 37 | 37 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function actionIndex() |
| 39 | 39 | { |
| 40 | 40 | // set current page and offset |
| 41 | - $page = (int)App::$Request->query->get('page'); |
|
| 41 | + $page = (int) App::$Request->query->get('page'); |
|
| 42 | 42 | $offset = $page * self::ITEM_PER_PAGE; |
| 43 | 43 | |
| 44 | 44 | // initialize active record model |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function actionDelete($type, $id = 0) |
| 134 | 134 | { |
| 135 | 135 | // sounds like a multiply delete definition |
| 136 | - if ($id === 0 || (int)$id < 1) { |
|
| 136 | + if ($id === 0 || (int) $id < 1) { |
|
| 137 | 137 | $ids = App::$Request->query->get('selectRemove'); |
| 138 | 138 | if (Obj::isArray($ids) && Arr::onlyNumericValues($ids)) { |
| 139 | 139 | $id = $ids; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function actionAnswerlist() |
| 184 | 184 | { |
| 185 | 185 | // set current page and offset |
| 186 | - $page = (int)App::$Request->query->get('page'); |
|
| 186 | + $page = (int) App::$Request->query->get('page'); |
|
| 187 | 187 | $offset = $page * self::ITEM_PER_PAGE; |
| 188 | 188 | |
| 189 | 189 | // initialize ar answers model |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Apps\ActiveRecord; |
| 4 | 4 | |
| 5 | -use Ffcms\Core\App as AppMain; |
|
| 6 | 5 | use Ffcms\Core\Arch\ActiveModel; |
| 7 | 6 | use Ffcms\Core\Helper\FileSystem\File; |
| 8 | 7 | use Ffcms\Core\Helper\Type\Str; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | if ($rating > 0) { |
| 9 | 9 | $cssRatingClass = 'label-success'; |
| 10 | 10 | $numericRating = '+' . $rating; |
| 11 | -} elseif($rating < 0) { |
|
| 11 | +} elseif ($rating < 0) { |
|
| 12 | 12 | $cssRatingClass = 'label-danger'; |
| 13 | 13 | $numericRating = $rating; |
| 14 | 14 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | App::$Session->set('content.rate.ignore', $ignored); |
| 65 | 65 | |
| 66 | 66 | // save rating changes to database |
| 67 | - switch($this->_type) { |
|
| 67 | + switch ($this->_type) { |
|
| 68 | 68 | case 'plus': |
| 69 | 69 | $this->_content->rating += 1; |
| 70 | 70 | break; |
@@ -76,7 +76,7 @@ discard block |
||
| 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) { |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | parent::before(); |
| 34 | 34 | $configs = AppRecord::getConfigs('app', 'Content'); |
| 35 | 35 | // prevent null-type config data |
| 36 | - if ((int)$configs['gallerySize'] > 0) { |
|
| 37 | - $this->maxSize = (int)$configs['gallerySize'] * 1024; |
|
| 36 | + if ((int) $configs['gallerySize'] > 0) { |
|
| 37 | + $this->maxSize = (int) $configs['gallerySize'] * 1024; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if ((int)$configs['galleryResize'] > 0) { |
|
| 41 | - $this->maxResize = (int)$configs['galleryResize']; |
|
| 40 | + if ((int) $configs['galleryResize'] > 0) { |
|
| 41 | + $this->maxResize = (int) $configs['galleryResize']; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // check file size |
| 131 | 131 | if ($file->getSize() < 1 || $file->getSize() > $this->maxSize) { |
| 132 | - throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize/1024)])); |
|
| 132 | + throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize / 1024)])); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // check file extension |