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

api-platform / core / 17487610263

05 Sep 2025 08:12AM UTC coverage: 22.608% (+0.3%) from 22.319%
17487610263

push

github

web-flow
chore: remove @experimental flag from parameters (#7357)

12049 of 53296 relevant lines covered (22.61%)

26.21 hits per line

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

100.0
/src/Doctrine/Orm/Filter/FreeTextQueryFilter.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\LoggerAwareInterface;
17
use ApiPlatform\Doctrine\Common\Filter\LoggerAwareTrait;
18
use ApiPlatform\Doctrine\Common\Filter\ManagerRegistryAwareInterface;
19
use ApiPlatform\Doctrine\Common\Filter\ManagerRegistryAwareTrait;
20
use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
21
use ApiPlatform\Metadata\BackwardCompatibleFilterDescriptionTrait;
22
use ApiPlatform\Metadata\Operation;
23
use Doctrine\ORM\QueryBuilder;
24

25
final class FreeTextQueryFilter implements FilterInterface, ManagerRegistryAwareInterface, LoggerAwareInterface
26
{
27
    use BackwardCompatibleFilterDescriptionTrait;
28
    use LoggerAwareTrait;
29
    use ManagerRegistryAwareTrait;
30

31
    /**
32
     * @param list<string> $properties an array of properties, defaults to `parameter->getProperties()`
33
     */
34
    public function __construct(private readonly FilterInterface $filter, private readonly ?array $properties = null)
35
    {
36
    }
2✔
37

38
    public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
39
    {
40
        if ($this->filter instanceof ManagerRegistryAwareInterface) {
6✔
41
            $this->filter->setManagerRegistry($this->getManagerRegistry());
4✔
42
        }
43

44
        if ($this->filter instanceof LoggerAwareInterface) {
6✔
45
            $this->filter->setLogger($this->getLogger());
4✔
46
        }
47

48
        $parameter = $context['parameter'];
6✔
49
        foreach ($this->properties ?? $parameter->getProperties() ?? [] as $property) {
6✔
50
            $this->filter->apply(
6✔
51
                $queryBuilder,
6✔
52
                $queryNameGenerator,
6✔
53
                $resourceClass,
6✔
54
                $operation,
6✔
55
                ['parameter' => $parameter->withProperty($property)] + $context
6✔
56
            );
6✔
57
        }
58
    }
59
}
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

© 2026 Coveralls, Inc