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

api-platform / core / 14922365773

09 May 2025 05:50AM UTC coverage: 6.886% (-1.6%) from 8.457%
14922365773

Pull #7134

github

web-flow
Merge ebf237e3f into 613bb5b75
Pull Request #7134: refactor(metadata): type parameters to list<string>|string

46 of 132 new or added lines in 15 files covered. (34.85%)

1 existing line in 1 file now uncovered.

10914 of 158496 relevant lines covered (6.89%)

6.26 hits per line

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

0.0
/tests/Fixtures/TestBundle/Document/FilteredBooleanParameter.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\BooleanFilter;
17
use ApiPlatform\Metadata\ApiResource;
18
use ApiPlatform\Metadata\GetCollection;
19
use ApiPlatform\Metadata\QueryParameter;
20
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
21
use Symfony\Component\TypeInfo\Type\BuiltinType;
22
use Symfony\Component\TypeInfo\TypeIdentifier;
23

24
#[ApiResource]
25
#[GetCollection(
26
    parameters: [
×
27
        'active' => new QueryParameter(
×
28
            filter: new BooleanFilter(),
×
NEW
29
            nativeType: new BuiltinType(TypeIdentifier::BOOL),
×
30
        ),
×
31
        'enabled' => new QueryParameter(
×
32
            filter: new BooleanFilter(),
×
33
            property: 'active',
×
NEW
34
            nativeType: new BuiltinType(TypeIdentifier::BOOL),
×
35
        ),
×
36
    ],
×
37
)]
×
38
#[ODM\Document]
39
class FilteredBooleanParameter
40
{
41
    public function __construct(
42
        #[ODM\Id(type: 'int', strategy: 'INCREMENT')]
43
        public ?int $id = null,
44

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

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

55
    public function isActive(): bool
56
    {
57
        return $this->active;
×
58
    }
59

60
    public function setActive(?bool $active): void
61
    {
62
        $this->active = $active;
×
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

© 2025 Coveralls, Inc