Passed
Push — v3 ( 4a04ce...9dbba2 )
by Andrew
15:26 queued 21s
created
src/helpers/Text.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         if (!empty($string)) {
45 45
             $string = strip_tags($string);
46
-            $result = (string)Stringy::create($string)->truncate($length, $substring);
46
+            $result = (string) Stringy::create($string)->truncate($length, $substring);
47 47
         }
48 48
 
49 49
         return $result;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         if (!empty($string)) {
69 69
             $string = strip_tags($string);
70
-            $result = (string)Stringy::create($string)->safeTruncate($length, $substring);
70
+            $result = (string) Stringy::create($string)->safeTruncate($length, $substring);
71 71
         }
72 72
 
73 73
         return $result;
Please login to merge, or discard this patch.
tests/_bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 ini_set('date.timezone', 'UTC');
6 6
 
7 7
 // Use the current installation of Craft
8
-define('CRAFT_STORAGE_PATH', __DIR__ . '/_craft/storage');
9
-define('CRAFT_TEMPLATES_PATH', __DIR__ . '/_craft/templates');
10
-define('CRAFT_CONFIG_PATH', __DIR__ . '/_craft/config');
11
-define('CRAFT_MIGRATIONS_PATH', __DIR__ . '/_craft/migrations');
12
-define('CRAFT_TRANSLATIONS_PATH', __DIR__ . '/_craft/translations');
13
-define('CRAFT_VENDOR_PATH', dirname(__DIR__) . '/vendor');
8
+define('CRAFT_STORAGE_PATH', __DIR__.'/_craft/storage');
9
+define('CRAFT_TEMPLATES_PATH', __DIR__.'/_craft/templates');
10
+define('CRAFT_CONFIG_PATH', __DIR__.'/_craft/config');
11
+define('CRAFT_MIGRATIONS_PATH', __DIR__.'/_craft/migrations');
12
+define('CRAFT_TRANSLATIONS_PATH', __DIR__.'/_craft/translations');
13
+define('CRAFT_VENDOR_PATH', dirname(__DIR__).'/vendor');
14 14
 define('CRAFT_TESTS_PATH', __DIR__);
15 15
 
16 16
 $devMode = true;
Please login to merge, or discard this patch.
src/services/Events.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
                     if (strcmp($oldUri, $newUri) !== 0) {
103 103
                         // Handle trailing slash config setting
104 104
                         if (Craft::$app->config->general->addTrailingSlashesToUrls) {
105
-                            $oldUri = rtrim($oldUri, '/') . '/';
106
-                            $newUri = rtrim($newUri, '/') . '/';
105
+                            $oldUri = rtrim($oldUri, '/').'/';
106
+                            $newUri = rtrim($newUri, '/').'/';
107 107
                         }
108 108
                         // Handle the URL match type
109 109
                         if (Retour::$settings->uriChangeRedirectSrcMatch === 'fullurl') {
110 110
                             try {
111 111
                                 if ($redirectSiteId !== null) {
112
-                                    $redirectSiteId = (int)$redirectSiteId;
112
+                                    $redirectSiteId = (int) $redirectSiteId;
113 113
                                 }
114 114
                                 $oldUri = \craft\helpers\UrlHelper::siteUrl($oldUri, null, null, $redirectSiteId);
115 115
                                 $newUri = UrlHelper::siteUrl($newUri, null, null, $redirectSiteId);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                             'siteId' => $redirectSiteId,
128 128
                         ];
129 129
                         // Trigger a 'beforeSaveEntryRedirect' event
130
-                        $isNew = (int)$redirectConfig['id'] === 0;
130
+                        $isNew = (int) $redirectConfig['id'] === 0;
131 131
                         $event = new RedirectEvent([
132 132
                             'isNew' => $isNew,
133 133
                             'legacyUrl' => $redirectConfig['redirectSrcUrl'],
Please login to merge, or discard this patch.
src/controllers/ChartsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                     'COUNT(handledByRetour = 1 or null) as handled_cnt',
82 82
                 ])
83 83
                 ->where("hitLastTime >= ( CURDATE() - INTERVAL '{$days}' DAY )");
84
-            if ((int)$siteId !== 0) {
84
+            if ((int) $siteId !== 0) {
85 85
                 $query->andWhere(['siteId' => $siteId]);
86 86
             }
87 87
             $query
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     "COUNT(CASE WHEN \"handledByRetour\" = true THEN 1 END) as handled_cnt",
100 100
                 ])
101 101
                 ->where("\"hitLastTime\" >= ( CURRENT_TIMESTAMP - INTERVAL '{$days} days' )");
102
-            if ((int)$siteId !== 0) {
102
+            if ((int) $siteId !== 0) {
103 103
                 $query->andWhere(['siteId' => $siteId]);
104 104
             }
105 105
             $query
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         }
164 164
         if ($stats) {
165 165
             $data = [
166
-                (int)$stats,
167
-                (int)$handledStats,
166
+                (int) $stats,
167
+                (int) $handledStats,
168 168
             ];
169 169
         }
170 170
 
Please login to merge, or discard this patch.
src/controllers/RedirectsController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $variables['docsUrl'] = self::DOCUMENTATION_URL;
82 82
         $variables['pluginName'] = $pluginName;
83 83
         $variables['title'] = $templateTitle;
84
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
84
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
85 85
         $variables['crumbs'] = [
86 86
             [
87 87
                 'label' => $pluginName,
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             ],
90 90
             [
91 91
                 'label' => $templateTitle,
92
-                'url' => UrlHelper::cpUrl('retour/redirects' . $siteHandleUri),
92
+                'url' => UrlHelper::cpUrl('retour/redirects'.$siteHandleUri),
93 93
             ],
94 94
         ];
95 95
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
         if ($redirect->siteId) {
151 151
             $site = $sites->getSiteById($redirect->siteId);
152 152
             if ($site) {
153
-                MultiSiteHelper::requirePermission('editSite:' . $site->uid);
153
+                MultiSiteHelper::requirePermission('editSite:'.$site->uid);
154 154
             }
155 155
         }
156 156
         if ($siteId) {
157 157
             $site = $sites->getSiteById($siteId);
158 158
             if ($site) {
159
-                MultiSiteHelper::requirePermission('editSite:' . $site->uid);
159
+                MultiSiteHelper::requirePermission('editSite:'.$site->uid);
160 160
             }
161 161
         }
162 162
         $pluginName = Retour::$settings->pluginName;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             ],
193 193
             [
194 194
                 'label' => $templateTitle,
195
-                'url' => UrlHelper::cpUrl('retour/edit-redirect/' . $redirectId),
195
+                'url' => UrlHelper::cpUrl('retour/edit-redirect/'.$redirectId),
196 196
             ],
197 197
         ];
198 198
         $variables['docTitle'] = "{$pluginName} - Redirects - {$templateTitle}";
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         if ($redirectConfig === null) {
251 251
             throw new NotFoundHttpException('Redirect not found');
252 252
         }
253
-        $redirectConfig['id'] = (int)$redirectConfig['id'];
253
+        $redirectConfig['id'] = (int) $redirectConfig['id'];
254 254
         // Handle enforcing trailing slashes
255 255
         $generalConfig = Craft::$app->getConfig()->getGeneral();
256 256
         if ($generalConfig->addTrailingSlashesToUrls && $redirectConfig['redirectMatchType'] === 'exactmatch') {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         $variables['docsUrl'] = self::DOCUMENTATION_URL;
335 335
         $variables['pluginName'] = $pluginName;
336 336
         $variables['title'] = $templateTitle;
337
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
337
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
338 338
         $variables['crumbs'] = [
339 339
             [
340 340
                 'label' => $pluginName,
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             ],
343 343
             [
344 344
                 'label' => $templateTitle,
345
-                'url' => UrlHelper::cpUrl('retour/shortlinks' . $siteHandleUri),
345
+                'url' => UrlHelper::cpUrl('retour/shortlinks'.$siteHandleUri),
346 346
             ],
347 347
         ];
348 348
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
         if (!preg_match('/\.[^\/]+$/', $url) && strpos($url, '?') === false) {
398 398
             // If it's a root relative URL, assume it's a site URL
399 399
             if (UrlHelper::isRootRelativeUrl($url)) {
400
-                return rtrim($url, '/') . '/';
400
+                return rtrim($url, '/').'/';
401 401
             }
402 402
             // If the URL matches any of the site's base URLs, assume it's a site URL
403 403
             $sites = Craft::$app->getSites()->getAllSites();
404 404
             foreach ($sites as $site) {
405 405
                 if (strpos($url, $site->getBaseUrl()) === 0) {
406
-                    return rtrim($url, '/') . '/';
406
+                    return rtrim($url, '/').'/';
407 407
                 }
408 408
             }
409 409
         }
Please login to merge, or discard this patch.
src/validators/UriValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
             return;
61 61
         }
62 62
         // Make sure there is a leading /
63
-        $value = '/' . ltrim($value, '/');
63
+        $value = '/'.ltrim($value, '/');
64 64
         $model->$attribute = $value;
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
src/controllers/StatisticsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $variables['docsUrl'] = self::DOCUMENTATION_URL;
85 85
         $variables['pluginName'] = $pluginName;
86 86
         $variables['title'] = $templateTitle;
87
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
87
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
88 88
         $variables['crumbs'] = [
89 89
             [
90 90
                 'label' => $pluginName,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             ],
93 93
             [
94 94
                 'label' => $templateTitle,
95
-                'url' => UrlHelper::cpUrl('retour/dashboard' . $siteHandleUri),
95
+                'url' => UrlHelper::cpUrl('retour/dashboard'.$siteHandleUri),
96 96
             ],
97 97
         ];
98 98
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
Please login to merge, or discard this patch.
src/console/controllers/StatsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@
 block discarded – undo
66 66
      */
67 67
     public function actionTrim(): int
68 68
     {
69
-        echo Craft::t('retour', 'Trimming statistics') . PHP_EOL;
69
+        echo Craft::t('retour', 'Trimming statistics').PHP_EOL;
70 70
         $affectedRows = Retour::$plugin->statistics->trimStatistics($this->limit);
71 71
         echo Craft::t(
72 72
                 'retour',
73 73
                 'Trimmed {rows} from retour_stats table',
74 74
                 ['rows' => $affectedRows]
75
-            ) . PHP_EOL;
75
+            ).PHP_EOL;
76 76
 
77 77
         return 0;
78 78
     }
Please login to merge, or discard this patch.
src/services/ServicesTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         // Constants aren't allowed in traits until PHP >= 8.2
40 40
         $majorVersion = '3';
41 41
         // Dev server container name & port are based on the major version of this plugin
42
-        $devPort = 3000 + (int)$majorVersion;
43
-        $versionName = 'v' . $majorVersion;
42
+        $devPort = 3000 + (int) $majorVersion;
43
+        $versionName = 'v'.$majorVersion;
44 44
         // Merge in the passed config, so it our config can be overridden by Plugins::pluginConfigs['retour']
45 45
         // ref: https://github.com/craftcms/cms/issues/1989
46 46
         $config = ArrayHelper::merge([
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
                     'assetClass' => RetourAsset::class,
54 54
                     'checkDevServer' => true,
55 55
                     'class' => VitePluginService::class,
56
-                    'devServerInternal' => 'http://craft-retour-' . $versionName . '-buildchain-dev:' . $devPort,
57
-                    'devServerPublic' => 'http://localhost:' . $devPort,
56
+                    'devServerInternal' => 'http://craft-retour-'.$versionName.'-buildchain-dev:'.$devPort,
57
+                    'devServerPublic' => 'http://localhost:'.$devPort,
58 58
                     'errorEntry' => 'src/js/Retour.js',
59 59
                     'useDevServer' => true,
60 60
                 ],
Please login to merge, or discard this patch.