mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +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:
@@ -17,6 +17,7 @@ use Flarum\Discussion\Event\Saving;
|
||||
use Flarum\Foundation\DispatchEventsTrait;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class EditDiscussionHandler
|
||||
{
|
||||
@@ -54,7 +55,7 @@ class EditDiscussionHandler
|
||||
{
|
||||
$actor = $command->actor;
|
||||
$data = $command->data;
|
||||
$attributes = array_get($data, 'attributes', []);
|
||||
$attributes = Arr::get($data, 'attributes', []);
|
||||
|
||||
$discussion = $this->discussions->findOrFail($command->discussionId, $actor);
|
||||
|
||||
|
@@ -20,6 +20,7 @@ use Flarum\Post\Command\PostReply;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
|
||||
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class StartDiscussionHandler
|
||||
{
|
||||
@@ -66,7 +67,7 @@ class StartDiscussionHandler
|
||||
// an opportunity to alter the discussion entity based on data in the
|
||||
// command they may have passed through in the controller.
|
||||
$discussion = Discussion::start(
|
||||
array_get($data, 'attributes.title'),
|
||||
Arr::get($data, 'attributes.title'),
|
||||
$actor
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user