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

api-platform / core / 14880808037

07 May 2025 10:11AM UTC coverage: 8.457% (+1.3%) from 7.178%
14880808037

push

github

web-flow
fix(doctrine): filters schema for dates and numbers (#7131)

3 of 10 new or added lines in 7 files covered. (30.0%)

13397 of 158416 relevant lines covered (8.46%)

22.88 hits per line

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

0.0
/tests/Fixtures/TestBundle/Document/FilteredRangeParameter.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\Tests\Fixtures\TestBundle\Document;
15

16
use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
17
use ApiPlatform\Metadata\ApiResource;
18
use ApiPlatform\Metadata\GetCollection;
19
use ApiPlatform\Metadata\QueryParameter;
20
use ApiPlatform\OpenApi\Model\Parameter;
21
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
22

23
#[ApiResource]
24
#[GetCollection(
25
    paginationItemsPerPage: 5,
×
26
    parameters: [
×
27
        'quantity' => new QueryParameter(
×
28
            filter: new RangeFilter(),
×
NEW
29
            openApi: new Parameter('quantity', 'query', allowEmptyValue: true)
×
30
        ),
×
31
        'amount' => new QueryParameter(
×
32
            filter: new RangeFilter(),
×
33
            property: 'quantity',
×
NEW
34
            openApi: new Parameter('amount', 'query', allowEmptyValue: true)
×
35
        ),
×
36
    ],
×
37
)]
×
38
#[ODM\Document]
39
class FilteredRangeParameter
40
{
41
    public function __construct(
42
        #[ODM\Id(type: 'int', strategy: 'INCREMENT')]
43
        public ?int $id = null,
44

45
        #[ODM\Field(type: 'int', nullable: true)]
46
        public ?int $quantity = null,
47
    ) {
48
    }
×
49

50
    public function getId(): ?int
51
    {
52
        return $this->id;
×
53
    }
54

55
    public function getQuantity(): ?int
56
    {
57
        return $this->quantity;
×
58
    }
59

60
    public function setQuantity(?int $quantity): void
61
    {
62
        $this->quantity = $quantity;
×
63
    }
64
}
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