mirror of
https://github.com/flarum/core.git
synced 2025-08-24 17:13:44 +02:00
Use Laravel's class-based Str and Arr helpers
Starting with version 5.9, the global funtions will be deprecated. * https://laravel-news.com/laravel-5-8-deprecates-string-and-array-helpers * https://github.com/laravel/framework/pull/26898
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace Flarum\Settings;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class MemoryCacheSettingsRepository implements SettingsRepositoryInterface
|
||||
{
|
||||
protected $inner;
|
||||
@@ -39,7 +41,7 @@ class MemoryCacheSettingsRepository implements SettingsRepositoryInterface
|
||||
if (array_key_exists($key, $this->cache)) {
|
||||
return $this->cache[$key];
|
||||
} elseif (! $this->isCached) {
|
||||
return array_get($this->all(), $key, $default);
|
||||
return Arr::get($this->all(), $key, $default);
|
||||
}
|
||||
|
||||
return $default;
|
||||
|
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace Flarum\Settings;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
/**
|
||||
* A settings repository decorator that allows overriding certain values.
|
||||
*
|
||||
@@ -46,7 +48,7 @@ class OverrideSettingsRepository implements SettingsRepositoryInterface
|
||||
return $this->overrides[$key];
|
||||
}
|
||||
|
||||
return array_get($this->all(), $key, $default);
|
||||
return Arr::get($this->all(), $key, $default);
|
||||
}
|
||||
|
||||
public function set($key, $value)
|
||||
|
Reference in New Issue
Block a user