1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +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

@@ -13,6 +13,7 @@ namespace Flarum\Api\Controller;
use Flarum\Group\Permission;
use Flarum\User\AssertPermissionTrait;
use Illuminate\Support\Arr;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
@@ -30,8 +31,8 @@ class SetPermissionController implements RequestHandlerInterface
$this->assertAdmin($request->getAttribute('actor'));
$body = $request->getParsedBody();
$permission = array_get($body, 'permission');
$groupIds = array_get($body, 'groupIds');
$permission = Arr::get($body, 'permission');
$groupIds = Arr::get($body, 'groupIds');
Permission::where('permission', $permission)->delete();