@@ -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 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $Users = TableRegistry::get('Users'); |
50 | 50 | $contact = $Users->find() |
51 | 51 | ->select(['id', 'username', 'user_email']) |
52 | - ->where(['id' => (int)$contact]) |
|
52 | + ->where(['id' => (int) $contact]) |
|
53 | 53 | ->first(); |
54 | 54 | } |
55 | 55 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $requestMethod = $request ? $request->getMethod() : false; |
57 | 57 | if ($url && $requestMethod) { |
58 | - $url .= ' ' . $requestMethod; |
|
58 | + $url .= ' '.$requestMethod; |
|
59 | 59 | } |
60 | 60 | if ($url) { |
61 | 61 | $this->_add($url, 'Request URL'); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $i++; |
156 | 156 | } |
157 | 157 | |
158 | - return "\n" . implode("\n", $message); |
|
158 | + return "\n".implode("\n", $message); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | if ($this->_settings['maxItems']) { |
62 | 62 | $this->_gcFuzzy = $this->_settings['maxItemsFuzzy']; |
63 | - $this->_gcMax = (int)($this->_settings['maxItems'] * (1 + $this->_gcFuzzy)); |
|
64 | - $this->_gcMin = (int)($this->_gcMax * (1 - $this->_gcFuzzy)); |
|
63 | + $this->_gcMax = (int) ($this->_settings['maxItems'] * (1 + $this->_gcFuzzy)); |
|
64 | + $this->_gcMin = (int) ($this->_gcMax * (1 - $this->_gcFuzzy)); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | // keep items which were last used/updated |
274 | 274 | uasort( |
275 | 275 | $this->_cache, |
276 | - function ($a, $b) { |
|
276 | + function($a, $b) { |
|
277 | 277 | if ($a['metadata']['content_last_updated'] === $b['metadata']['content_last_updated']) { |
278 | 278 | return 0; |
279 | 279 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function __construct() |
35 | 35 | { |
36 | 36 | foreach ($this->_buildInCaches as $_name) { |
37 | - $name = 'Saito\Cache\\' . $_name; |
|
37 | + $name = 'Saito\Cache\\'.$_name; |
|
38 | 38 | $this->add(new $name); |
39 | 39 | } |
40 | 40 | EventManager::instance()->on($this); |
@@ -117,7 +117,7 @@ |
||
117 | 117 | if (!isset(self::$_catL10n[$categoryId])) { |
118 | 118 | $accession = $posting['category']['accession']; |
119 | 119 | $catAcs = h( |
120 | - __d('nondynamic', 'category_acs_' . $accession . '_exp') |
|
120 | + __d('nondynamic', 'category_acs_'.$accession.'_exp') |
|
121 | 121 | ); |
122 | 122 | $catDesc = h($posting['category']['description']); |
123 | 123 | $catTitle = h($posting['category']['category']); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $childrenHtml .= $this->_renderNode($child); |
92 | 92 | } |
93 | 93 | $level = $node->getLevel(); |
94 | - $html .= '<li>' . $this->_wrapUl($childrenHtml, $level + 1) . '</li>'; |
|
94 | + $html .= '<li>'.$this->_wrapUl($childrenHtml, $level + 1).'</li>'; |
|
95 | 95 | |
96 | 96 | return $html; |
97 | 97 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $data = ''; |
123 | 123 | if ($level === 0) { |
124 | 124 | $class .= ' root'; |
125 | - $data = 'data-id="' . $id . '"'; |
|
125 | + $data = 'data-id="'.$id.'"'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return "<ul {$data} class=\"{$class}\">{$string}</ul>"; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | $entryType = ($node->isRoot()) ? 'et-root' : 'et-reply'; |
140 | 140 | $entryType .= ($node->isUnread()) ? ' et-new' : ' et-old'; |
141 | - if ($node->get('id') === (int)$this->_settings['currentEntry']) { |
|
141 | + if ($node->get('id') === (int) $this->_settings['currentEntry']) { |
|
142 | 142 | $entryType .= ' et-current'; |
143 | 143 | } |
144 | 144 | $css = $entryType; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | return $this->remember( |
24 | 24 | 'UsersOnline', |
25 | - function () { |
|
25 | + function() { |
|
26 | 26 | $UserOnline = TableRegistry::get('UserOnline'); |
27 | 27 | |
28 | 28 | return $UserOnline->getLoggedIn(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | return $this->remember( |
41 | 41 | 'numberOfRegisteredUsersOnline', |
42 | - function () { |
|
42 | + function() { |
|
43 | 43 | return $this->getRegistredUsersOnline()->count(); |
44 | 44 | } |
45 | 45 | ); |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | { |
122 | 122 | $stats = $this->remember( |
123 | 123 | 'init', |
124 | - function () { |
|
124 | + function() { |
|
125 | 125 | Stopwatch::start('Saito\App\Stats::init()'); |
126 | 126 | |
127 | 127 | $stats = Cache::remember( |
128 | 128 | 'header_counter', |
129 | - function () { |
|
129 | + function() { |
|
130 | 130 | $Entries = TableRegistry::get('Entries'); |
131 | 131 | $Users = TableRegistry::get('Users'); |
132 | 132 | $UserOnline = TableRegistry::get('UserOnline'); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Saito - The Threaded Web Forum |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $this->_mapFields( |
57 | 57 | $data, |
58 | 58 | $required, |
59 | - function (&$data, $field, $model = null) { |
|
59 | + function(&$data, $field, $model = null) { |
|
60 | 60 | if ($model === null) { |
61 | 61 | if (!isset($data[$field])) { |
62 | 62 | return false; |