@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | Event::on( |
| 304 | 304 | Plugins::class, |
| 305 | 305 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 306 | - function (PluginEvent $event) { |
|
| 306 | + function(PluginEvent $event) { |
|
| 307 | 307 | if ($event->plugin === $this) { |
| 308 | 308 | // Invalidate our caches after we've been installed |
| 309 | 309 | $this->clearAllCaches(); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | Event::on( |
| 332 | 332 | CraftVariable::class, |
| 333 | 333 | CraftVariable::EVENT_INIT, |
| 334 | - function (Event $event) { |
|
| 334 | + function(Event $event) { |
|
| 335 | 335 | /** @var CraftVariable $variable */ |
| 336 | 336 | $variable = $event->sender; |
| 337 | 337 | $variable->set('webperf', WebperfVariable::class); |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | Event::on( |
| 342 | 342 | Plugins::class, |
| 343 | 343 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
| 344 | - function () { |
|
| 344 | + function() { |
|
| 345 | 345 | // Install these only after all other plugins have loaded |
| 346 | 346 | $request = Craft::$app->getRequest(); |
| 347 | 347 | // Only respond to non-console site requests |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | Event::on( |
| 366 | 366 | UrlManager::class, |
| 367 | 367 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 368 | - function (RegisterUrlRulesEvent $event) { |
|
| 368 | + function(RegisterUrlRulesEvent $event) { |
|
| 369 | 369 | Craft::debug( |
| 370 | 370 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 371 | 371 | __METHOD__ |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | Event::on( |
| 389 | 389 | UrlManager::class, |
| 390 | 390 | UrlManager::EVENT_REGISTER_CP_URL_RULES, |
| 391 | - function (RegisterUrlRulesEvent $event) { |
|
| 391 | + function(RegisterUrlRulesEvent $event) { |
|
| 392 | 392 | Craft::debug( |
| 393 | 393 | 'UrlManager::EVENT_REGISTER_CP_URL_RULES', |
| 394 | 394 | __METHOD__ |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | Event::on( |
| 405 | 405 | Dashboard::class, |
| 406 | 406 | Dashboard::EVENT_REGISTER_WIDGET_TYPES, |
| 407 | - function (RegisterComponentTypesEvent $event) { |
|
| 407 | + function(RegisterComponentTypesEvent $event) { |
|
| 408 | 408 | $event->types[] = MetricsWidget::class; |
| 409 | 409 | } |
| 410 | 410 | ); |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | Event::on( |
| 413 | 413 | UserPermissions::class, |
| 414 | 414 | UserPermissions::EVENT_REGISTER_PERMISSIONS, |
| 415 | - function (RegisterUserPermissionsEvent $event) { |
|
| 415 | + function(RegisterUserPermissionsEvent $event) { |
|
| 416 | 416 | Craft::debug( |
| 417 | 417 | 'UserPermissions::EVENT_REGISTER_PERMISSIONS', |
| 418 | 418 | __METHOD__ |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | Event::on( |
| 438 | 438 | View::class, |
| 439 | 439 | View::EVENT_END_PAGE, |
| 440 | - function () { |
|
| 440 | + function() { |
|
| 441 | 441 | Craft::debug( |
| 442 | 442 | 'View::EVENT_END_PAGE', |
| 443 | 443 | __METHOD__ |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | Event::on( |
| 462 | 462 | View::class, |
| 463 | 463 | View::EVENT_END_BODY, |
| 464 | - function () { |
|
| 464 | + function() { |
|
| 465 | 465 | Craft::debug( |
| 466 | 466 | 'View::EVENT_END_BODY', |
| 467 | 467 | __METHOD__ |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | Event::on( |
| 485 | 485 | Application::class, |
| 486 | 486 | Application::EVENT_AFTER_REQUEST, |
| 487 | - function () { |
|
| 487 | + function() { |
|
| 488 | 488 | Craft::debug( |
| 489 | 489 | 'Application::EVENT_AFTER_REQUEST', |
| 490 | 490 | __METHOD__ |
@@ -510,21 +510,21 @@ discard block |
||
| 510 | 510 | if (self::$settings->displaySidebar && $currentUser && $currentUser->can('webperf:sidebar')) { |
| 511 | 511 | $view = Craft::$app->getView(); |
| 512 | 512 | // Entries sidebar |
| 513 | - $view->hook('cp.entries.edit.details', function (&$context) { |
|
| 513 | + $view->hook('cp.entries.edit.details', function(&$context) { |
|
| 514 | 514 | /** @var Element $element */ |
| 515 | 515 | $element = $context['entry'] ?? null; |
| 516 | 516 | |
| 517 | 517 | return $this->renderSidebar($element); |
| 518 | 518 | }); |
| 519 | 519 | // Category Groups sidebar |
| 520 | - $view->hook('cp.categories.edit.details', function (&$context) { |
|
| 520 | + $view->hook('cp.categories.edit.details', function(&$context) { |
|
| 521 | 521 | /** @var Element $element */ |
| 522 | 522 | $element = $context['category'] ?? null; |
| 523 | 523 | |
| 524 | 524 | return $this->renderSidebar($element); |
| 525 | 525 | }); |
| 526 | 526 | // Commerce Product Types sidebar |
| 527 | - $view->hook('cp.commerce.product.edit.details', function (&$context) { |
|
| 527 | + $view->hook('cp.commerce.product.edit.details', function(&$context) { |
|
| 528 | 528 | /** @var Element $element */ |
| 529 | 529 | $element = $context['product'] ?? null; |
| 530 | 530 | |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | { |
| 732 | 732 | $cache = Craft::$app->getCache(); |
| 733 | 733 | // See if there are any recommendations to add as a badge |
| 734 | - $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () { |
|
| 734 | + $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() { |
|
| 735 | 735 | $data = []; |
| 736 | 736 | $now = new \DateTime(); |
| 737 | 737 | $end = $now->format('Y-m-d'); |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | $recommendations = ''; |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | - return (string)$recommendations; |
|
| 752 | + return (string) $recommendations; |
|
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | /** |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | { |
| 762 | 762 | $cache = Craft::$app->getCache(); |
| 763 | 763 | // See if there are any recommendations to add as a badge |
| 764 | - $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () { |
|
| 764 | + $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() { |
|
| 765 | 765 | $now = new \DateTime(); |
| 766 | 766 | $end = $now->format('Y-m-d'); |
| 767 | 767 | $start = $now->modify('-30 days')->format('Y-m-d'); |
@@ -775,6 +775,6 @@ discard block |
||
| 775 | 775 | $errors = '⚠'; |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | - return (string)$errors; |
|
| 778 | + return (string) $errors; |
|
| 779 | 779 | } |
| 780 | 780 | } |