@@ -167,7 +167,7 @@ |
||
| 167 | 167 | { |
| 168 | 168 | if (!$this->isRoot()) { |
| 169 | 169 | throw new \RuntimeException( |
| 170 | - 'Posting with id ' . $this->get('id') . ' is no root posting.' |
|
| 170 | + 'Posting with id '.$this->get('id').' is no root posting.' |
|
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | if (!$this->_CurrentUser->get('last_refresh')) { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | return call_user_func_array([$this->_Posting, $method], $args); |
| 25 | 25 | } |
| 26 | 26 | throw new \RuntimeException( |
| 27 | - 'Undefined method ' . get_class($this->object) . '::' . $method |
|
| 27 | + 'Undefined method '.get_class($this->object).'::'.$method |
|
| 28 | 28 | ); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function isLocked() |
| 14 | 14 | { |
| 15 | - return (bool)$this->get('locked'); |
|
| 15 | + return (bool) $this->get('locked'); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | /** |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function isPinned() |
| 32 | 32 | { |
| 33 | - return (bool)$this->get('fixed'); |
|
| 33 | + return (bool) $this->get('fixed'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | { |
| 103 | 103 | $postings = []; |
| 104 | 104 | $this->map( |
| 105 | - function ($node) use (&$postings) { |
|
| 105 | + function($node) use (&$postings) { |
|
| 106 | 106 | $postings[$node->get('id')] = $node; |
| 107 | 107 | }, |
| 108 | 108 | false |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function get(): array |
| 22 | 22 | { |
| 23 | - return $this->remember('userlist', function () { |
|
| 23 | + return $this->remember('userlist', function() { |
|
| 24 | 24 | /** @var UsersTable $users */ |
| 25 | 25 | $users = TableRegistry::get('Users'); |
| 26 | 26 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | protected function _getRoles($role) |
| 114 | 114 | { |
| 115 | - $key = 'saito.core.permission.' . $role; |
|
| 115 | + $key = 'saito.core.permission.'.$role; |
|
| 116 | 116 | |
| 117 | 117 | return $this->rememberStatic( |
| 118 | 118 | $key, |
| 119 | - function () use ($role) { |
|
| 119 | + function() use ($role) { |
|
| 120 | 120 | if (!isset($this->groups[$role])) { |
| 121 | 121 | return false; |
| 122 | 122 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | Stopwatch::start('Permission::__construct()'); |
| 147 | 147 | $this->resources = Cache::remember( |
| 148 | 148 | 'saito.core.permission.resources', |
| 149 | - function () { |
|
| 149 | + function() { |
|
| 150 | 150 | $this->_bootstrapCategories(); |
| 151 | 151 | |
| 152 | 152 | return $this->resources; |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | public function getAll($action, $format = 'short') |
| 49 | 49 | { |
| 50 | 50 | Stopwatch::start('User\Categories::getAll()'); |
| 51 | - $key = $action . '.' . $format; |
|
| 51 | + $key = $action.'.'.$format; |
|
| 52 | 52 | $categories = $this->remember( |
| 53 | 53 | $key, |
| 54 | - function () use ($action, $format) { |
|
| 54 | + function() use ($action, $format) { |
|
| 55 | 55 | /* @var CategoriesTable $Categories */ |
| 56 | 56 | $Categories = TableRegistry::get('Categories'); |
| 57 | 57 | $all = $Categories->getAllCategories(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | case 'custom': |
| 91 | 91 | return $this->getCustom($action); |
| 92 | 92 | case 'single': |
| 93 | - $category = (int)$this->_User->get('user_category_active'); |
|
| 93 | + $category = (int) $this->_User->get('user_category_active'); |
|
| 94 | 94 | $categories = [$category => $category]; |
| 95 | 95 | |
| 96 | 96 | return $this->_filterAllowed($action, $categories); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function getType() |
| 144 | 144 | { |
| 145 | - $active = (int)$this->_User->get('user_category_active'); |
|
| 145 | + $active = (int) $this->_User->get('user_category_active'); |
|
| 146 | 146 | if ($active > 0) { |
| 147 | 147 | return 'single'; |
| 148 | 148 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } elseif (is_array($category)) { |
| 171 | 171 | $category = $category['id']; |
| 172 | 172 | } |
| 173 | - $resource = 'saito.core.category.' . $category . '.' . $action; |
|
| 173 | + $resource = 'saito.core.category.'.$category.'.'.$action; |
|
| 174 | 174 | |
| 175 | 175 | return $this->_User->permission($resource); |
| 176 | 176 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | { |
| 185 | 185 | return $this->remember( |
| 186 | 186 | 'isCustomAllowed', |
| 187 | - function () { |
|
| 187 | + function() { |
|
| 188 | 188 | if (!$this->_User->isLoggedIn()) { |
| 189 | 189 | return false; |
| 190 | 190 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // `webroot/files/<table>/<field>/<seed>/<file>` |
| 75 | 75 | |
| 76 | - $newFilename = Text::uuid() . $ext; |
|
| 76 | + $newFilename = Text::uuid().$ext; |
|
| 77 | 77 | |
| 78 | 78 | // $path->setTable('avatars'); |
| 79 | 79 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $dir = $user->get('id'); |
| 120 | 120 | if (!empty($dir)) { |
| 121 | 121 | $folder = new Folder( |
| 122 | - $this->rootDirectory . '/users/avatar/' . $dir |
|
| 122 | + $this->rootDirectory.'/users/avatar/'.$dir |
|
| 123 | 123 | ); |
| 124 | 124 | $folder->delete(); |
| 125 | 125 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if (!empty($settings['id'])) { |
| 59 | - $this->_id = (int)$settings['id']; |
|
| 59 | + $this->_id = (int) $settings['id']; |
|
| 60 | 60 | $this->_isLoggedIn = true; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | public function isUser($user) |
| 140 | 140 | { |
| 141 | 141 | if (is_numeric($user)) { |
| 142 | - $id = (int)$user; |
|
| 142 | + $id = (int) $user; |
|
| 143 | 143 | } elseif ($user instanceof ForumsUserInterface || $user instanceof User) { |
| 144 | 144 | $id = $user->get('id'); |
| 145 | 145 | } else { |