• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 17155082657

22 Aug 2025 12:19PM UTC coverage: 22.017% (-0.2%) from 22.209%
17155082657

Pull #7121

github

web-flow
Merge 57bd1a784 into 9e382e01b
Pull Request #7121: feat(doctrine): new search filters

44 of 99 new or added lines in 11 files covered. (44.44%)

125 existing lines in 11 files now uncovered.

11619 of 52774 relevant lines covered (22.02%)

12.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.11
/src/Doctrine/Orm/Filter/OrFilter.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Doctrine\Orm\Filter;
15

16
use ApiPlatform\Doctrine\Common\Filter\OpenApiFilterTrait;
17
use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
18
use ApiPlatform\Metadata\BackwardCompatibleFilterDescriptionTrait;
19
use ApiPlatform\Metadata\OpenApiParameterFilterInterface;
20
use ApiPlatform\Metadata\Operation;
21
use Doctrine\ORM\QueryBuilder;
22

23
/**
24
 * @author Vincent Amstoutz <vincent.amstoutz.dev@gmail.com>
25
 */
26
final class OrFilter implements FilterInterface, OpenApiParameterFilterInterface
27
{
28
    use BackwardCompatibleFilterDescriptionTrait;
29
    use OpenApiFilterTrait;
30

31
    /**
32
     * @param array<FilterInterface> $filters
33
     */
34
    public function __construct(private readonly array $filters)
35
    {
36
    }
1✔
37

38
    public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
39
    {
NEW
40
        foreach ($this->filters as $filter) {
×
NEW
41
            $filter->apply(
×
NEW
42
                $queryBuilder,
×
NEW
43
                $queryNameGenerator,
×
NEW
44
                $resourceClass,
×
NEW
45
                $operation,
×
NEW
46
                ['whereClause' => 'orWhere'] + $context
×
NEW
47
            );
×
48
        }
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc