Completed
Push — master ( 3c1969...5b5792 )
by Schlaefer
03:16 queued 10s
created
config/bootstrap.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,6 @@  discard block
 block discarded – undo
34 34
 use Cake\Core\App;
35 35
 use Cake\Core\Configure;
36 36
 use Cake\Core\Configure\Engine\PhpConfig;
37
-use Cake\Core\Plugin;
38 37
 use Cake\Database\Type;
39 38
 use Cake\Datasource\ConnectionManager;
40 39
 use Cake\Error\ErrorHandler;
@@ -42,7 +41,6 @@  discard block
 block discarded – undo
42 41
 use Cake\Log\Log;
43 42
 use Cake\Mailer\Email;
44 43
 use Cake\Mailer\TransportFactory;
45
-use Cake\Routing\DispatcherFactory;
46 44
 use Cake\Utility\Inflector;
47 45
 use Cake\Utility\Security;
48 46
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 /*
17 17
  * Configure paths required to find CakePHP + general filepath constants
18 18
  */
19
-require __DIR__ . '/paths.php';
19
+require __DIR__.'/paths.php';
20 20
 
21 21
 /*
22 22
  * Bootstrap CakePHP.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  * - Registering the CakePHP autoloader.
28 28
  * - Setting the default application paths.
29 29
  */
30
-require CORE_PATH . 'config' . DS . 'bootstrap.php';
30
+require CORE_PATH.'config'.DS.'bootstrap.php';
31 31
 
32 32
 use Cake\Cache\Cache;
33 33
 use Cake\Console\ConsoleErrorHandler;
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
  * You should copy `config/.env.default to `config/.env` and set/modify the
52 52
  * variables as required.
53 53
  */
54
-if (!env('APP_NAME') && file_exists(CONFIG . '.env')) {
55
-    $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG . '.env']);
54
+if (!env('APP_NAME') && file_exists(CONFIG.'.env')) {
55
+    $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG.'.env']);
56 56
     $dotenv->parse()
57 57
         ->putenv()
58 58
         ->toEnv()
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * Load additional config files
76 76
      */
77 77
     Configure::load('saito_config', 'default');
78
-    Configure::config('saitoCore', new PhpConfig(APP . '/Lib/'));
78
+    Configure::config('saitoCore', new PhpConfig(APP.'/Lib/'));
79 79
     Configure::load('version', 'saitoCore');
80 80
 
81 81
     Configure::write(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
     Configure::load('email', 'default');
87 87
 } catch (\Exception $e) {
88
-    exit($e->getMessage() . "\n");
88
+    exit($e->getMessage()."\n");
89 89
 }
90 90
 
91 91
 /*
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  * Include the CLI bootstrap overrides.
138 138
  */
139 139
 if ($isCli) {
140
-    require __DIR__ . '/bootstrap_cli.php';
140
+    require __DIR__.'/bootstrap_cli.php';
141 141
 }
142 142
 
143 143
 /*
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
     $httpHost = env('HTTP_HOST');
156 156
     if (isset($httpHost)) {
157
-        Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
157
+        Configure::write('App.fullBaseUrl', 'http'.$s.'://'.$httpHost);
158 158
     }
159 159
     unset($httpHost, $s);
160 160
 }
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 /*
177 177
  * Setup detectors for mobile and tablet.
178 178
  */
179
-ServerRequest::addDetector('mobile', function ($request) {
179
+ServerRequest::addDetector('mobile', function($request) {
180 180
     $detector = new \Detection\MobileDetect();
181 181
 
182 182
     return $detector->isMobile();
183 183
 });
184
-ServerRequest::addDetector('tablet', function ($request) {
184
+ServerRequest::addDetector('tablet', function($request) {
185 185
     $detector = new \Detection\MobileDetect();
186 186
 
187 187
     return $detector->isTablet();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 Inflector::rules('plural', ['/^(smil)ey$/i' => '\1ies']);
221 221
 Inflector::rules('singular', ['/^(smil)ies$/i' => '\1ey']);
222 222
 
223
-include Cake\Core\App::path('Lib')[0] . 'BaseFunctions.php';
223
+include Cake\Core\App::path('Lib')[0].'BaseFunctions.php';
224 224
 
225 225
 \Cake\Event\EventManager::instance()->on(\Saito\Event\SaitoEventManager::getInstance());
226 226
 
Please login to merge, or discard this patch.
src/Lib/Saito/Test/TestCaseTrait.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,10 +5,8 @@
 block discarded – undo
5 5
 use Cake\Core\Configure;
6 6
 use Cake\Event\EventManager;
7 7
 use Cake\Filesystem\File;
8
-use Cake\Mailer\Email;
9 8
 use Cake\Mailer\TransportFactory;
10 9
 use Cake\Utility\Inflector;
11
-use claviska\SimpleImage;
12 10
 use Cron\Lib\Cron;
13 11
 use Plugin\BbcodeParser\src\Lib\Markup;
14 12
 use Saito\App\Registry;
Please login to merge, or discard this patch.
plugins/ImageUploader/tests/TestCase/Controller/ThumbnailControllerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $Uploads = TableRegistry::get('ImageUploader.Uploads');
34 34
         $upload = $Uploads->get(1);
35 35
 
36
-        $file = new File(Configure::read('Saito.Settings.uploadDirectory') . $upload->get('name'));
36
+        $file = new File(Configure::read('Saito.Settings.uploadDirectory').$upload->get('name'));
37 37
         $raw = (new SimpleImage())
38 38
             ->fromNew(500, 500, 'blue')
39 39
             ->toString($upload->get('type'));
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         Plugin::configureCache(); // cache isn't bootstraped through request yet
45 45
         $this->assertFalse(Cache::read($upload->get('id'), Plugin::CACHE_KEY));
46 46
 
47
-        $this->get('/api/v2/uploads/thumb/1?h=' . $upload->get('hash'));
47
+        $this->get('/api/v2/uploads/thumb/1?h='.$upload->get('hash'));
48 48
 
49 49
         $cache = Cache::read($upload->get('id'), Plugin::CACHE_KEY);
50 50
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $this->assertSame(300, imagesx($image));
53 53
         $this->assertSame(300, imagesy($image));
54 54
         $this->assertSame($upload->get('type'), $cache['type']);
55
-        $this->assertResponseEquals($cache['raw'], (string)$this->_response->getBody());
55
+        $this->assertResponseEquals($cache['raw'], (string) $this->_response->getBody());
56 56
         $this->assertHeader('content-type', 'image/png');
57 57
 
58 58
         //// cleanup
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $Uploads = TableRegistry::get('ImageUploader.Uploads');
72 72
         $upload = $Uploads->get(1);
73 73
 
74
-        $file = new File(Configure::read('Saito.Settings.uploadDirectory') . $upload->get('name'));
74
+        $file = new File(Configure::read('Saito.Settings.uploadDirectory').$upload->get('name'));
75 75
         $raw = (new SimpleImage())
76 76
             ->fromNew(100, 100, 'blue')
77 77
             ->toString($upload->get('type'));
Please login to merge, or discard this patch.
plugins/ImageUploader/src/Controller/ThumbnailController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function thumb(): Response
37 37
     {
38
-        $id = (int)$this->request->getParam('id');
39
-        ['hash' => $fingerprint, 'type' => $type, 'raw' => $raw] = Cache::remember((string)$id, function () use ($id) {
38
+        $id = (int) $this->request->getParam('id');
39
+        ['hash' => $fingerprint, 'type' => $type, 'raw' => $raw] = Cache::remember((string) $id, function() use ($id) {
40 40
             $Uploads = $this->loadModel('ImageUploader.Uploads');
41 41
             $document = $Uploads->get($id);
42 42
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             return compact('hash', 'raw', 'type');
56 56
         }, Plugin::CACHE_KEY);
57 57
 
58
-        $hash = (string)$this->request->getQuery('h');
58
+        $hash = (string) $this->request->getQuery('h');
59 59
         if ($hash !== $fingerprint) {
60 60
             throw new SaitoForbiddenException(
61 61
                 "Attempt to access image-thumbnail $id."
Please login to merge, or discard this patch.
src/View/Helper/PostingHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
         if ($lastAction !== 'add') {
56 56
             $session = $this->getView()->getRequest()->getSession();
57 57
             if ($session->read('paginator.lastPage')) {
58
-                $params[] = 'page=' . $session->read('paginator.lastPage');
58
+                $params[] = 'page='.$session->read('paginator.lastPage');
59 59
             }
60 60
         }
61
-        $params[] = 'jump=' . $tid;
61
+        $params[] = 'jump='.$tid;
62 62
 
63
-        return '/?' . implode('&', $params);
63
+        return '/?'.implode('&', $params);
64 64
     }
65 65
 
66 66
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $id = $posting->get('id');
77 77
         $webroot = $this->getView()->getRequest()->getAttribute('webroot');
78 78
         $url = "{$webroot}entries/view/{$id}";
79
-        $link = "<a href=\"{$url}\" class=\"{$options['class']}\">" . $this->getSubject($posting) . '</a>';
79
+        $link = "<a href=\"{$url}\" class=\"{$options['class']}\">".$this->getSubject($posting).'</a>';
80 80
 
81 81
         return $link;
82 82
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function views(BasicPostingInterface $posting)
133 133
     {
134
-        return __('views_headline') . ': ' . $posting->get('views');
134
+        return __('views_headline').': '.$posting->get('views');
135 135
     }
136 136
 
137 137
     /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $options += [
149 149
             'lineCache' => $this->_View->get('LineCache'),
150
-            'maxThreadDepthIndent' => (int)Configure::read(
150
+            'maxThreadDepthIndent' => (int) Configure::read(
151 151
                 'Saito.Settings.thread_depth_indent'
152 152
             ),
153 153
             'renderer' => 'thread',
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $out = '';
192 192
         if ($entry->isPinned()) {
193
-            $out .= '<i class="fa fa-thumb-tack" title="' . __('fixed') . '"></i> ';
193
+            $out .= '<i class="fa fa-thumb-tack" title="'.__('fixed').'"></i> ';
194 194
         }
195 195
         // anchor for inserting solve-icon via FE-JS
196
-        $out .= '<span class="solves ' . $entry->get('id') . '">';
196
+        $out .= '<span class="solves '.$entry->get('id').'">';
197 197
         if ($entry->get('solves')) {
198 198
             $out .= $this->solvedBadge();
199 199
         }
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function solvedBadge()
219 219
     {
220
-        return '<i class="fa fa-badge-solves solves-isSolved" title="' .
221
-        __('Helpful entry') . '"></i>';
220
+        return '<i class="fa fa-badge-solves solves-isSolved" title="'.
221
+        __('Helpful entry').'"></i>';
222 222
     }
223 223
 
224 224
     /**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     public function getSubject(BasicPostingInterface $posting)
232 232
     {
233
-        return \h($posting->get('subject')) . ($posting->isNt() ? ' n/t' : '');
233
+        return \h($posting->get('subject')).($posting->isNt() ? ' n/t' : '');
234 234
     }
235 235
 
236 236
     /**
Please login to merge, or discard this patch.
src/View/Helper/JsDataHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 'version' => Configure::read('Saito.v'),
64 64
                 'settings' => [
65 65
                     'autoPageReload' => (isset($View->viewVars['autoPageReload']) ? $View->viewVars['autoPageReload'] : 0),
66
-                    'editPeriod' => (int)Configure::read(
66
+                    'editPeriod' => (int) Configure::read(
67 67
                         'Saito.Settings.edit_period'
68 68
                     ),
69 69
                     'language' => Configure::read('Saito.language'),
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
                     'quote_symbol' => $settings['quote_symbol'],
78 78
                     'subject_maxlength' => $settings['subject_maxlength'],
79 79
                     'upload_max_img_size' => $settings['upload_max_img_size'] * 1024,
80
-                    'upload_max_number_of_uploads' => (int)$settings['upload_max_number_of_uploads'],
80
+                    'upload_max_number_of_uploads' => (int) $settings['upload_max_number_of_uploads'],
81 81
                     'theme' => $View->getTheme(),
82
-                    'apiroot' => $request->getAttribute('webroot') . 'api/v2/',
82
+                    'apiroot' => $request->getAttribute('webroot').'api/v2/',
83 83
                     'webroot' => $request->getAttribute('webroot')
84 84
                 ]
85 85
             ],
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 'csrf' => $this->_getCsrf($View)
92 92
             ],
93 93
             'currentUser' => [
94
-                'id' => (int)$CurrentUser->get('id'),
94
+                'id' => (int) $CurrentUser->get('id'),
95 95
                 'username' => $CurrentUser->get('username'),
96 96
                 'user_show_inline' => $CurrentUser->get('inline_view_on_click') || false,
97 97
                 'user_show_thread_collapsed' => $CurrentUser->get('user_show_thread_collapsed') || false
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 'afterViewInit' => []
103 103
             ]
104 104
         ];
105
-        $out = 'var SaitoApp = ' . json_encode($js);
105
+        $out = 'var SaitoApp = '.json_encode($js);
106 106
         $out .= '; SaitoApp.timeAppStart = new Date().getTime();';
107 107
 
108 108
         return $out;
Please login to merge, or discard this patch.
plugins/Bookmarks/src/Controller/BookmarksController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,6 @@
 block discarded – undo
20 20
 use Cake\Http\Exception\MethodNotAllowedException;
21 21
 use Cake\Http\Exception\NotFoundException;
22 22
 use Cake\ORM\Entity;
23
-use Cake\ORM\Query;
24
-use Saito\App\Registry;
25 23
 use Saito\Exception\SaitoForbiddenException;
26 24
 
27 25
 /**
Please login to merge, or discard this patch.
src/Controller/Component/ParserComponent.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 use App\Controller\ErrorController;
16 16
 use Cake\Controller\Component;
17 17
 use Cake\Core\Configure;
18
-use Cake\ORM\TableRegistry;
19 18
 use Cake\Routing\Router;
20 19
 use Saito\App\Registry;
21 20
 use Saito\Smiley\SmileyLoader;
Please login to merge, or discard this patch.
src/Controller/EntriesController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@  discard block
 block discarded – undo
9 9
 
10 10
 namespace App\Controller;
11 11
 
12
-use App\Controller\Component\CurrentUserComponent;
13 12
 use App\Controller\Component\MarkAsReadComponent;
14 13
 use App\Controller\Component\ThreadsComponent;
15 14
 use App\Model\Entity\Entry;
@@ -21,9 +20,7 @@  discard block
 block discarded – undo
21 20
 use Cake\Http\Exception\ForbiddenException;
22 21
 use Cake\Http\Exception\MethodNotAllowedException;
23 22
 use Cake\Http\Exception\NotFoundException;
24
-use Cake\I18n\Time;
25 23
 use Cake\Routing\RequestActionTrait;
26
-use Saito\App\Registry;
27 24
 use Saito\Posting\Posting;
28 25
 use Saito\User\ForumsUserInterface;
29 26
 use Stopwatch\Lib\Stopwatch;
Please login to merge, or discard this patch.