@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // Protected Properties |
| 89 | 89 | // ========================================================================= |
| 90 | 90 | |
| 91 | - protected array|bool|int $allowAnonymous = []; |
|
| 91 | + protected array | bool | int $allowAnonymous = []; |
|
| 92 | 92 | |
| 93 | 93 | // Public Methods |
| 94 | 94 | // ========================================================================= |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $csv->setOffset(1); |
| 175 | 175 | $columns = ArrayHelper::filterEmptyStringsFromArray($columns); |
| 176 | 176 | $rowIndex = 1; |
| 177 | - $csv->each(function ($row) use ($headers, $columns, &$rowIndex, &$hasErrors) { |
|
| 177 | + $csv->each(function($row) use ($headers, $columns, &$rowIndex, &$hasErrors) { |
|
| 178 | 178 | $redirectConfig = [ |
| 179 | 179 | 'id' => 0, |
| 180 | 180 | ]; |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | $index++; |
| 189 | 189 | } |
| 190 | 190 | $redirectDump = print_r($redirectConfig, true); |
| 191 | - Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 191 | + Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 192 | 192 | if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) { |
| 193 | - Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 193 | + Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 194 | 194 | $hasErrors = true; |
| 195 | 195 | } |
| 196 | 196 | $rowIndex++; |
@@ -230,9 +230,9 @@ discard block |
||
| 230 | 230 | $index++; |
| 231 | 231 | } |
| 232 | 232 | $redirectDump = print_r($redirectConfig, true); |
| 233 | - Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 233 | + Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 234 | 234 | if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) { |
| 235 | - Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 235 | + Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 236 | 236 | $hasErrors = true; |
| 237 | 237 | } |
| 238 | 238 | $rowIndex++; |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $variables['docsUrl'] = self::DOCUMENTATION_URL; |
| 282 | 282 | $variables['pluginName'] = $pluginName; |
| 283 | 283 | $variables['title'] = $templateTitle; |
| 284 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 284 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 285 | 285 | $variables['crumbs'] = [ |
| 286 | 286 | [ |
| 287 | 287 | 'label' => $pluginName, |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | ], |
| 290 | 290 | [ |
| 291 | 291 | 'label' => 'Redirects', |
| 292 | - 'url' => UrlHelper::cpUrl('retour/redirects' . $siteHandleUri), |
|
| 292 | + 'url' => UrlHelper::cpUrl('retour/redirects'.$siteHandleUri), |
|
| 293 | 293 | ], |
| 294 | 294 | ]; |
| 295 | 295 | $variables['docTitle'] = "{$pluginName} - Redirects - {$templateTitle}"; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $file = UploadedFile::getInstanceByName('file'); |
| 300 | 300 | if ($file !== null) { |
| 301 | 301 | $filename = uniqid($file->name, true); |
| 302 | - $filePath = Craft::$app->getPath()->getTempPath() . DIRECTORY_SEPARATOR . $filename; |
|
| 302 | + $filePath = Craft::$app->getPath()->getTempPath().DIRECTORY_SEPARATOR.$filename; |
|
| 303 | 303 | $file->saveAs($filePath, false); |
| 304 | 304 | // Also save the file to the cache as a backup way to access it |
| 305 | 305 | $fileContents = @file_get_contents($filePath); |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | } |
| 418 | 418 | $csv->insertOne(array_values($columns)); |
| 419 | 419 | $csv->insertAll($data); |
| 420 | - $csv->output($filename . '.csv'); |
|
| 420 | + $csv->output($filename.'.csv'); |
|
| 421 | 421 | exit(0); |
| 422 | 422 | } |
| 423 | 423 | |