Total Complexity | 4 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class RandomOrderFilter extends AbstractFilter |
||
11 | { |
||
12 | protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void |
||
13 | { |
||
14 | // Verifica se o parâmetro "random" foi passado na URL |
||
15 | if ($property !== 'random' || $value !== 'true') { |
||
16 | return; |
||
17 | } |
||
18 | |||
19 | // Adiciona a ordenação aleatória à query |
||
20 | $queryBuilder->orderBy('RAND()'); |
||
21 | } |
||
22 | |||
23 | public function getDescription(string $resourceClass): array |
||
33 | ], |
||
34 | ], |
||
38 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths