@@ -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 |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public static function all($columns = ['*']) |
| 28 | 28 | { |
| 29 | - $cacheName = 'activerecords.role.all.' . implode('.', $columns); |
|
| 29 | + $cacheName = 'activerecords.role.all.'.implode('.', $columns); |
|
| 30 | 30 | $records = MemoryObject::instance()->get($cacheName); |
| 31 | 31 | if ($records === null) { |
| 32 | 32 | $records = parent::all($columns); |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function get($role_id) |
| 45 | 45 | { |
| 46 | - $role = MainApp::$Memory->get('user.role.cache.' . $role_id); |
|
| 46 | + $role = MainApp::$Memory->get('user.role.cache.'.$role_id); |
|
| 47 | 47 | |
| 48 | 48 | // not founded in cache |
| 49 | 49 | if ($role === null) { |
| 50 | 50 | $role = self::find($role_id); |
| 51 | - MainApp::$Memory->set('user.role.cache.' . $role_id, $role); |
|
| 51 | + MainApp::$Memory->set('user.role.cache.'.$role_id, $role); |
|
| 52 | 52 | } |
| 53 | 53 | return $role; |
| 54 | 54 | } |
@@ -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); |
@@ -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), |
@@ -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 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $password = App::$Security->password_hash($this->password); |
| 72 | 72 | |
| 73 | - $search = App::$User->where('password', '=', $password)->where(function ($query) { |
|
| 73 | + $search = App::$User->where('password', '=', $password)->where(function($query) { |
|
| 74 | 74 | $query->where('login', '=', $this->login) |
| 75 | 75 | ->orWhere('email', '=', $this->login); |
| 76 | 76 | }); |
@@ -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 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public static function all($columns = ['*']) |
| 36 | 36 | { |
| 37 | - $cacheName = 'activerecord.contentcategory.all.' . implode('.', $columns); |
|
| 37 | + $cacheName = 'activerecord.contentcategory.all.'.implode('.', $columns); |
|
| 38 | 38 | $records = MemoryObject::instance()->get($cacheName); |
| 39 | 39 | if ($records === null) { |
| 40 | 40 | $records = parent::all($columns); |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public static function getByPath($path = '') |
| 52 | 52 | { |
| 53 | - if (MainApp::$Memory->get('cache.content.category.path.' . $path) !== null) { |
|
| 54 | - return MainApp::$Memory->get('cache.content.category.path.' . $path); |
|
| 53 | + if (MainApp::$Memory->get('cache.content.category.path.'.$path) !== null) { |
|
| 54 | + return MainApp::$Memory->get('cache.content.category.path.'.$path); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $record = self::where('path', '=', $path)->first(); |
| 58 | - MainApp::$Memory->set('cache.content.category.path.' . $path, $record); |
|
| 58 | + MainApp::$Memory->set('cache.content.category.path.'.$path, $record); |
|
| 59 | 59 | return $record; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public static function getById($id) |
| 68 | 68 | { |
| 69 | - if (MainApp::$Memory->get('cache.content.category.id.' . $id) !== null) { |
|
| 70 | - return MainApp::$Memory->get('cache.content.category.id.' . $id); |
|
| 69 | + if (MainApp::$Memory->get('cache.content.category.id.'.$id) !== null) { |
|
| 70 | + return MainApp::$Memory->get('cache.content.category.id.'.$id); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $record = self::find($id); |
| 74 | - MainApp::$Memory->set('cache.content.category.id.' . $id, $record); |
|
| 74 | + MainApp::$Memory->set('cache.content.category.id.'.$id, $record); |
|
| 75 | 75 | return $record; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | } else { |
| 100 | 100 | // set level marker based on slashes count in pathway |
| 101 | 101 | $slashCount = Str::entryCount($path, '/'); |
| 102 | - for ($i=-1; $i <= $slashCount; $i++) { |
|
| 102 | + for ($i = -1; $i <= $slashCount; $i++) { |
|
| 103 | 103 | $title .= '--'; |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | // add canonical title from db |
| 107 | - $title .= ' ' . $data->getLocaled('title'); |
|
| 107 | + $title .= ' '.$data->getLocaled('title'); |
|
| 108 | 108 | // set response as array [id => title, ... ] |
| 109 | 109 | $response[$data->id] = $title; |
| 110 | 110 | } |