@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | Craft::t( |
| 108 | 108 | 'retour', |
| 109 | 109 | '{name} plugin loaded', |
| 110 | - ['name' => $this->name] |
|
| 110 | + [ 'name' => $this->name ] |
|
| 111 | 111 | ), |
| 112 | 112 | __METHOD__ |
| 113 | 113 | ); |
@@ -127,24 +127,24 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function getCpNavItem() |
| 129 | 129 | { |
| 130 | - $subNavs = []; |
|
| 130 | + $subNavs = [ ]; |
|
| 131 | 131 | $navItem = parent::getCpNavItem(); |
| 132 | 132 | $currentUser = Craft::$app->getUser()->getIdentity(); |
| 133 | 133 | // Only show sub-navs the user has permission to view |
| 134 | 134 | if ($currentUser->can('retour:dashboard')) { |
| 135 | - $subNavs['dashboard'] = [ |
|
| 135 | + $subNavs[ 'dashboard' ] = [ |
|
| 136 | 136 | 'label' => 'Dashboard', |
| 137 | 137 | 'url' => 'retour/dashboard', |
| 138 | 138 | ]; |
| 139 | 139 | } |
| 140 | 140 | if ($currentUser->can('retour:redirects')) { |
| 141 | - $subNavs['redirects'] = [ |
|
| 141 | + $subNavs[ 'redirects' ] = [ |
|
| 142 | 142 | 'label' => 'Redirects', |
| 143 | 143 | 'url' => 'retour/redirects', |
| 144 | 144 | ]; |
| 145 | 145 | } |
| 146 | 146 | if ($currentUser->can('retour:settings')) { |
| 147 | - $subNavs['settings'] = [ |
|
| 147 | + $subNavs[ 'settings' ] = [ |
|
| 148 | 148 | 'label' => 'Settings', |
| 149 | 149 | 'url' => 'retour/settings', |
| 150 | 150 | ]; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | Event::on( |
| 204 | 204 | Plugins::class, |
| 205 | 205 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 206 | - function (PluginEvent $event) { |
|
| 206 | + function(PluginEvent $event) { |
|
| 207 | 207 | if ($event->plugin === $this) { |
| 208 | 208 | // Invalidate our caches after we've been installed |
| 209 | 209 | $this->clearAllCaches(); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | Event::on( |
| 231 | 231 | CraftVariable::class, |
| 232 | 232 | CraftVariable::EVENT_INIT, |
| 233 | - function (Event $event) { |
|
| 233 | + function(Event $event) { |
|
| 234 | 234 | /** @var CraftVariable $variable */ |
| 235 | 235 | $variable = $event->sender; |
| 236 | 236 | $variable->set('retour', RetourVariable::class); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | Event::on( |
| 241 | 241 | Elements::class, |
| 242 | 242 | Elements::EVENT_BEFORE_SAVE_ELEMENT, |
| 243 | - function (ElementEvent $event) { |
|
| 243 | + function(ElementEvent $event) { |
|
| 244 | 244 | Craft::debug( |
| 245 | 245 | 'Elements::EVENT_BEFORE_SAVE_ELEMENT', |
| 246 | 246 | __METHOD__ |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | Event::on( |
| 252 | 252 | Elements::class, |
| 253 | 253 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
| 254 | - function (ElementEvent $event) { |
|
| 254 | + function(ElementEvent $event) { |
|
| 255 | 255 | Craft::debug( |
| 256 | 256 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
| 257 | 257 | __METHOD__ |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | Event::on( |
| 263 | 263 | Plugins::class, |
| 264 | 264 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
| 265 | - function () { |
|
| 265 | + function() { |
|
| 266 | 266 | // Install these only after all other plugins have loaded |
| 267 | 267 | $request = Craft::$app->getRequest(); |
| 268 | 268 | // Only respond to non-console site requests |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | Event::on( |
| 287 | 287 | UrlManager::class, |
| 288 | 288 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 289 | - function (RegisterUrlRulesEvent $event) { |
|
| 289 | + function(RegisterUrlRulesEvent $event) { |
|
| 290 | 290 | Craft::debug( |
| 291 | 291 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 292 | 292 | __METHOD__ |
@@ -309,15 +309,15 @@ discard block |
||
| 309 | 309 | Event::on( |
| 310 | 310 | Dashboard::class, |
| 311 | 311 | Dashboard::EVENT_REGISTER_WIDGET_TYPES, |
| 312 | - function (RegisterComponentTypesEvent $event) { |
|
| 313 | - $event->types[] = RetourWidget::class; |
|
| 312 | + function(RegisterComponentTypesEvent $event) { |
|
| 313 | + $event->types[ ] = RetourWidget::class; |
|
| 314 | 314 | } |
| 315 | 315 | ); |
| 316 | 316 | // Handler: UrlManager::EVENT_REGISTER_CP_URL_RULES |
| 317 | 317 | Event::on( |
| 318 | 318 | UrlManager::class, |
| 319 | 319 | UrlManager::EVENT_REGISTER_CP_URL_RULES, |
| 320 | - function (RegisterUrlRulesEvent $event) { |
|
| 320 | + function(RegisterUrlRulesEvent $event) { |
|
| 321 | 321 | Craft::debug( |
| 322 | 322 | 'UrlManager::EVENT_REGISTER_CP_URL_RULES', |
| 323 | 323 | __METHOD__ |
@@ -333,20 +333,20 @@ discard block |
||
| 333 | 333 | Event::on( |
| 334 | 334 | UserPermissions::class, |
| 335 | 335 | UserPermissions::EVENT_REGISTER_PERMISSIONS, |
| 336 | - function (RegisterUserPermissionsEvent $event) { |
|
| 336 | + function(RegisterUserPermissionsEvent $event) { |
|
| 337 | 337 | Craft::debug( |
| 338 | 338 | 'UserPermissions::EVENT_REGISTER_PERMISSIONS', |
| 339 | 339 | __METHOD__ |
| 340 | 340 | ); |
| 341 | 341 | // Register our custom permissions |
| 342 | - $event->permissions[Craft::t('retour', 'Retour')] = $this->customAdminCpPermissions(); |
|
| 342 | + $event->permissions[ Craft::t('retour', 'Retour') ] = $this->customAdminCpPermissions(); |
|
| 343 | 343 | } |
| 344 | 344 | ); |
| 345 | 345 | // Handler: ClearCaches::EVENT_REGISTER_CACHE_OPTIONS |
| 346 | 346 | Event::on( |
| 347 | 347 | ClearCaches::class, |
| 348 | 348 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
| 349 | - function (RegisterCacheOptionsEvent $event) { |
|
| 349 | + function(RegisterCacheOptionsEvent $event) { |
|
| 350 | 350 | Craft::debug( |
| 351 | 351 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
| 352 | 352 | __METHOD__ |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | Event::on( |
| 372 | 372 | ErrorHandler::class, |
| 373 | 373 | ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION, |
| 374 | - function (ExceptionEvent $event) { |
|
| 374 | + function(ExceptionEvent $event) { |
|
| 375 | 375 | Craft::debug( |
| 376 | 376 | 'ErrorHandler::EVENT_BEFORE_HANDLE_EXCEPTION', |
| 377 | 377 | __METHOD__ |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | [ |
| 466 | 466 | 'key' => 'retour-redirect-caches', |
| 467 | 467 | 'label' => Craft::t('retour', 'Retour redirect caches'), |
| 468 | - 'action' => [self::$plugin->redirects, 'invalidateCaches'], |
|
| 468 | + 'action' => [ self::$plugin->redirects, 'invalidateCaches' ], |
|
| 469 | 469 | ], |
| 470 | 470 | ]; |
| 471 | 471 | } |