Skip to content

Commit 7e12cba

Browse files
stengithub-actions[bot]
authored andcommitted
Fix styling
1 parent 05d0184 commit 7e12cba

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Models/Redirect.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* TODO observer
11+
*
1112
* @see RedirectObserver for clearing the cache.
1213
*/
1314
class Redirect extends Model
@@ -21,19 +22,20 @@ class Redirect extends Model
2122
/**
2223
* Returns a list of old and new urls with the status code if set compatible with spatie/laravel-missing-page-redirector,
2324
* that merges the redirects set in the database over the redirects set in the config.
24-
* @return array
2525
*/
26-
public static function getDirectionMap(): array {
26+
public static function getDirectionMap(): array
27+
{
2728
// Get from the database and remember forever
2829
// we clear this on new model or updated model
2930
$dbRedirects = Cache::rememberForever(static::CACHE_REDIRECTS_KEY, function () {
3031
return Redirect::all()->flatMap(function (Redirect $redirect) {
31-
if($redirect->status_code){
32+
if ($redirect->status_code) {
3233
return [
33-
$redirect->old_url => [$redirect->new_url, $redirect->status_code]
34+
$redirect->old_url => [$redirect->new_url, $redirect->status_code],
3435
];
36+
} else {
37+
return [$redirect->old_url => $redirect->new_url];
3538
}
36-
else return [$redirect->old_url => $redirect->new_url];
3739
})->toArray();
3840
});
3941

0 commit comments

Comments
 (0)