@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $siteId = reset($variables['enabledSiteIds']); |
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | - self::requirePermission('editSite:' . $siteId); |
|
| 92 | + self::requirePermission('editSite:'.$siteId); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } else { |
| 115 | 115 | $variables['sitesMenuLabel'] = Craft::t( |
| 116 | 116 | 'site', |
| 117 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
| 117 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | } else { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if ($siteHandle !== null) { |
| 138 | 138 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
| 139 | 139 | if (!$site) { |
| 140 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
| 140 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
| 141 | 141 | } |
| 142 | 142 | $siteId = $site->id; |
| 143 | 143 | } else { |
@@ -60,7 +60,7 @@ |
||
| 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 | } |
@@ -48,9 +48,9 @@ |
||
| 48 | 48 | |
| 49 | 49 | $type = GqlEntityRegistry::createEntity(self::class, new InterfaceType([ |
| 50 | 50 | 'name' => static::getName(), |
| 51 | - 'fields' => self::class . '::getFieldDefinitions', |
|
| 51 | + 'fields' => self::class.'::getFieldDefinitions', |
|
| 52 | 52 | 'description' => 'This is the interface implemented by Retour.', |
| 53 | - 'resolveType' => function (array $value) { |
|
| 53 | + 'resolveType' => function(array $value) { |
|
| 54 | 54 | return GqlEntityRegistry::getEntity(RetourGenerator::getName()); |
| 55 | 55 | }, |
| 56 | 56 | ])); |
@@ -84,7 +84,7 @@ discard block |
||
| 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 |
||
| 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}"; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | Event::on( |
| 280 | 280 | ClearCaches::class, |
| 281 | 281 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
| 282 | - function (RegisterCacheOptionsEvent $event) { |
|
| 282 | + function(RegisterCacheOptionsEvent $event) { |
|
| 283 | 283 | Craft::debug( |
| 284 | 284 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
| 285 | 285 | __METHOD__ |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | Event::on( |
| 296 | 296 | Plugins::class, |
| 297 | 297 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 298 | - function (PluginEvent $event) { |
|
| 298 | + function(PluginEvent $event) { |
|
| 299 | 299 | if ($event->plugin === $this) { |
| 300 | 300 | // Invalidate our caches after we've been installed |
| 301 | 301 | $this->clearAllCaches(); |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | Event::on( |
| 323 | 323 | CraftVariable::class, |
| 324 | 324 | CraftVariable::EVENT_INIT, |
| 325 | - function (Event $event) { |
|
| 325 | + function(Event $event) { |
|
| 326 | 326 | /** @var CraftVariable $variable */ |
| 327 | 327 | $variable = $event->sender; |
| 328 | 328 | $variable->set('retour', [ |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | ); |
| 334 | 334 | |
| 335 | - $prepareRedirectOnElementChange = function (ElementEvent $event) { |
|
| 335 | + $prepareRedirectOnElementChange = function(ElementEvent $event) { |
|
| 336 | 336 | /** @var Element $element */ |
| 337 | 337 | $element = $event->element; |
| 338 | 338 | if ($element !== null && !$event->isNew && $element->getUrl() !== null && !$element->propagating) { |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | }; |
| 357 | 357 | |
| 358 | - $insertRedirectOnElementChange = function (ElementEvent $event) { |
|
| 358 | + $insertRedirectOnElementChange = function(ElementEvent $event) { |
|
| 359 | 359 | /** @var Element $element */ |
| 360 | 360 | $element = $event->element; |
| 361 | 361 | if ($element !== null && !$event->isNew && $element->getUrl() !== null) { |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | Event::on( |
| 374 | 374 | Elements::class, |
| 375 | 375 | Elements::EVENT_BEFORE_SAVE_ELEMENT, |
| 376 | - function (ElementEvent $event) use ($prepareRedirectOnElementChange) { |
|
| 376 | + function(ElementEvent $event) use ($prepareRedirectOnElementChange) { |
|
| 377 | 377 | Craft::debug( |
| 378 | 378 | 'Elements::EVENT_BEFORE_SAVE_ELEMENT', |
| 379 | 379 | __METHOD__ |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | Event::on( |
| 386 | 386 | Elements::class, |
| 387 | 387 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
| 388 | - function (ElementEvent $event) use ($insertRedirectOnElementChange) { |
|
| 388 | + function(ElementEvent $event) use ($insertRedirectOnElementChange) { |
|
| 389 | 389 | Craft::debug( |
| 390 | 390 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
| 391 | 391 | __METHOD__ |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | Event::on( |
| 398 | 398 | Elements::class, |
| 399 | 399 | Elements::EVENT_BEFORE_UPDATE_SLUG_AND_URI, |
| 400 | - function (ElementEvent $event) use ($prepareRedirectOnElementChange) { |
|
| 400 | + function(ElementEvent $event) use ($prepareRedirectOnElementChange) { |
|
| 401 | 401 | Craft::debug( |
| 402 | 402 | 'Elements::EVENT_BEFORE_UPDATE_SLUG_AND_URI', |
| 403 | 403 | __METHOD__ |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | Event::on( |
| 410 | 410 | Elements::class, |
| 411 | 411 | Elements::EVENT_AFTER_UPDATE_SLUG_AND_URI, |
| 412 | - function (ElementEvent $event) use ($insertRedirectOnElementChange) { |
|
| 412 | + function(ElementEvent $event) use ($insertRedirectOnElementChange) { |
|
| 413 | 413 | Craft::debug( |
| 414 | 414 | 'Elements::EVENT_AFTER_UPDATE_SLUG_AND_URI', |
| 415 | 415 | __METHOD__ |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | Event::on( |
| 423 | 423 | Plugins::class, |
| 424 | 424 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
| 425 | - function () { |
|
| 425 | + function() { |
|
| 426 | 426 | // Install these only after all other plugins have loaded |
| 427 | 427 | $request = Craft::$app->getRequest(); |
| 428 | 428 | // Only respond to non-console site requests |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | Event::on( |
| 440 | 440 | Fields::class, |
| 441 | 441 | Fields::EVENT_REGISTER_FIELD_TYPES, |
| 442 | - function (RegisterComponentTypesEvent $event) { |
|
| 442 | + function(RegisterComponentTypesEvent $event) { |
|
| 443 | 443 | $event->types[] = ShortLinkField::class; |
| 444 | 444 | } |
| 445 | 445 | ); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | Event::on( |
| 449 | 449 | Gql::class, |
| 450 | 450 | Gql::EVENT_REGISTER_GQL_TYPES, |
| 451 | - function (RegisterGqlTypesEvent $event) { |
|
| 451 | + function(RegisterGqlTypesEvent $event) { |
|
| 452 | 452 | Craft::debug( |
| 453 | 453 | 'Gql::EVENT_REGISTER_GQL_TYPES', |
| 454 | 454 | __METHOD__ |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | Event::on( |
| 461 | 461 | Gql::class, |
| 462 | 462 | Gql::EVENT_REGISTER_GQL_QUERIES, |
| 463 | - function (RegisterGqlQueriesEvent $event) { |
|
| 463 | + function(RegisterGqlQueriesEvent $event) { |
|
| 464 | 464 | Craft::debug( |
| 465 | 465 | 'Gql::EVENT_REGISTER_GQL_QUERIES', |
| 466 | 466 | __METHOD__ |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | Event::on( |
| 477 | 477 | Gql::class, |
| 478 | 478 | Gql::EVENT_REGISTER_GQL_SCHEMA_COMPONENTS, |
| 479 | - function (RegisterGqlSchemaComponentsEvent $event) { |
|
| 479 | + function(RegisterGqlSchemaComponentsEvent $event) { |
|
| 480 | 480 | Craft::debug( |
| 481 | 481 | 'Gql::EVENT_REGISTER_GQL_SCHEMA_COMPONENTS', |
| 482 | 482 | __METHOD__ |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | Event::on( |
| 507 | 507 | UrlManager::class, |
| 508 | 508 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 509 | - function (RegisterUrlRulesEvent $event) { |
|
| 509 | + function(RegisterUrlRulesEvent $event) { |
|
| 510 | 510 | Craft::debug( |
| 511 | 511 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 512 | 512 | __METHOD__ |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | Event::on( |
| 530 | 530 | Dashboard::class, |
| 531 | 531 | Dashboard::EVENT_REGISTER_WIDGET_TYPES, |
| 532 | - function (RegisterComponentTypesEvent $event) { |
|
| 532 | + function(RegisterComponentTypesEvent $event) { |
|
| 533 | 533 | $event->types[] = RetourWidget::class; |
| 534 | 534 | } |
| 535 | 535 | ); |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | Event::on( |
| 538 | 538 | UrlManager::class, |
| 539 | 539 | UrlManager::EVENT_REGISTER_CP_URL_RULES, |
| 540 | - function (RegisterUrlRulesEvent $event) { |
|
| 540 | + function(RegisterUrlRulesEvent $event) { |
|
| 541 | 541 | Craft::debug( |
| 542 | 542 | 'UrlManager::EVENT_REGISTER_CP_URL_RULES', |
| 543 | 543 | __METHOD__ |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | Event::on( |
| 554 | 554 | UserPermissions::class, |
| 555 | 555 | UserPermissions::EVENT_REGISTER_PERMISSIONS, |
| 556 | - function (RegisterUserPermissionsEvent $event) { |
|
| 556 | + function(RegisterUserPermissionsEvent $event) { |
|
| 557 | 557 | Craft::debug( |
| 558 | 558 | 'UserPermissions::EVENT_REGISTER_PERMISSIONS', |
| 559 | 559 | __METHOD__ |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | Event::on( |
| 576 | 576 | ErrorHandler::class, |
| 577 | 577 | ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION, |
| 578 | - function (ExceptionEvent $event) { |
|
| 578 | + function(ExceptionEvent $event) { |
|
| 579 | 579 | Craft::debug( |
| 580 | 580 | 'ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION', |
| 581 | 581 | __METHOD__ |
@@ -66,13 +66,13 @@ |
||
| 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 | } |