@@ -368,7 +368,7 @@ |
||
368 | 368 | * set last refresh |
369 | 369 | * |
370 | 370 | * @param int $userId user-ID |
371 | - * @param null $lastRefresh last refresh |
|
371 | + * @param integer $lastRefresh last refresh |
|
372 | 372 | * @return void |
373 | 373 | */ |
374 | 374 | public function setLastRefresh($userId, $lastRefresh = null) |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->addBehavior( |
78 | 78 | 'Proffer.Proffer', |
79 | 79 | [ |
80 | - 'avatar' => [ // The name of your upload field (filename) |
|
80 | + 'avatar' => [// The name of your upload field (filename) |
|
81 | 81 | 'root' => $avatarRootDir, |
82 | 82 | 'dir' => 'avatar_dir', // field for upload directory |
83 | 83 | 'thumbnailSizes' => [ |
@@ -787,8 +787,8 @@ discard block |
||
787 | 787 | $User->set('user_category_custom', $newCats); |
788 | 788 | } else { |
789 | 789 | //=if set a single category |
790 | - $category = (int)$category; |
|
791 | - if ($category > 0 && $this->Entries->Categories->exists((int)$category) |
|
790 | + $category = (int) $category; |
|
791 | + if ($category > 0 && $this->Entries->Categories->exists((int) $category) |
|
792 | 792 | ) { |
793 | 793 | $active = $category; |
794 | 794 | } else { |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | // ->enableHydration(false) |
846 | 846 | ->contain( |
847 | 847 | [ |
848 | - 'UserIgnores' => function ($query) { |
|
848 | + 'UserIgnores' => function($query) { |
|
849 | 849 | return $query->enableHydration(false)->select( |
850 | 850 | ['blocked_user_id', 'user_id'] |
851 | 851 | ); |
@@ -9,7 +9,6 @@ |
||
9 | 9 | |
10 | 10 | namespace App\View\Helper; |
11 | 11 | |
12 | -use App\Controller\Component\CurrentUserComponent; |
|
13 | 12 | use Cake\Core\Configure; |
14 | 13 | use Cake\Event\Event; |
15 | 14 | use Cake\View\Helper; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'version' => Configure::read('Saito.v'), |
62 | 62 | 'settings' => [ |
63 | 63 | 'autoPageReload' => (isset($View->viewVars['autoPageReload']) ? $View->viewVars['autoPageReload'] : 0), |
64 | - 'editPeriod' => (int)Configure::read( |
|
64 | + 'editPeriod' => (int) Configure::read( |
|
65 | 65 | 'Saito.Settings.edit_period' |
66 | 66 | ), |
67 | 67 | 'language' => Configure::read('Saito.language'), |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | 'quote_symbol' => $settings['quote_symbol'], |
76 | 76 | 'subject_maxlength' => $settings['subject_maxlength'], |
77 | 77 | 'upload_max_img_size' => $settings['upload_max_img_size'] * 1024, |
78 | - 'upload_max_number_of_uploads' => (int)$settings['upload_max_number_of_uploads'], |
|
78 | + 'upload_max_number_of_uploads' => (int) $settings['upload_max_number_of_uploads'], |
|
79 | 79 | 'theme' => $View->getTheme(), |
80 | - 'apiroot' => $View->request->getAttribute('webroot') . 'api/v2/', |
|
80 | + 'apiroot' => $View->request->getAttribute('webroot').'api/v2/', |
|
81 | 81 | 'webroot' => $View->request->getAttribute('webroot') |
82 | 82 | ] |
83 | 83 | ], |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'csrf' => $this->_getCsrf($View) |
90 | 90 | ], |
91 | 91 | 'currentUser' => [ |
92 | - 'id' => (int)$CurrentUser->get('id'), |
|
92 | + 'id' => (int) $CurrentUser->get('id'), |
|
93 | 93 | 'username' => $CurrentUser->get('username'), |
94 | 94 | 'user_show_inline' => $CurrentUser->get('inline_view_on_click') || false, |
95 | 95 | 'user_show_thread_collapsed' => $CurrentUser->get('user_show_thread_collapsed') || false |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'afterViewInit' => [] |
101 | 101 | ] |
102 | 102 | ]; |
103 | - $out = 'var SaitoApp = ' . json_encode($js); |
|
103 | + $out = 'var SaitoApp = '.json_encode($js); |
|
104 | 104 | $out .= '; SaitoApp.timeAppStart = new Date().getTime();'; |
105 | 105 | |
106 | 106 | return $out; |
@@ -12,12 +12,10 @@ |
||
12 | 12 | |
13 | 13 | namespace App\View\Helper; |
14 | 14 | |
15 | -use Cake\Core\Configure; |
|
16 | 15 | use Geshi\View\Helper\GeshiHelper; |
17 | 16 | use Saito\App\Registry; |
18 | 17 | use Saito\Markup\Markup; |
19 | 18 | use Saito\Markup\MarkupInterface; |
20 | -use Saito\Smiley\SmileyRenderer; |
|
21 | 19 | use Stopwatch\Lib\Stopwatch; |
22 | 20 | |
23 | 21 | /** |
@@ -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 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $defaults = ['return' => 'html', 'embed' => true, 'multimedia' => true, 'wrap' => true]; |
163 | 163 | $options += $defaults; |
164 | 164 | |
165 | - $cacheId = md5(serialize($options) . $string); |
|
165 | + $cacheId = md5(serialize($options).$string); |
|
166 | 166 | if (isset($this->_parserCache[$cacheId])) { |
167 | 167 | $html = $this->_parserCache[$cacheId]; |
168 | 168 | } else { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $this->_parserCache[$cacheId] = $html; |
171 | 171 | } |
172 | 172 | if ($options['return'] === 'html' && $options['wrap']) { |
173 | - $html = '<div class="richtext">' . $html . '</div>'; |
|
173 | + $html = '<div class="richtext">'.$html.'</div>'; |
|
174 | 174 | } |
175 | 175 | Stopwatch::stop('ParseHelper::parse()'); |
176 | 176 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | /** |
87 | 87 | * get editor help |
88 | 88 | * |
89 | - * @return mixed |
|
89 | + * @return string |
|
90 | 90 | */ |
91 | 91 | public function editorHelp() |
92 | 92 | { |
@@ -79,7 +79,7 @@ |
||
79 | 79 | * Translates user types |
80 | 80 | * |
81 | 81 | * @param string $type type |
82 | - * @return mixed |
|
82 | + * @return string|null |
|
83 | 83 | */ |
84 | 84 | public function type($type) |
85 | 85 | { |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Identicon\Identicon; |
15 | 15 | use Saito\RememberTrait; |
16 | 16 | use Saito\User\ForumsUserInterface; |
17 | -use Saito\User\SaitoUser; |
|
18 | 17 | use Stopwatch\Lib\Stopwatch; |
19 | 18 | |
20 | 19 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - return '<style type="text/css">' . implode(" ", $styles) . '</style>'; |
|
75 | + return '<style type="text/css">'.implode(" ", $styles).'</style>'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $link = $url; |
126 | 126 | |
127 | 127 | if (substr($link, 0, 4) == 'www.') { |
128 | - $link = 'http://' . $link; |
|
128 | + $link = 'http://'.$link; |
|
129 | 129 | } |
130 | 130 | if (substr($link, 0, 4) == 'http') { |
131 | 131 | $text = '<i class="fa fa-home fa-lg"></i>'; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $html = $name; |
161 | 161 | } elseif ($link || ($link instanceof ForumsUserInterface && $link->isLoggedIn()) |
162 | 162 | ) { |
163 | - return $this->Html->link($name, '/users/view/' . $id, $options); |
|
163 | + return $this->Html->link($name, '/users/view/'.$id, $options); |
|
164 | 164 | } else { |
165 | 165 | $html = $name; |
166 | 166 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function getAvatar($user, array $options = []) |
182 | 182 | { |
183 | - $getAvatar = function () use ($user, $options) { |
|
183 | + $getAvatar = function() use ($user, $options) { |
|
184 | 184 | Stopwatch::start('UserHelper::getAvatar()'); |
185 | 185 | $defaults = [ |
186 | 186 | 'class' => 'avatar-image', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $imgUri = (new Identicon)->getImageDataUri($name, $hdpi); |
207 | 207 | } |
208 | 208 | |
209 | - $style = "background-image: url({$imgUri});" . $options['style']; |
|
209 | + $style = "background-image: url({$imgUri});".$options['style']; |
|
210 | 210 | |
211 | 211 | $html = $this->Html->tag( |
212 | 212 | $options['tag'], |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | }; |
228 | 228 | |
229 | 229 | $name = $user->get('username'); |
230 | - $hash = 'avatar.' . md5($name . serialize($options)); |
|
230 | + $hash = 'avatar.'.md5($name.serialize($options)); |
|
231 | 231 | |
232 | 232 | return $this->remember($hash, $getAvatar); |
233 | 233 | } |
@@ -13,4 +13,4 @@ |
||
13 | 13 | * @license https://opensource.org/licenses/mit-license.php MIT License |
14 | 14 | */ |
15 | 15 | |
16 | -require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; |
|
16 | +require 'webroot'.DIRECTORY_SEPARATOR.'index.php'; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public function run() |
20 | 20 | { |
21 | 21 | $data = |
22 | - [ |
|
22 | + [ |
|
23 | 23 | [ |
24 | 24 | 'id' => 1, |
25 | 25 | 'sort' => 1, |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'sort' => 17, |
106 | 106 | 'icon' => 'angry', |
107 | 107 | ] |
108 | - ]; |
|
108 | + ]; |
|
109 | 109 | |
110 | 110 | $table = $this->table('smilies'); |
111 | 111 | $table->insert($data)->save(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Is the forum installed? Runs installer if not. Default: run installer. |
10 | 10 | */ |
11 | 11 | 'installed' => filter_var( |
12 | - env('INSTALLED', !file_exists(CONFIG . '/installer')), |
|
12 | + env('INSTALLED', !file_exists(CONFIG.'/installer')), |
|
13 | 13 | FILTER_VALIDATE_BOOLEAN |
14 | 14 | ), |
15 | 15 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Upload directory root with trailing slash |
41 | 41 | */ |
42 | - 'uploadDirectory' => WWW_ROOT . 'useruploads' . DIRECTORY_SEPARATOR |
|
42 | + 'uploadDirectory' => WWW_ROOT.'useruploads'.DIRECTORY_SEPARATOR |
|
43 | 43 | ], |
44 | 44 | |
45 | 45 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | Router::defaultRouteClass(DashedRoute::class); |
48 | 48 | |
49 | -Router::scope('/', function (RouteBuilder $routes) { |
|
49 | +Router::scope('/', function(RouteBuilder $routes) { |
|
50 | 50 | /** |
51 | 51 | * Here, we are connecting '/' (base path) to a controller called 'Pages', |
52 | 52 | * its action called 'display', and we pass a param to select the view file |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $routes->fallbacks(DashedRoute::class); |
97 | 97 | }); |
98 | 98 | |
99 | -Router::scope('/entries', function ($routes) { |
|
99 | +Router::scope('/entries', function($routes) { |
|
100 | 100 | $routes->setExtensions(['json']); |
101 | 101 | $routes->connect( |
102 | 102 | '/threadLine/*', |
@@ -21,19 +21,19 @@ |
||
21 | 21 | * You can remove this if you are confident that your PHP version is sufficient. |
22 | 22 | */ |
23 | 23 | if (version_compare(PHP_VERSION, '5.6.0') < 0) { |
24 | - trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR); |
|
24 | + trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.'.PHP_EOL, E_USER_ERROR); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /* |
28 | 28 | * You can remove this if you are confident you have intl installed. |
29 | 29 | */ |
30 | 30 | if (!extension_loaded('intl')) { |
31 | - trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR); |
|
31 | + trigger_error('You must enable the intl extension to use CakePHP.'.PHP_EOL, E_USER_ERROR); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /* |
35 | 35 | * You can remove this if you are confident you have mbstring installed. |
36 | 36 | */ |
37 | 37 | if (!extension_loaded('mbstring')) { |
38 | - trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR); |
|
38 | + trigger_error('You must enable the mbstring extension to use CakePHP.'.PHP_EOL, E_USER_ERROR); |
|
39 | 39 | } |