mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 12:35:44 +08:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
parent
baa5fdad95
commit
f2aa804753
|
@ -81,7 +81,6 @@ class ListDiscussionsController extends AbstractListController
|
|||
{
|
||||
$actor = $request->getAttribute('actor');
|
||||
|
||||
|
||||
$filters = $this->extractFilter($request);
|
||||
$sort = $this->extractSort($request);
|
||||
$query = $this->discussions->query();
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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] = [];
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user