Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
askvortsov1 authored and StyleCIBot committed Feb 1, 2021
1 parent 284ab5a commit 173056b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/Discussion/Filter/AuthorFilterGambit.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@ protected function constrain(Builder $query, $rawUsernames, $negate)
}

$query->whereIn('discussions.user_id', $ids, 'and', $negate);

}
}
3 changes: 1 addition & 2 deletions src/Discussion/Filter/CreatedFilterGambit.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getFilterKey(): string

public function filter(WrappedFilter $wrappedFilter, string $filterValue, bool $negate)
{
preg_match('/^'.$this->pattern.'$/i', "created:".$filterValue, $matches);
preg_match('/^'.$this->pattern.'$/i', 'created:'.$filterValue, $matches);

$this->constrain($wrappedFilter->getQuery(), $matches[1], $matches[3], $negate);
}
Expand All @@ -53,6 +53,5 @@ public function constrain(Builder $query, $firstDate, $secondDate, $negate)
} else {
$query->whereBetween('created_at', [$firstDate, $secondDate], 'and', $negate);
}

}
}
3 changes: 1 addition & 2 deletions src/User/Filter/EmailFilterGambit.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Flarum\Filter\FilterInterface;
use Flarum\Filter\WrappedFilter;

use Flarum\Search\AbstractRegexGambit;
use Flarum\Search\AbstractSearch;
use Illuminate\Database\Query\Builder;
Expand All @@ -28,7 +27,7 @@ class EmailFilterGambit extends AbstractRegexGambit implements FilterInterface
*/
public function apply(AbstractSearch $search, $bit)
{
if (!$search->getActor()->hasPermission('user.edit')) {
if (! $search->getActor()->hasPermission('user.edit')) {
return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/User/Filter/GroupFilterGambit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function filter(WrappedFilter $wrappedFilter, string $filterValue, bool $

protected function constrain(Builder $query, User $actor, string $rawQuery, bool $negate)
{

$groupIdentifiers = explode(',', trim($rawQuery, '"'));

$groupQuery = Group::whereVisibleTo($actor);
Expand Down

0 comments on commit 173056b

Please sign in to comment.