@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function __construct() |
| 17 | 17 | { |
| 18 | - $this->filters = []; |
|
| 18 | + $this->filters = [ ]; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->prepareFilterIndex('$and'); |
| 29 | 29 | |
| 30 | - $this->filters['$and'] = array_merge( |
|
| 31 | - $this->filters['$and'], |
|
| 30 | + $this->filters[ '$and' ] = array_merge( |
|
| 31 | + $this->filters[ '$and' ], |
|
| 32 | 32 | $this->mapExpressions(...func_get_args()) |
| 33 | 33 | ); |
| 34 | 34 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->prepareFilterIndex('$or'); |
| 46 | 46 | |
| 47 | - $this->filters['$or'] = array_merge( |
|
| 48 | - $this->filters['$or'], |
|
| 47 | + $this->filters[ '$or' ] = array_merge( |
|
| 48 | + $this->filters[ '$or' ], |
|
| 49 | 49 | $this->mapExpressions(...func_get_args()) |
| 50 | 50 | ); |
| 51 | 51 | |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $this->prepareFilterIndex($field); |
| 62 | 62 | |
| 63 | - $this->filters[$field] = array_merge( |
|
| 64 | - $this->filters[$field], |
|
| 63 | + $this->filters[ $field ] = array_merge( |
|
| 64 | + $this->filters[ $field ], |
|
| 65 | 65 | $this->operationExpressions('$ne', $expressions) |
| 66 | 66 | ); |
| 67 | 67 | } |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | private function prepareFilterIndex(string $operator) |
| 81 | 81 | { |
| 82 | - if (!isset($this->filters[$operator])) { |
|
| 83 | - $this->filters[$operator] = []; |
|
| 82 | + if (!isset($this->filters[ $operator ])) { |
|
| 83 | + $this->filters[ $operator ] = [ ]; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | private function mapExpressions($expressions): array |
| 93 | 93 | { |
| 94 | 94 | return array_map( |
| 95 | - function ($expression) { |
|
| 95 | + function($expression) { |
|
| 96 | 96 | return $expression instanceof Expression ? $expression->getExpressionFilters() : $expression; |
| 97 | 97 | }, |
| 98 | 98 | func_get_args() |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | private function operationExpressions(string $operation, array $expressions): array |
| 109 | 109 | { |
| 110 | 110 | return array_map( |
| 111 | - function ($expression) use ($operation) { |
|
| 111 | + function($expression) use ($operation) { |
|
| 112 | 112 | $filter = $expression instanceof Expression ? $expression->getExpressionFilters() : $expression; |
| 113 | 113 | |
| 114 | - return [$operation => $filter]; |
|
| 114 | + return [ $operation => $filter ]; |
|
| 115 | 115 | }, |
| 116 | 116 | $expressions |
| 117 | 117 | ); |