@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | public function rules() |
105 | 105 | { |
106 | 106 | return [ |
107 | - ['pluginName', 'string'], |
|
108 | - ['pluginName', 'default', 'value' => 'Retour'], |
|
107 | + [ 'pluginName', 'string' ], |
|
108 | + [ 'pluginName', 'default', 'value' => 'Retour' ], |
|
109 | 109 | [ |
110 | 110 | [ |
111 | 111 | 'createUriChangeRedirects', |
@@ -116,17 +116,17 @@ discard block |
||
116 | 116 | ], |
117 | 117 | 'boolean' |
118 | 118 | ], |
119 | - ['staticRedirectDisplayLimit', 'integer', 'min' => 1], |
|
120 | - ['staticRedirectDisplayLimit', 'default', 'value' => 100], |
|
121 | - ['dynamicRedirectDisplayLimit', 'integer', 'min' => 1], |
|
122 | - ['dynamicRedirectDisplayLimit', 'default', 'value' => 100], |
|
123 | - ['statsStoredLimit', 'integer', 'min' => 1], |
|
124 | - ['statsStoredLimit', 'default', 'value' => 1000], |
|
125 | - ['refreshIntervalSecs', 'integer', 'min' => 0], |
|
126 | - ['refreshIntervalSecs', 'default', 'value' => 3], |
|
127 | - ['statsDisplayLimit', 'integer', 'min' => 1], |
|
128 | - ['statsDisplayLimit', 'default', 'value' => 1000], |
|
129 | - ['excludePatterns', ArrayValidator::class], |
|
119 | + [ 'staticRedirectDisplayLimit', 'integer', 'min' => 1 ], |
|
120 | + [ 'staticRedirectDisplayLimit', 'default', 'value' => 100 ], |
|
121 | + [ 'dynamicRedirectDisplayLimit', 'integer', 'min' => 1 ], |
|
122 | + [ 'dynamicRedirectDisplayLimit', 'default', 'value' => 100 ], |
|
123 | + [ 'statsStoredLimit', 'integer', 'min' => 1 ], |
|
124 | + [ 'statsStoredLimit', 'default', 'value' => 1000 ], |
|
125 | + [ 'refreshIntervalSecs', 'integer', 'min' => 0 ], |
|
126 | + [ 'refreshIntervalSecs', 'default', 'value' => 3 ], |
|
127 | + [ 'statsDisplayLimit', 'integer', 'min' => 1 ], |
|
128 | + [ 'statsDisplayLimit', 'default', 'value' => 1000 ], |
|
129 | + [ 'excludePatterns', ArrayValidator::class ], |
|
130 | 130 | ]; |
131 | 131 | } |
132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function behaviors() |
137 | 137 | { |
138 | - $craft31Behaviors = []; |
|
138 | + $craft31Behaviors = [ ]; |
|
139 | 139 | if (Retour::$craft31) { |
140 | 140 | $craft31Behaviors = [ |
141 | 141 | 'parser' => [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Protected Properties |
41 | 41 | // ========================================================================= |
42 | 42 | |
43 | - protected $allowAnonymous = []; |
|
43 | + protected $allowAnonymous = [ ]; |
|
44 | 44 | |
45 | 45 | // Public Methods |
46 | 46 | // ========================================================================= |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function actionDashboard(string $siteHandle = null, bool $showWelcome = false): Response |
58 | 58 | { |
59 | - $variables = []; |
|
59 | + $variables = [ ]; |
|
60 | 60 | PermissionHelper::controllerPermissionCheck('retour:dashboard'); |
61 | 61 | // Trim the statistics |
62 | 62 | Retour::$plugin->statistics->trimStatistics(); |
@@ -71,34 +71,34 @@ discard block |
||
71 | 71 | } catch (InvalidConfigException $e) { |
72 | 72 | Craft::error($e->getMessage(), __METHOD__); |
73 | 73 | } |
74 | - $variables['baseAssetsUrl'] = Craft::$app->assetManager->getPublishedUrl( |
|
74 | + $variables[ 'baseAssetsUrl' ] = Craft::$app->assetManager->getPublishedUrl( |
|
75 | 75 | '@nystudio107/retour/assetbundles/retour/dist', |
76 | 76 | true |
77 | 77 | ); |
78 | 78 | // Enabled sites |
79 | 79 | MultiSiteHelper::setMultiSiteVariables($siteHandle, $siteId, $variables); |
80 | - $variables['controllerHandle'] = 'dashboard'; |
|
80 | + $variables[ 'controllerHandle' ] = 'dashboard'; |
|
81 | 81 | |
82 | 82 | // Basic variables |
83 | - $variables['fullPageForm'] = false; |
|
84 | - $variables['docsUrl'] = self::DOCUMENTATION_URL; |
|
85 | - $variables['pluginName'] = $pluginName; |
|
86 | - $variables['title'] = $templateTitle; |
|
87 | - $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
88 | - $variables['crumbs'] = [ |
|
83 | + $variables[ 'fullPageForm' ] = false; |
|
84 | + $variables[ 'docsUrl' ] = self::DOCUMENTATION_URL; |
|
85 | + $variables[ 'pluginName' ] = $pluginName; |
|
86 | + $variables[ 'title' ] = $templateTitle; |
|
87 | + $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
88 | + $variables[ 'crumbs' ] = [ |
|
89 | 89 | [ |
90 | 90 | 'label' => $pluginName, |
91 | 91 | 'url' => UrlHelper::cpUrl('retour'), |
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 | - $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
|
99 | - $variables['selectedSubnavItem'] = 'dashboard'; |
|
100 | - $variables['showWelcome'] = $showWelcome; |
|
101 | - $variables['settings'] = Retour::$settings; |
|
98 | + $variables[ 'docTitle' ] = "{$pluginName} - {$templateTitle}"; |
|
99 | + $variables[ 'selectedSubnavItem' ] = 'dashboard'; |
|
100 | + $variables[ 'showWelcome' ] = $showWelcome; |
|
101 | + $variables[ 'settings' ] = Retour::$settings; |
|
102 | 102 | |
103 | 103 | // Render the template |
104 | 104 | return $this->renderTemplate('retour/dashboard/index', $variables); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | Craft::t( |
117 | 117 | 'retour', |
118 | 118 | 'Retour statistics cleared: {error}', |
119 | - ['error' => $error] |
|
119 | + [ 'error' => $error ] |
|
120 | 120 | ), |
121 | 121 | __METHOD__ |
122 | 122 | ); |