@@ -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 |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if ($secured && $hasSettingsTable) { |
| 71 | 71 | $this->log('Installer found Settings-table. Moving on to Updater.', LogLevel::INFO, ['saito.install']); |
| 72 | 72 | //// disable installer and move on to updater instead |
| 73 | - (new File(CONFIG . 'installer'))->delete(); |
|
| 73 | + (new File(CONFIG.'installer'))->delete(); |
|
| 74 | 74 | |
| 75 | 75 | return $this->redirect('/'); |
| 76 | 76 | } |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Cake\Event\Event; |
| 10 | 10 | use Cake\Http\Response; |
| 11 | 11 | use Cake\I18n\I18n; |
| 12 | -use Cake\Routing\Router; |
|
| 13 | 12 | use Saito\App\SettingsImmutable; |
| 14 | 13 | use Saito\Event\SaitoEventManager; |
| 15 | 14 | use Saito\User\CurrentUser\CurrentUser; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | |
| 10 | 10 | namespace App\View\Helper; |
| 11 | 11 | |
| 12 | -use Cake\Core\Configure; |
|
| 13 | 12 | use Cake\View\Helper; |
| 14 | 13 | use Cake\View\StringTemplateTrait; |
| 15 | 14 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $html = "<i class=\"saito-icon fa fa-{$icon}\"></i>"; |
| 66 | 66 | if (!empty($text)) { |
| 67 | - $html .= ' <span class="saito-icon-text">' . $text . '</span>'; |
|
| 67 | + $html .= ' <span class="saito-icon-text">'.$text.'</span>'; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return $html; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | public function dropdownMenuButton(array $menuItems, array $options = []) |
| 81 | 81 | { |
| 82 | 82 | $options += ['class' => 'btn btn-primary']; |
| 83 | - $options['class'] = $options['class'] . ' dropdown-toggle'; |
|
| 83 | + $options['class'] = $options['class'].' dropdown-toggle'; |
|
| 84 | 84 | $menu = []; |
| 85 | 85 | foreach ($menuItems as $menuItem) { |
| 86 | 86 | if ($menuItem === 'divider') { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $contentArray += ['first' => '', 'middle' => '', 'last' => '']; |
| 174 | 174 | $out = ''; |
| 175 | 175 | foreach (['first', 'middle', 'last'] as $key) { |
| 176 | - $out .= '<div class="' . $key . '">'; |
|
| 176 | + $out .= '<div class="'.$key.'">'; |
|
| 177 | 177 | $out .= $options['escape'] ? h($contentArray[$key]) : $contentArray[$key]; |
| 178 | 178 | $out .= '</div>'; |
| 179 | 179 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | $code = $this->request->getQuery('c'); |
| 236 | 236 | try { |
| 237 | - $activated = $this->Users->activate((int)$id, $code); |
|
| 237 | + $activated = $this->Users->activate((int) $id, $code); |
|
| 238 | 238 | } catch (\Exception $e) { |
| 239 | 239 | $activated = false; |
| 240 | 240 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | public function ignore() |
| 293 | 293 | { |
| 294 | 294 | $this->request->allowMethod('POST'); |
| 295 | - $blockedId = (int)$this->request->getData('id'); |
|
| 295 | + $blockedId = (int) $this->request->getData('id'); |
|
| 296 | 296 | $this->_ignore($blockedId, true); |
| 297 | 297 | } |
| 298 | 298 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | public function unignore() |
| 305 | 305 | { |
| 306 | 306 | $this->request->allowMethod('POST'); |
| 307 | - $blockedId = (int)$this->request->getData('id'); |
|
| 307 | + $blockedId = (int) $this->request->getData('id'); |
|
| 308 | 308 | $this->_ignore($blockedId, false); |
| 309 | 309 | } |
| 310 | 310 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | protected function _ignore($blockedId, $set) |
| 319 | 319 | { |
| 320 | 320 | $userId = $this->CurrentUser->getId(); |
| 321 | - if ((int)$userId === (int)$blockedId) { |
|
| 321 | + if ((int) $userId === (int) $blockedId) { |
|
| 322 | 322 | throw new BadRequestException(); |
| 323 | 323 | } |
| 324 | 324 | if ($set) { |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $user = $this->Users->find() |
| 380 | 380 | ->contain( |
| 381 | 381 | [ |
| 382 | - 'UserBlocks' => function ($q) { |
|
| 382 | + 'UserBlocks' => function($q) { |
|
| 383 | 383 | return $q->find('assocUsers'); |
| 384 | 384 | }, |
| 385 | 385 | 'UserOnline' |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | throw new BadRequestException; |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - $id = (int)$this->request->getData('lockUserId'); |
|
| 543 | + $id = (int) $this->request->getData('lockUserId'); |
|
| 544 | 544 | if (!$this->Users->exists($id)) { |
| 545 | 545 | throw new NotFoundException('User does not exist.', 1524298280); |
| 546 | 546 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $this->Flash->set($message, ['element' => 'error']); |
| 555 | 555 | } else { |
| 556 | 556 | try { |
| 557 | - $duration = (int)$this->request->getData('lockPeriod'); |
|
| 557 | + $duration = (int) $this->request->getData('lockPeriod'); |
|
| 558 | 558 | $blocker = new ManualBlocker($this->CurrentUser->getId(), $duration); |
| 559 | 559 | $status = $this->Users->UserBlocks->block($blocker, $id); |
| 560 | 560 | if (!$status) { |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $allowed = $this->Slidetabs->getAvailable(); |
| 680 | 680 | $order = array_filter( |
| 681 | 681 | $order, |
| 682 | - function ($item) use ($allowed) { |
|
| 682 | + function($item) use ($allowed) { |
|
| 683 | 683 | return in_array($item, $allowed); |
| 684 | 684 | } |
| 685 | 685 | ); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | return call_user_func_array([$this->_Posting, $method], $args); |
| 36 | 36 | } |
| 37 | 37 | throw new \RuntimeException( |
| 38 | - 'Undefined method ' . get_class($this) . '::' . $method |
|
| 38 | + 'Undefined method '.get_class($this).'::'.$method |
|
| 39 | 39 | ); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -1,6 +1,6 @@ |
||
| 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 |
@@ -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 |
@@ -70,6 +70,6 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $entity = $this->Table->newEntity($conditions); |
| 72 | 72 | |
| 73 | - return (bool)$this->Table->save($entity); |
|
| 73 | + return (bool) $this->Table->save($entity); |
|
| 74 | 74 | } |
| 75 | 75 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function __construct($type = null, $data = []) |
| 14 | 14 | { |
| 15 | - $message = 'Request was blackholed. Type: ' . $type; |
|
| 15 | + $message = 'Request was blackholed. Type: '.$type; |
|
| 16 | 16 | $logger = new ExceptionLogger; |
| 17 | 17 | $logger->write($message, $data); |
| 18 | 18 | parent::__construct($message, 400); |
@@ -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 |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $document = new \DOMDocument; |
| 91 | 91 | libxml_use_internal_errors(true); |
| 92 | - $document->loadHTML('<!DOCTYPE html>' . $html); |
|
| 92 | + $document->loadHTML('<!DOCTYPE html>'.$html); |
|
| 93 | 93 | $xpath = new \DOMXPath($document); |
| 94 | 94 | libxml_clear_errors(); |
| 95 | 95 | |