Passed
Push — v3 ( 0d1d42...e1dcac )
by Andrew
32:56 queued 25:33
created
src/gql/resolvers/RetourResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,8 @@
 block discarded – undo
64 64
             if ($redirect === null && Craft::$app->getElements()->getElementByUri(trim($uri, '/'), $siteId) === null) {
65 65
                 // Set the `site` virtual field
66 66
                 $redirect['site'] = null;
67
-                if (isset($redirect['siteId']) && (int)$redirect['siteId'] !== 0) {
68
-                    $site = Craft::$app->getSites()->getSiteById((int)$redirect['siteId']);
67
+                if (isset($redirect['siteId']) && (int) $redirect['siteId'] !== 0) {
68
+                    $site = Craft::$app->getSites()->getSiteById((int) $redirect['siteId']);
69 69
                     if ($site !== null) {
70 70
                         $redirect['site'] = $site->handle;
71 71
                     }
Please login to merge, or discard this patch.
src/listeners/GetCraftQLSchema.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,36 +62,36 @@
 block discarded – undo
62 62
                 // Boolean field
63 63
                 $retourField
64 64
                     ->addBooleanField($field)
65
-                    ->resolve(function ($redirect) use ($field) {
65
+                    ->resolve(function($redirect) use ($field) {
66 66
                         $result = $redirect[$field] ?? null;
67
-                        return $result === null ? $result : (bool)$result;
67
+                        return $result === null ? $result : (bool) $result;
68 68
                     });
69 69
             } elseif (in_array($field, self::INT_FIELDS, true)) {
70 70
                 // Integer field
71 71
                 $retourField
72 72
                     ->addIntField($field)
73
-                    ->resolve(function ($redirect) use ($field) {
73
+                    ->resolve(function($redirect) use ($field) {
74 74
                         $result = $redirect[$field] ?? null;
75
-                        return $result === null ? $result : (int)$result;
75
+                        return $result === null ? $result : (int) $result;
76 76
                     });
77 77
             } else {
78 78
                 // String field
79 79
                 $retourField
80 80
                     ->addStringField($field)
81
-                    ->resolve(function ($redirect) use ($field) {
81
+                    ->resolve(function($redirect) use ($field) {
82 82
                         $result = $redirect[$field] ?? null;
83
-                        return $result === null ? $result : (string)$result;
83
+                        return $result === null ? $result : (string) $result;
84 84
                     });
85 85
             }
86 86
         }
87 87
         // Add the root
88 88
         $event->schema->addField('retour')
89
-            ->arguments(function (FieldBuilder $field) {
89
+            ->arguments(function(FieldBuilder $field) {
90 90
                 $field->addStringArgument('uri');
91 91
                 $field->addIntArgument('siteId');
92 92
             })
93 93
             ->type($retourField)
94
-            ->resolve(function ($root, $args, $context, $info) {
94
+            ->resolve(function($root, $args, $context, $info) {
95 95
                 // If our root is an Element, extract the URI and siteId from it
96 96
                 if ($root instanceof Element) {
97 97
                     /** Element $root */
Please login to merge, or discard this patch.
src/helpers/UrlHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         /** @noinspection CallableParameterUseCaseInTypeContextInspection */
62 62
         $url = preg_replace('/{.*}/', '', $url);
63 63
         // Remove any linebreaks that may be errantly in the URL
64
-        $url = (string)str_replace([
64
+        $url = (string) str_replace([
65 65
                 PHP_EOL,
66 66
                 "\r",
67 67
                 "\n",
Please login to merge, or discard this patch.
src/controllers/TablesController.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
         string $sort = 'hitCount|desc',
91 91
         int    $page = 1,
92 92
         int    $per_page = 20,
93
-               $filter = '',
94
-               $siteId = 0,
95
-               $handled = 'all'
93
+                $filter = '',
94
+                $siteId = 0,
95
+                $handled = 'all'
96 96
     ): Response
97 97
     {
98 98
         PermissionHelper::controllerPermissionCheck('retour:dashboard');
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
         string $sort = 'hitCount|desc',
187 187
         int    $page = 1,
188 188
         int    $per_page = 20,
189
-               $filter = '',
190
-               $siteId = 0,
191
-               $shortLinks = false
189
+                $filter = '',
190
+                $siteId = 0,
191
+                $shortLinks = false
192 192
     ): Response
193 193
     {
194 194
         PermissionHelper::controllerPermissionCheck('retour:redirects');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             ->orderBy([$sortField => $sortType])
123 123
             ->filterWhere(['like', 'redirectSrcUrl', $filter])
124 124
             ->orFilterWhere(['like', 'referrerUrl', $filter]);
125
-        if ((int)$siteId !== 0) {
125
+        if ((int) $siteId !== 0) {
126 126
             $query->andWhere(['siteId' => $siteId]);
127 127
         }
128 128
         if ($handled !== 'all') {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             foreach ($stats as &$stat) {
135 135
                 $stat['addLink'] = '';
136 136
                 if (!$stat['handledByRetour']) {
137
-                    $encodedUrl = urlencode('/' . ltrim($stat['redirectSrcUrl'], '/'));
137
+                    $encodedUrl = urlencode('/'.ltrim($stat['redirectSrcUrl'], '/'));
138 138
                     // Add the siteId to the URL, but keep the current behavior of passing in siteId=0 for "all"
139 139
                     $statSiteId = $stat['siteId'] ?? 0;
140 140
                     try {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     } catch (SiteNotFoundException $e) {
143 143
                         $primarySite = null;
144 144
                     }
145
-                    if ($primarySite !== null && $statSiteId == (int)$primarySite->id) {
145
+                    if ($primarySite !== null && $statSiteId == (int) $primarySite->id) {
146 146
                         $statSiteId = 0;
147 147
                     }
148 148
                     $stat['addLink'] = UrlHelper::cpUrl('retour/add-redirect', [
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             ->orderBy([$sortField => $sortType])
219 219
             ->filterWhere(['like', 'redirectSrcUrl', $filter])
220 220
             ->orFilterWhere(['like', 'redirectDestUrl', $filter]);
221
-        if ((int)$siteId !== 0) {
221
+        if ((int) $siteId !== 0) {
222 222
             $query->andWhere(['siteId' => $siteId]);
223 223
         }
224 224
         if ($shortLinks) {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                 }
246 246
             }
247 247
 
248
-            $redirect['editLink'] = UrlHelper::cpUrl('retour/edit-redirect/' . $redirect['id']);
248
+            $redirect['editLink'] = UrlHelper::cpUrl('retour/edit-redirect/'.$redirect['id']);
249 249
         }
250 250
         // Format the data for the API
251 251
         if ($redirects) {
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/controllers/FileController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $variables['docsUrl'] = self::DOCUMENTATION_URL;
194 194
         $variables['pluginName'] = $pluginName;
195 195
         $variables['title'] = $templateTitle;
196
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
196
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
197 197
         $variables['crumbs'] = [
198 198
             [
199 199
                 'label' => $pluginName,
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             ],
202 202
             [
203 203
                 'label' => 'Redirects',
204
-                'url' => UrlHelper::cpUrl('retour/redirects' . $siteHandleUri),
204
+                'url' => UrlHelper::cpUrl('retour/redirects'.$siteHandleUri),
205 205
             ],
206 206
         ];
207 207
         $variables['docTitle'] = "{$pluginName} - Redirects - {$templateTitle}";
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $file = UploadedFile::getInstanceByName('file');
212 212
         if ($file !== null) {
213 213
             $filename = uniqid($file->name, true);
214
-            $filePath = Craft::$app->getPath()->getTempPath() . DIRECTORY_SEPARATOR . $filename;
214
+            $filePath = Craft::$app->getPath()->getTempPath().DIRECTORY_SEPARATOR.$filename;
215 215
             $file->saveAs($filePath, false);
216 216
             // Also save the file to the cache as a backup way to access it
217 217
             $cache = Craft::$app->getCache();
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         }
340 340
         $csv->insertOne(array_values($columns));
341 341
         $csv->insertAll($data);
342
-        $csv->output($filename . '.csv');
342
+        $csv->output($filename.'.csv');
343 343
         exit(0);
344 344
     }
345 345
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         $csv->setOffset(1);
356 356
         $columns = ArrayHelper::filterEmptyStringsFromArray($columns);
357 357
         $rowIndex = 1;
358
-        $csv->each(function ($row) use ($headers, $columns, &$rowIndex, &$hasErrors) {
358
+        $csv->each(function($row) use ($headers, $columns, &$rowIndex, &$hasErrors) {
359 359
             $redirectConfig = [
360 360
                 'id' => 0,
361 361
             ];
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
                 $index++;
370 370
             }
371 371
             $redirectDump = print_r($redirectConfig, true);
372
-            Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__);
372
+            Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__);
373 373
             if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) {
374
-                Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__);
374
+                Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__);
375 375
                 $hasErrors = true;
376 376
             }
377 377
             $rowIndex++;
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
                 $index++;
412 412
             }
413 413
             $redirectDump = print_r($redirectConfig, true);
414
-            Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__);
414
+            Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__);
415 415
             if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) {
416
-                Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__);
416
+                Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__);
417 417
                 $hasErrors = true;
418 418
             }
419 419
             $rowIndex++;
Please login to merge, or discard this patch.
src/services/Redirects.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                 try {
257 257
                     $siteId = $redirect['siteId'] ?? null;
258 258
                     if ($siteId !== null) {
259
-                        $siteId = (int)$siteId;
259
+                        $siteId = (int) $siteId;
260 260
                     }
261 261
                     $dest = UrlHelper::siteUrl($dest, null, null, $siteId);
262 262
                 } catch (\yii\base\Exception $e) {
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                     // That's ok
272 272
                 }
273 273
                 if (!empty($queryString)) {
274
-                    $dest = strtok($dest, '?') . '?' . $queryString;
274
+                    $dest = strtok($dest, '?').'?'.$queryString;
275 275
                 }
276 276
             }
277 277
             $redirectMatchType = $redirect['redirectMatchType'] ?? 'notfound';
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     public function getRedirectFromCache($url, int $siteId = 0)
389 389
     {
390 390
         $cache = Craft::$app->getCache();
391
-        $cacheKey = $this::CACHE_KEY . md5($url) . $siteId;
391
+        $cacheKey = $this::CACHE_KEY.md5($url).$siteId;
392 392
         $redirect = $cache->get($cacheKey);
393 393
         Craft::info(
394 394
             Craft::t(
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
         } catch (SiteNotFoundException $e) {
417 417
             $siteId = 1;
418 418
         }
419
-        $cacheKey = $this::CACHE_KEY . md5($url) . $siteId;
419
+        $cacheKey = $this::CACHE_KEY.md5($url).$siteId;
420 420
         // Create the dependency tags
421 421
         $dependency = new TagDependency([
422 422
             'tags' => [
423 423
                 $this::GLOBAL_REDIRECTS_CACHE_TAG,
424
-                $this::GLOBAL_REDIRECTS_CACHE_TAG . $siteId,
424
+                $this::GLOBAL_REDIRECTS_CACHE_TAG.$siteId,
425 425
             ],
426 426
         ]);
427 427
         $cache->set($cacheKey, $redirect, Retour::$cacheDuration, $dependency);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         foreach ($redirects as $redirect) {
462 462
             // Figure out what type of source matching to do
463 463
             $redirectSrcMatch = $redirect['redirectSrcMatch'] ?? 'pathonly';
464
-            $redirectEnabled = (bool)$redirect['enabled'];
464
+            $redirectEnabled = (bool) $redirect['enabled'];
465 465
             if ($redirectEnabled === true) {
466 466
                 switch ($redirectSrcMatch) {
467 467
                     case 'pathonly':
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
 
503 503
                     // Do a regex match
504 504
                     case 'regexmatch':
505
-                        $matchRegEx = '`' . $redirect['redirectSrcUrlParsed'] . '`i';
505
+                        $matchRegEx = '`'.$redirect['redirectSrcUrlParsed'].'`i';
506 506
                         try {
507 507
                             if (preg_match($matchRegEx, $url) === 1) {
508 508
                                 $this->incrementRedirectHitCount($redirect);
509 509
                                 // If we're not associated with an EntryID, handle capture group replacement
510
-                                if ((int)$redirect['associatedElementId'] === 0) {
510
+                                if ((int) $redirect['associatedElementId'] === 0) {
511 511
                                     $redirect['redirectDestUrl'] = preg_replace(
512 512
                                         $matchRegEx,
513 513
                                         $redirect['redirectDestUrl'],
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
                             }
536 536
                         } catch (\Exception $e) {
537 537
                             // That's fine
538
-                            Craft::error('Invalid Redirect Regex: ' . $matchRegEx, __METHOD__);
538
+                            Craft::error('Invalid Redirect Regex: '.$matchRegEx, __METHOD__);
539 539
                         }
540 540
 
541 541
                         break;
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
         foreach (Craft::$app->getPlugins()->getAllPlugins() as $plugin) {
644 644
             /** @var Plugin $plugin */
645 645
             if (method_exists($plugin, 'retourMatch')) {
646
-                $result[$plugin->getHandle()] = $plugin->name . Craft::t('retour', ' Match');
646
+                $result[$plugin->getHandle()] = $plugin->name.Craft::t('retour', ' Match');
647 647
             }
648 648
         }
649 649
 
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
                         'id' => $redirectConfig['id'],
913 913
                     ]
914 914
                 )->execute();
915
-                Craft::debug('Rows affected: ' . $rowsAffected, __METHOD__);
915
+                Craft::debug('Rows affected: '.$rowsAffected, __METHOD__);
916 916
             } catch (\Exception $e) {
917 917
                 Craft::error($e->getMessage(), __METHOD__);
918 918
             }
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
         // Get the validated model attributes and save them to the db
1044 1044
         $redirectConfig = $redirect->getAttributes();
1045 1045
         // 0 for a siteId needs to be converted to null
1046
-        if (empty($redirectConfig['siteId']) || (int)$redirectConfig['siteId'] === 0) {
1046
+        if (empty($redirectConfig['siteId']) || (int) $redirectConfig['siteId'] === 0) {
1047 1047
             $redirectConfig['siteId'] = null;
1048 1048
         }
1049 1049
         // Throw an event to before saving the redirect
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
         }
1054 1054
 
1055 1055
         // See if a redirect exists with this source URL already
1056
-        if ((int)$redirectConfig['id'] === 0) {
1056
+        if ((int) $redirectConfig['id'] === 0) {
1057 1057
             // Query the db table
1058 1058
             $redirect = (new Query())
1059 1059
                 ->from(['{{%retour_static_redirects}}'])
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
             }
1067 1067
         }
1068 1068
         // Trigger a 'beforeSaveRedirect' event
1069
-        $isNew = (int)$redirectConfig['id'] === 0;
1069
+        $isNew = (int) $redirectConfig['id'] === 0;
1070 1070
         $event = new RedirectEvent([
1071 1071
             'isNew' => $isNew,
1072 1072
             'legacyUrl' => $redirectConfig['redirectSrcUrlParsed'],
@@ -1169,17 +1169,17 @@  discard block
 block discarded – undo
1169 1169
      */
1170 1170
     public function excludeUri($uri): bool
1171 1171
     {
1172
-        $uri = '/' . ltrim($uri, '/');
1172
+        $uri = '/'.ltrim($uri, '/');
1173 1173
         if (!empty(Retour::$settings->excludePatterns)) {
1174 1174
             foreach (Retour::$settings->excludePatterns as $excludePattern) {
1175
-                $pattern = '`' . $excludePattern['pattern'] . '`i';
1175
+                $pattern = '`'.$excludePattern['pattern'].'`i';
1176 1176
                 try {
1177 1177
                     if (preg_match($pattern, $uri) === 1) {
1178 1178
                         return true;
1179 1179
                     }
1180 1180
                 } catch (\Exception $e) {
1181 1181
                     // That's fine
1182
-                    Craft::error('Invalid exclude URI Regex: ' . $pattern, __METHOD__);
1182
+                    Craft::error('Invalid exclude URI Regex: '.$pattern, __METHOD__);
1183 1183
                 }
1184 1184
             }
1185 1185
         }
Please login to merge, or discard this patch.
src/Retour.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         Event::on(
317 317
             ClearCaches::class,
318 318
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
319
-            function (RegisterCacheOptionsEvent $event) {
319
+            function(RegisterCacheOptionsEvent $event) {
320 320
                 Craft::debug(
321 321
                     'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS',
322 322
                     __METHOD__
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         Event::on(
333 333
             Plugins::class,
334 334
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
335
-            function (PluginEvent $event) {
335
+            function(PluginEvent $event) {
336 336
                 if ($event->plugin === $this) {
337 337
                     // Invalidate our caches after we've been installed
338 338
                     $this->clearAllCaches();
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         Event::on(
360 360
             CraftVariable::class,
361 361
             CraftVariable::EVENT_INIT,
362
-            function (Event $event) {
362
+            function(Event $event) {
363 363
                 /** @var CraftVariable $variable */
364 364
                 $variable = $event->sender;
365 365
                 $variable->set('retour', [
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             }
370 370
         );
371 371
 
372
-        $prepareRedirectOnElementChange = function (ElementEvent $event) {
372
+        $prepareRedirectOnElementChange = function(ElementEvent $event) {
373 373
             /** @var Element $element */
374 374
             $element = $event->element;
375 375
             if ($element !== null && !$event->isNew && $element->getUrl() !== null && !$element->propagating) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             }
393 393
         };
394 394
 
395
-        $insertRedirectOnElementChange = function (ElementEvent $event) {
395
+        $insertRedirectOnElementChange = function(ElementEvent $event) {
396 396
             /** @var Element $element */
397 397
             $element = $event->element;
398 398
             if ($element !== null && !$event->isNew && $element->getUrl() !== null) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         Event::on(
411 411
             Elements::class,
412 412
             Elements::EVENT_BEFORE_SAVE_ELEMENT,
413
-            function (ElementEvent $event) use ($prepareRedirectOnElementChange){
413
+            function(ElementEvent $event) use ($prepareRedirectOnElementChange){
414 414
                 Craft::debug(
415 415
                     'Elements::EVENT_BEFORE_SAVE_ELEMENT',
416 416
                     __METHOD__
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         Event::on(
423 423
             Elements::class,
424 424
             Elements::EVENT_AFTER_SAVE_ELEMENT,
425
-            function (ElementEvent $event) use ($insertRedirectOnElementChange) {
425
+            function(ElementEvent $event) use ($insertRedirectOnElementChange) {
426 426
                 Craft::debug(
427 427
                     'Elements::EVENT_AFTER_SAVE_ELEMENT',
428 428
                     __METHOD__
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         Event::on(
435 435
             Elements::class,
436 436
             Elements::EVENT_BEFORE_UPDATE_SLUG_AND_URI,
437
-            function (ElementEvent $event) use ($prepareRedirectOnElementChange){
437
+            function(ElementEvent $event) use ($prepareRedirectOnElementChange){
438 438
                 Craft::debug(
439 439
                     'Elements::EVENT_BEFORE_UPDATE_SLUG_AND_URI',
440 440
                     __METHOD__
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
         Event::on(
447 447
             Elements::class,
448 448
             Elements::EVENT_AFTER_UPDATE_SLUG_AND_URI,
449
-            function (ElementEvent $event) use ($insertRedirectOnElementChange) {
449
+            function(ElementEvent $event) use ($insertRedirectOnElementChange) {
450 450
                 Craft::debug(
451 451
                     'Elements::EVENT_AFTER_UPDATE_SLUG_AND_URI',
452 452
                     __METHOD__
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         Event::on(
460 460
             Plugins::class,
461 461
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
462
-            function () {
462
+            function() {
463 463
                 // Install these only after all other plugins have loaded
464 464
                 $request = Craft::$app->getRequest();
465 465
                 // Only respond to non-console site requests
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         Event::on(
477 477
             Fields::class,
478 478
             Fields::EVENT_REGISTER_FIELD_TYPES,
479
-            function (RegisterComponentTypesEvent $event) {
479
+            function(RegisterComponentTypesEvent $event) {
480 480
                 $event->types[] = ShortLinkField::class;
481 481
             }
482 482
         );
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
             Event::on(
486 486
                 Gql::class,
487 487
                 Gql::EVENT_REGISTER_GQL_TYPES,
488
-                function (RegisterGqlTypesEvent $event) {
488
+                function(RegisterGqlTypesEvent $event) {
489 489
                     Craft::debug(
490 490
                         'Gql::EVENT_REGISTER_GQL_TYPES',
491 491
                         __METHOD__
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             Event::on(
498 498
                 Gql::class,
499 499
                 Gql::EVENT_REGISTER_GQL_QUERIES,
500
-                function (RegisterGqlQueriesEvent $event) {
500
+                function(RegisterGqlQueriesEvent $event) {
501 501
                     Craft::debug(
502 502
                         'Gql::EVENT_REGISTER_GQL_QUERIES',
503 503
                         __METHOD__
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                 Event::on(
514 514
                     Gql::class,
515 515
                     Gql::EVENT_REGISTER_GQL_SCHEMA_COMPONENTS,
516
-                    function (RegisterGqlSchemaComponentsEvent $event) {
516
+                    function(RegisterGqlSchemaComponentsEvent $event) {
517 517
                         Craft::debug(
518 518
                             'Gql::EVENT_REGISTER_GQL_SCHEMA_COMPONENTS',
519 519
                             __METHOD__
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
         Event::on(
544 544
             UrlManager::class,
545 545
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
546
-            function (RegisterUrlRulesEvent $event) {
546
+            function(RegisterUrlRulesEvent $event) {
547 547
                 Craft::debug(
548 548
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
549 549
                     __METHOD__
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
         Event::on(
567 567
             Dashboard::class,
568 568
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
569
-            function (RegisterComponentTypesEvent $event) {
569
+            function(RegisterComponentTypesEvent $event) {
570 570
                 $event->types[] = RetourWidget::class;
571 571
             }
572 572
         );
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         Event::on(
575 575
             UrlManager::class,
576 576
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
577
-            function (RegisterUrlRulesEvent $event) {
577
+            function(RegisterUrlRulesEvent $event) {
578 578
                 Craft::debug(
579 579
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
580 580
                     __METHOD__
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
         Event::on(
591 591
             UserPermissions::class,
592 592
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
593
-            function (RegisterUserPermissionsEvent $event) {
593
+            function(RegisterUserPermissionsEvent $event) {
594 594
                 Craft::debug(
595 595
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
596 596
                     __METHOD__
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         Event::on(
613 613
             ErrorHandler::class,
614 614
             ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION,
615
-            function (ExceptionEvent $event) {
615
+            function(ExceptionEvent $event) {
616 616
                 Craft::debug(
617 617
                     'ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION',
618 618
                     __METHOD__
Please login to merge, or discard this patch.