mirror of
https://github.com/flarum/core.git
synced 2025-10-15 00:44:40 +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:
@@ -20,6 +20,7 @@ use Flarum\Post\Event\Saving;
|
||||
use Flarum\Post\PostValidator;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class PostReplyHandler
|
||||
{
|
||||
@@ -86,12 +87,12 @@ class PostReplyHandler
|
||||
// opportunity to alter the post entity based on data in the command.
|
||||
$post = CommentPost::reply(
|
||||
$discussion->id,
|
||||
array_get($command->data, 'attributes.content'),
|
||||
Arr::get($command->data, 'attributes.content'),
|
||||
$actor->id,
|
||||
$command->ipAddress
|
||||
);
|
||||
|
||||
if ($actor->isAdmin() && ($time = array_get($command->data, 'attributes.createdAt'))) {
|
||||
if ($actor->isAdmin() && ($time = Arr::get($command->data, 'attributes.createdAt'))) {
|
||||
$post->created_at = new Carbon($time);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user