1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 15:34:26 +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:
Franz Liedke
2019-07-06 00:49:34 +02:00
parent 307b912019
commit 646bd40bca
78 changed files with 229 additions and 144 deletions

View File

@@ -14,6 +14,7 @@ namespace Flarum\Api\Controller;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\User\Command\UploadAvatar;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
@@ -42,9 +43,9 @@ class UploadAvatarController extends AbstractShowController
*/
protected function data(ServerRequestInterface $request, Document $document)
{
$id = array_get($request->getQueryParams(), 'id');
$id = Arr::get($request->getQueryParams(), 'id');
$actor = $request->getAttribute('actor');
$file = array_get($request->getUploadedFiles(), 'avatar');
$file = Arr::get($request->getUploadedFiles(), 'avatar');
return $this->bus->dispatch(
new UploadAvatar($id, $file, $actor)