@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function apply($model, RepositoryInterface $repository): Builder |
| 44 | 44 | { |
| 45 | - if (! empty($this->attributes) && \is_array($this->attributes)) { |
|
| 45 | + if (!empty($this->attributes) && \is_array($this->attributes)) { |
|
| 46 | 46 | foreach ($this->attributes as $parameter => $value) { |
| 47 | 47 | $model = $this->applyFilter($model, $parameter, $value); |
| 48 | 48 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $parser = (new FilterQueryParser($parameter, $value))->parse(); |
| 66 | 66 | $relation = $parser->getRelation(); |
| 67 | 67 | |
| 68 | - if ($relation && ! $this->modelHasRelation($model->getModel(), $relation)) { |
|
| 68 | + if ($relation && !$this->modelHasRelation($model->getModel(), $relation)) { |
|
| 69 | 69 | throw new RepositoryException('Trying to filter by non existent relation.'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | if ($relation) { |
| 78 | 78 | $model = $model->whereHas( |
| 79 | 79 | $relation, |
| 80 | - function ($query) use ($column, $dataType, $expression, $valueToSearch): void { |
|
| 80 | + function($query) use ($column, $dataType, $expression, $valueToSearch): void { |
|
| 81 | 81 | $this->applyDataTypeFilter($query, $column, $dataType, $expression, $valueToSearch); |
| 82 | 82 | } |
| 83 | 83 | ); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $namespace = 'Noitran\Repositories\Criteria\Support\\'; |
| 118 | 118 | $criteria = $namespace . ucfirst($dataType) . 'Criteria'; |
| 119 | 119 | |
| 120 | - if (! class_exists($criteria)) { |
|
| 120 | + if (!class_exists($criteria)) { |
|
| 121 | 121 | $defaultCriteria = $namespace . 'DefaultCriteria'; |
| 122 | 122 | |
| 123 | 123 | return new $defaultCriteria(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function parseExpression($filterValue): string |
| 155 | 155 | { |
| 156 | - if (! \is_array($filterValue)) { |
|
| 156 | + if (!\is_array($filterValue)) { |
|
| 157 | 157 | return config('repositories.filtering.default_expression', '$eq'); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $parsedDataType = substr($value, 0, $lastColonPosition); |
| 178 | 178 | |
| 179 | - if (! $this->isValidDataType($parsedDataType)) { |
|
| 179 | + if (!$this->isValidDataType($parsedDataType)) { |
|
| 180 | 180 | return config('repositories.filtering.default_data_type', '$string'); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | private function extractValue($filterValue): string |
| 213 | 213 | { |
| 214 | - if (! \is_array($filterValue)) { |
|
| 214 | + if (!\is_array($filterValue)) { |
|
| 215 | 215 | return $filterValue; |
| 216 | 216 | } |
| 217 | 217 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | private function isValidDataType($dataType, $strict = false): bool |
| 230 | 230 | { |
| 231 | - if (! in_array($dataType, config('repositories.filtering.allowed_data_types', '$string'), true)) { |
|
| 231 | + if (!in_array($dataType, config('repositories.filtering.allowed_data_types', '$string'), true)) { |
|
| 232 | 232 | if ($strict) { |
| 233 | 233 | throw new RepositoryException('Invalid/Unallowed data type passed.'); |
| 234 | 234 | } |