• 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

0.0
/src/Doctrine/Odm/Filter/ExactFilter.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\Odm\Filter;
15

16
use ApiPlatform\Doctrine\Common\Filter\OpenApiFilterTrait;
17
use ApiPlatform\Metadata\BackwardCompatibleFilterDescriptionTrait;
18
use ApiPlatform\Metadata\OpenApiParameterFilterInterface;
19
use ApiPlatform\Metadata\Operation;
20
use Doctrine\ODM\MongoDB\Aggregation\Builder;
21

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

30
    public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
31
    {
NEW
32
        $parameter = $context['parameter'];
×
NEW
33
        $value = $parameter->getValue();
×
NEW
34
        $property = $parameter->getProperty();
×
35

NEW
36
        $aggregationBuilder
×
NEW
37
            ->match()
×
NEW
38
            ->field($property)
×
NEW
39
            ->{(is_iterable($value)) ? 'in' : 'equals'}($value);
×
40
    }
41
}
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