@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Saito\Posting\Basic\BasicPostingInterface; |
| 6 | 6 | use Saito\Posting\Basic\BasicPostingTrait; |
| 7 | -use Saito\Posting\Decorator\PostingTrait; |
|
| 8 | 7 | use Saito\Posting\Decorator\UserPostingTrait; |
| 9 | 8 | use Saito\Thread\Thread; |
| 10 | 9 | use Saito\User\CurrentUser\CurrentUser; |
@@ -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 |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Saito\Smiley; |
| 4 | 4 | |
| 5 | 5 | use Cake\Cache\Cache; |
| 6 | -use Cake\Core\Configure; |
|
| 7 | 6 | use Cake\ORM\TableRegistry; |
| 8 | 7 | |
| 9 | 8 | class SmileyLoader |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | if ($this->_smilies !== null) { |
| 22 | 22 | return $this->_smilies; |
| 23 | 23 | } |
| 24 | - $this->_smilies = Cache::remember('Saito.Smilies.data', function () { |
|
| 24 | + $this->_smilies = Cache::remember('Saito.Smilies.data', function() { |
|
| 25 | 25 | $Smilies = TableRegistry::get('Smilies'); |
| 26 | 26 | $smiliesRaw = $Smilies->find() |
| 27 | 27 | ->contain(['SmileyCodes']) |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * Constructor |
| 30 | 30 | * |
| 31 | - * @param array $smileyData data |
|
| 31 | + * @param SmileyLoader $smileyData data |
|
| 32 | 32 | */ |
| 33 | 33 | public function __construct(SmileyLoader $smileyData) |
| 34 | 34 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Set Helper |
| 63 | 63 | * |
| 64 | - * @param Helper $Helper helper |
|
| 64 | + * @param HtmlHelper $Helper helper |
|
| 65 | 65 | * @return self |
| 66 | 66 | */ |
| 67 | 67 | public function setHelper(HtmlHelper $Helper): self |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @param string $string string |
| 80 | 80 | * @param array $replacements replacements |
| 81 | - * @return mixed |
|
| 81 | + * @return string |
|
| 82 | 82 | */ |
| 83 | 83 | protected function _debug($string, $replacements) |
| 84 | 84 | { |
@@ -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', |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | namespace Saito\Test; |
| 14 | 14 | |
| 15 | 15 | use App\Test\Fixture\UserFixture; |
| 16 | - |
|
| 17 | 16 | use Cake\Core\Configure; |
| 18 | 17 | use Cake\Event\Event; |
| 19 | 18 | use Cake\Event\EventManager; |
@@ -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 |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $Mock = $this->getMockForTableParent($table, $methods); |
| 137 | 137 | EventManager::instance()->on( |
| 138 | 138 | 'Controller.initialize', |
| 139 | - function (Event $event) use ($table, $Mock) { |
|
| 139 | + function(Event $event) use ($table, $Mock) { |
|
| 140 | 140 | $Controller = $event->getSubject(); |
| 141 | 141 | $Controller->{$table} = $Mock; |
| 142 | 142 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $this->configRequest([ |
| 161 | 161 | 'headers' => [ |
| 162 | 162 | 'Accept' => 'application/json', |
| 163 | - 'Authorization' => 'bearer ' . $jwtToken, |
|
| 163 | + 'Authorization' => 'bearer '.$jwtToken, |
|
| 164 | 164 | ] |
| 165 | 165 | ]); |
| 166 | 166 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | { |
| 315 | 315 | $this->assertContainsTag( |
| 316 | 316 | $expected, |
| 317 | - (string)$this->_controller->response->getBody() |
|
| 317 | + (string) $this->_controller->response->getBody() |
|
| 318 | 318 | ); |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -4,9 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Cake\ORM\Table; |
| 6 | 6 | use Cake\ORM\TableRegistry; |
| 7 | -use Saito\App\Registry; |
|
| 8 | 7 | use Saito\Test\SaitoTestCase; |
| 9 | -use Saito\User\SaitoUser; |
|
| 10 | 8 | |
| 11 | 9 | abstract class SaitoTableTestCase extends SaitoTestCase |
| 12 | 10 | { |
@@ -2,9 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Saito\Test; |
| 4 | 4 | |
| 5 | -use Cake\Event\Event; |
|
| 6 | -use Cake\Event\EventManager; |
|
| 7 | - |
|
| 8 | 5 | trait SecurityMockTrait |
| 9 | 6 | { |
| 10 | 7 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * tested if new for user. |
| 38 | 38 | * |
| 39 | 39 | * @param string|\DateTimeInterface $timestamp int unix-timestamp or date as string |
| 40 | - * @return mixed bool or null if not determinable |
|
| 40 | + * @return null|boolean bool or null if not determinable |
|
| 41 | 41 | */ |
| 42 | 42 | public function isNewerThan($timestamp) |
| 43 | 43 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * Set timestamp. |
| 62 | 62 | * |
| 63 | - * @param mixed $timestamp null|'now'|<`Y-m-d H:i:s` timestamp> |
|
| 63 | + * @param string $timestamp null|'now'|<`Y-m-d H:i:s` timestamp> |
|
| 64 | 64 | * @return void |
| 65 | 65 | */ |
| 66 | 66 | public function set($timestamp = null) |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Saito\User\LastRefresh; |
| 4 | 4 | |
| 5 | -use App\Controller\Component\CurrentUserComponent; |
|
| 6 | 5 | use Saito\User\Cookie; |
| 7 | 6 | |
| 8 | 7 | /** |
@@ -127,6 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * {@inheritDoc} |
| 130 | + * @return boolean|string |
|
| 130 | 131 | */ |
| 131 | 132 | public function isLoggedIn() |
| 132 | 133 | { |
@@ -152,7 +153,7 @@ discard block |
||
| 152 | 153 | /** |
| 153 | 154 | * Checks if user is forbidden. |
| 154 | 155 | * |
| 155 | - * @return bool|string |
|
| 156 | + * @return string|false |
|
| 156 | 157 | */ |
| 157 | 158 | public function isForbidden() |
| 158 | 159 | { |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace Saito\User; |
| 4 | 4 | |
| 5 | 5 | use App\Model\Entity\User; |
| 6 | -use Cake\Core\Exception\Exception; |
|
| 7 | -use Cake\I18n\Time; |
|
| 8 | 6 | use Cake\Utility\Hash; |
| 9 | 7 | use Saito\App\Registry; |
| 10 | 8 | |
@@ -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 { |