@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | $threads = $this->Threads->paginate($order); |
82 | 82 | $this->set('entries', $threads); |
83 | 83 | |
84 | - $currentPage = (int)$this->request->getQuery('page') ?: 1; |
|
84 | + $currentPage = (int) $this->request->getQuery('page') ?: 1; |
|
85 | 85 | if ($currentPage > 1) { |
86 | - $this->set('titleForLayout', __('page') . ' ' . $currentPage); |
|
86 | + $this->set('titleForLayout', __('page').' '.$currentPage); |
|
87 | 87 | } |
88 | 88 | if ($currentPage === 1) { |
89 | 89 | if ($this->MarkAsRead->refresh()) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function mix($tid) |
118 | 118 | { |
119 | - $tid = (int)$tid; |
|
119 | + $tid = (int) $tid; |
|
120 | 120 | if ($tid <= 0) { |
121 | 121 | throw new BadRequestException(); |
122 | 122 | } |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $redirect = '/'; |
486 | 486 | } else { |
487 | 487 | $message = __('delete_subtree_success'); |
488 | - $redirect = '/entries/view/' . $posting->get('pid'); |
|
488 | + $redirect = '/entries/view/'.$posting->get('pid'); |
|
489 | 489 | } |
490 | 490 | } else { |
491 | 491 | $flashType = 'error'; |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | $targetId = $this->request->getData('targetId'); |
553 | 553 | if (!empty($targetId)) { |
554 | 554 | if ($this->Entries->threadMerge($sourceId, $targetId)) { |
555 | - $this->redirect('/entries/view/' . $sourceId); |
|
555 | + $this->redirect('/entries/view/'.$sourceId); |
|
556 | 556 | |
557 | 557 | return; |
558 | 558 | } else { |
@@ -583,11 +583,11 @@ discard block |
||
583 | 583 | throw new BadRequestException; |
584 | 584 | } |
585 | 585 | |
586 | - $current = $this->Entries->toggle((int)$id, $toggle); |
|
586 | + $current = $this->Entries->toggle((int) $id, $toggle); |
|
587 | 587 | if ($current) { |
588 | - $out['html'] = __d('nondynamic', $toggle . '_unset_entry_link'); |
|
588 | + $out['html'] = __d('nondynamic', $toggle.'_unset_entry_link'); |
|
589 | 589 | } else { |
590 | - $out['html'] = __d('nondynamic', $toggle . '_set_entry_link'); |
|
590 | + $out['html'] = __d('nondynamic', $toggle.'_set_entry_link'); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | $this->response = $this->response->withType('json'); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $this->response->disableCache(); |
47 | 47 | $out = ''; |
48 | 48 | $out .= "retry: $retry\n"; |
49 | - $out .= 'data: ' . $data . "\n\n"; |
|
49 | + $out .= 'data: '.$data."\n\n"; |
|
50 | 50 | |
51 | 51 | return $out; |
52 | 52 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | 'subject' => $this->request->getData('subject'), |
106 | 106 | 'message' => $this->request->getData('text'), |
107 | 107 | 'template' => 'user_contact', |
108 | - 'ccsender' => (bool)$this->request->getData('cc'), |
|
108 | + 'ccsender' => (bool) $this->request->getData('cc'), |
|
109 | 109 | ]; |
110 | 110 | $this->SaitoEmail->email($email); |
111 | 111 | $message = __('Message was send.'); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | //= set persistent Cookie |
183 | - $setCookie = (bool)$this->request->getData('remember_me'); |
|
183 | + $setCookie = (bool) $this->request->getData('remember_me'); |
|
184 | 184 | if ($setCookie) { |
185 | 185 | (new CurrentUserCookie($this->getController()))->write($this->getId()); |
186 | 186 | }; |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $auth->setConfig('loginAction', '/login'); |
293 | 293 | |
294 | 294 | $here = urlencode($this->getController()->getRequest()->getRequestTarget()); |
295 | - $auth->setConfig('unauthorizedRedirect', '/login?redirect=' . $here); |
|
295 | + $auth->setConfig('unauthorizedRedirect', '/login?redirect='.$here); |
|
296 | 296 | |
297 | 297 | if ($this->isLoggedIn()) { |
298 | 298 | $auth->allow(); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | private function setJwtCookie(Controller $controller): void |
320 | 320 | { |
321 | - $cookieKey = Configure::read('Session.cookie') . '-jwt'; |
|
321 | + $cookieKey = Configure::read('Session.cookie').'-jwt'; |
|
322 | 322 | $cookie = (new Storage($controller, $cookieKey, ['http' => false, 'expire' => '+1 week'])); |
323 | 323 | |
324 | 324 | $existingToken = $cookie->read(); |
@@ -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 | namespace App\Controller\Component; |
6 | 6 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $ctrler = $controller->request->getParam('controller'); |
47 | 47 | $action = $controller->request->getParam('action'); |
48 | - $key = lcfirst($ctrler) . '/' . $action; |
|
48 | + $key = lcfirst($ctrler).'/'.$action; |
|
49 | 49 | $page = __d('page_titles', $key); |
50 | 50 | if ($key === $page) { |
51 | 51 | $page = ''; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $tabs = $slidetabs; |
50 | 50 | } |
51 | 51 | $tabs = array_map( |
52 | - function ($v) { |
|
52 | + function($v) { |
|
53 | 53 | return $this->_available[$v]; |
54 | 54 | }, |
55 | 55 | $tabs |
@@ -80,14 +80,14 @@ |
||
80 | 80 | 'order' => $order, |
81 | 81 | // Performance: Custom counter from categories counter-cache; |
82 | 82 | // avoids a costly COUNT(*) DB call counting all pages for pagination. |
83 | - 'counter' => function ($query) use ($categories) { |
|
83 | + 'counter' => function($query) use ($categories) { |
|
84 | 84 | $results = $this->Entries->Categories->find('all') |
85 | 85 | ->select(['thread_count']) |
86 | 86 | ->where(['id IN' => $categories]) |
87 | 87 | ->all(); |
88 | 88 | $count = array_reduce( |
89 | 89 | $results->toArray(), |
90 | - function ($carry, Entity $entity) { |
|
90 | + function($carry, Entity $entity) { |
|
91 | 91 | return $carry + $entity->get('thread_count'); |
92 | 92 | }, |
93 | 93 | 0 |
@@ -22,11 +22,11 @@ |
||
22 | 22 | if (!is_numeric($value)) { |
23 | 23 | return false; |
24 | 24 | } |
25 | - $value = (int)$value; |
|
25 | + $value = (int) $value; |
|
26 | 26 | |
27 | - $key = $table . $value; |
|
27 | + $key = $table.$value; |
|
28 | 28 | |
29 | - return static::rememberStatic($key, function () use ($value, $table) { |
|
29 | + return static::rememberStatic($key, function() use ($value, $table) { |
|
30 | 30 | $Table = TableRegistry::get($table); |
31 | 31 | |
32 | 32 | return $Table->exists(['id' => $value]); |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $delimiter = '/'; |
134 | 134 | foreach ($codes['codes'] as $key => $code) { |
135 | - $codes['quoted'][$key] = $delimiter . |
|
135 | + $codes['quoted'][$key] = $delimiter. |
|
136 | 136 | // a smiley can't be concatenated to a string and requires a |
137 | 137 | // whitespace in front |
138 | - '(^|(?<=(\s)))' . |
|
139 | - preg_quote($code, $delimiter) . |
|
138 | + '(^|(?<=(\s)))'. |
|
139 | + preg_quote($code, $delimiter). |
|
140 | 140 | $delimiter; |
141 | 141 | } |
142 | 142 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | //= pixel image smileys |
168 | 168 | } else { |
169 | 169 | $replacements['html'][$k] = $this->HtmlHelper->image( |
170 | - 'smilies/' . $smiley['image'], |
|
170 | + 'smilies/'.$smiley['image'], |
|
171 | 171 | [ |
172 | 172 | 'alt' => $smiley['code'], |
173 | 173 | 'class' => 'saito-smiley-image', |