@@ -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 |
@@ -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 | /** |
@@ -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 |
@@ -127,6 +127,7 @@ |
||
127 | 127 | |
128 | 128 | /** |
129 | 129 | * {@inheritDoc} |
130 | + * @return boolean|string |
|
130 | 131 | */ |
131 | 132 | public function isLoggedIn() |
132 | 133 | { |
@@ -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 { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function isLocked(): bool |
158 | 158 | { |
159 | - return (bool)$this->get('user_lock'); |
|
159 | + return (bool) $this->get('user_lock'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -3,11 +3,9 @@ |
||
3 | 3 | namespace Saito\User\Upload; |
4 | 4 | |
5 | 5 | use App\Model\Entity\User; |
6 | -use Cake\Core\Configure; |
|
7 | 6 | use Cake\Event\Event; |
8 | 7 | use Cake\Event\EventListenerInterface; |
9 | 8 | use Cake\Filesystem\Folder; |
10 | -use Cake\ORM\Entity; |
|
11 | 9 | use Cake\Utility\Text; |
12 | 10 | use Proffer\Lib\ProfferPath; |
13 | 11 |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * get parent id |
417 | 417 | * |
418 | 418 | * @param int $id id |
419 | - * @return mixed |
|
419 | + * @return integer |
|
420 | 420 | * @throws \UnexpectedValueException |
421 | 421 | */ |
422 | 422 | public function getParentId($id) |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | /** |
628 | 628 | * trees for multiple tids |
629 | 629 | * |
630 | - * @param array $ids ids |
|
630 | + * @param integer[] $ids ids |
|
631 | 631 | * @param array $order order |
632 | 632 | * @param array $fieldlist fieldlist |
633 | 633 | * @return array|bool false if no threads or array of Postings |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | * @param array $params params |
680 | 680 | * - 'fields' array of thread-ids: [1, 2, 5] |
681 | 681 | * - 'order' sort order for threads ['time' => 'ASC'], |
682 | - * @return mixed unhydrated result set |
|
682 | + * @return Query unhydrated result set |
|
683 | 683 | */ |
684 | 684 | protected function _getThreadEntries(array $tid, array $params = []) |
685 | 685 | { |
@@ -747,6 +747,8 @@ discard block |
||
747 | 747 | |
748 | 748 | /** |
749 | 749 | * {@inheritDoc} |
750 | + * @param integer $id |
|
751 | + * @param string $key |
|
750 | 752 | */ |
751 | 753 | public function toggle($id, $key) |
752 | 754 | { |
@@ -826,7 +828,7 @@ discard block |
||
826 | 828 | * Anonymizes the entries for a user |
827 | 829 | * |
828 | 830 | * @param string $userId user-ID |
829 | - * @return bool success |
|
831 | + * @return integer success |
|
830 | 832 | */ |
831 | 833 | public function anonymizeEntriesFromUser($userId) |
832 | 834 | { |
@@ -933,7 +935,7 @@ discard block |
||
933 | 935 | * Check if posting is thread-root. |
934 | 936 | * |
935 | 937 | * @param array $id posting-ID or posting data |
936 | - * @return mixed |
|
938 | + * @return boolean |
|
937 | 939 | */ |
938 | 940 | protected function _isRoot(array $id) |
939 | 941 | { |
@@ -1128,7 +1130,7 @@ discard block |
||
1128 | 1130 | * |
1129 | 1131 | * @param null $tid thread-ID |
1130 | 1132 | * @param null $newCategoryId id for new category |
1131 | - * @return bool success |
|
1133 | + * @return integer success |
|
1132 | 1134 | * @throws \NotFoundException |
1133 | 1135 | * @throws \InvalidArgumentException |
1134 | 1136 | */ |
@@ -19,8 +19,6 @@ |
||
19 | 19 | use Cake\Http\Exception\NotFoundException; |
20 | 20 | use Cake\ORM\Entity; |
21 | 21 | use Cake\ORM\Query; |
22 | -use Cake\ORM\RulesChecker; |
|
23 | -use Cake\ORM\TableRegistry; |
|
24 | 22 | use Cake\Validation\Validator; |
25 | 23 | use Saito\App\Registry; |
26 | 24 | use Saito\Posting\Posting; |
@@ -618,7 +618,7 @@ |
||
618 | 618 | $tree = reset($tree); |
619 | 619 | |
620 | 620 | //= extract subtree |
621 | - if ((int)$tid !== (int)$id) { |
|
621 | + if ((int) $tid !== (int) $id) { |
|
622 | 622 | $tree = $tree->getThread()->get($id); |
623 | 623 | } |
624 | 624 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | * Fast version of Set::combine($results, '{n}.Setting.name', |
119 | 119 | * '{n}.Setting.value'); |
120 | 120 | * |
121 | - * @param array $results results |
|
121 | + * @param Query $results results |
|
122 | 122 | * @return array |
123 | 123 | */ |
124 | 124 | protected function _compactKeyValue($results) |
@@ -15,8 +15,6 @@ |
||
15 | 15 | use App\Lib\Model\Table\AppSettingTable; |
16 | 16 | use Cake\Cache\Cache; |
17 | 17 | use Cake\Core\Configure; |
18 | -use Cake\ORM\Query; |
|
19 | -use Saito\App\Registry; |
|
20 | 18 | use \Stopwatch\Lib\Stopwatch; |
21 | 19 | |
22 | 20 | class SettingsTable extends AppSettingTable |
@@ -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 |