Apply fixes from StyleCI

[ci skip] [skip ci]
This commit is contained in:
Alexander Skvortsov 2020-11-13 07:56:37 +00:00 committed by StyleCI Bot
parent baa5fdad95
commit f2aa804753
5 changed files with 6 additions and 11 deletions

View File

@ -81,7 +81,6 @@ class ListDiscussionsController extends AbstractListController
{
$actor = $request->getAttribute('actor');
$filters = $this->extractFilter($request);
$sort = $this->extractSort($request);
$query = $this->discussions->query();

View File

@ -11,7 +11,6 @@ namespace Flarum\Extend;
use Flarum\Extension\Extension;
use Flarum\Filter\Filterer;
use Flarum\Filter\FilterInterface;
use Flarum\Foundation\ContainerUtil;
use Illuminate\Contracts\Container\Container;
@ -30,7 +29,7 @@ class Filter implements ExtenderInterface
}
/**
* Add a filter to run when the resource is filtered
* Add a filter to run when the resource is filtered.
*
* @param string $filterClass: The ::class attribute of the filter you are adding.
*/
@ -53,7 +52,6 @@ class Filter implements ExtenderInterface
public function extend(Container $container, Extension $extension = null)
{
foreach ($this->filters as $filter) {
Filterer::addFilter($this->resource, $container->make($filter));
}

View File

@ -23,11 +23,11 @@ class Filterer
public static function addFilter($resource, FilterInterface $filter)
{
if (!array_key_exists($resource, static::$filters)) {
if (! array_key_exists($resource, static::$filters)) {
static::$filters[$resource] = [];
}
if (!array_key_exists($filter->getKey(), static::$filters[$resource])) {
if (! array_key_exists($filter->getKey(), static::$filters[$resource])) {
static::$filters[$resource][$filter->getKey()] = [];
}
@ -36,7 +36,7 @@ class Filterer
public static function addFilterMutator($resource, $mutator)
{
if (!array_key_exists($resource, static::$filterMutators)) {
if (! array_key_exists($resource, static::$filterMutators)) {
static::$filterMutators[$resource] = [];
}

View File

@ -15,7 +15,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
class RequestUtil
{
public static function getActor(Request $request): User {
public static function getActor(Request $request): User
{
return $request->getAttribute('actor');
}

View File

@ -11,14 +11,11 @@ namespace Flarum\Tests\integration\extenders;
use Carbon\Carbon;
use Flarum\Discussion\Discussion;
use Flarum\Discussion\Search\DiscussionSearcher;
use Flarum\Extend;
use Flarum\Filter\FilterInterface;
use Flarum\Filter\WrappedFilter;
use Flarum\Search\AbstractSearch;
use Flarum\Tests\integration\RetrievesAuthorizedUsers;
use Flarum\Tests\integration\TestCase;
use Flarum\User\User;
class FilterTest extends TestCase
{