From e4077ab4add10684414e445333fb701e166d2e1c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 24 Jul 2020 17:27:59 +0200 Subject: [PATCH] Replace a few forgotten obsolete helpers - Apparently, I forgot that `array_flatten` comes from Laravel. :) - When I did this previously, I did not search the views directory. --- src/Extension/Extension.php | 2 +- src/Foundation/Site.php | 3 ++- src/Frontend/Content/Assets.php | 3 ++- views/frontend/admin.blade.php | 6 +++--- views/frontend/forum.blade.php | 12 ++++++------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index 6ae5947f6..3707bfae0 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -267,7 +267,7 @@ class Extension implements Arrayable $extenders = [$extenders]; } - return array_flatten($extenders); + return Arr::flatten($extenders); } /** diff --git a/src/Foundation/Site.php b/src/Foundation/Site.php index 13b715b2c..54dfcb7e1 100644 --- a/src/Foundation/Site.php +++ b/src/Foundation/Site.php @@ -9,6 +9,7 @@ namespace Flarum\Foundation; +use Illuminate\Support\Arr; use RuntimeException; class Site @@ -62,6 +63,6 @@ class Site return []; } - return array_flatten($extenders); + return Arr::flatten($extenders); } } diff --git a/src/Frontend/Content/Assets.php b/src/Frontend/Content/Assets.php index e160adb34..50681f876 100644 --- a/src/Frontend/Content/Assets.php +++ b/src/Frontend/Content/Assets.php @@ -13,6 +13,7 @@ use Flarum\Foundation\Application; use Flarum\Frontend\Compiler\CompilerInterface; use Flarum\Frontend\Document; use Illuminate\Contracts\Container\Container; +use Illuminate\Support\Arr; use Psr\Http\Message\ServerRequestInterface as Request; class Assets @@ -48,7 +49,7 @@ class Assets ]; if ($this->app->inDebugMode()) { - $this->commit(array_flatten($compilers)); + $this->commit(Arr::flatten($compilers)); } $document->js = array_merge($document->js, $this->getUrls($compilers['js'])); diff --git a/views/frontend/admin.blade.php b/views/frontend/admin.blade.php index 2efce2af5..abab7d7fb 100644 --- a/views/frontend/admin.blade.php +++ b/views/frontend/admin.blade.php @@ -8,9 +8,9 @@

- - - @if ($logo = array_get($forum, 'logoUrl')) + + + @if ($logo = \Illuminate\Support\Arr::get($forum, 'logoUrl')) @else {{ $title }} diff --git a/views/frontend/forum.blade.php b/views/frontend/forum.blade.php index 01c0c7261..d4dd5cd9f 100644 --- a/views/frontend/forum.blade.php +++ b/views/frontend/forum.blade.php @@ -1,4 +1,4 @@ -{!! array_get($forum, 'headerHtml') !!} +{!! \Illuminate\Support\Arr::get($forum, 'headerHtml') !!}