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

api-platform / core / 10014117656

19 Jul 2024 08:44PM UTC coverage: 7.856% (-56.3%) from 64.185%
10014117656

push

github

soyuka
Merge branch 'sf/remove-flag'

0 of 527 new or added lines in 83 files covered. (0.0%)

10505 existing lines in 362 files now uncovered.

12705 of 161727 relevant lines covered (7.86%)

26.85 hits per line

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

0.0
/tests/Fixtures/TestBundle/Document/SearchFilterParameter.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\Metadata\ApiFilter;
17
use ApiPlatform\Metadata\GetCollection;
18
use ApiPlatform\Metadata\GraphQl\QueryCollection;
19
use ApiPlatform\Metadata\QueryParameter;
20
use ApiPlatform\Tests\Fixtures\TestBundle\Filter\ODMSearchFilterValueTransformer;
21
use ApiPlatform\Tests\Fixtures\TestBundle\Filter\ODMSearchTextAndDateFilter;
22
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
23

24
#[GetCollection(
NEW
25
    uriTemplate: 'search_filter_parameter{._format}',
×
NEW
26
    parameters: [
×
NEW
27
        'foo' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter'),
×
NEW
28
        'order[:property]' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter.order_filter'),
×
29

NEW
30
        'searchPartial[:property]' => new QueryParameter(filter: 'app_odm_search_filter_partial'),
×
NEW
31
        'searchExact[:property]' => new QueryParameter(filter: 'app_odm_search_filter_with_exact'),
×
NEW
32
        'searchOnTextAndDate[:property]' => new QueryParameter(filter: 'app_odm_filter_date_and_search'),
×
NEW
33
        'q' => new QueryParameter(property: 'hydra:freetextQuery'),
×
NEW
34
    ]
×
NEW
35
)]
×
36
#[QueryCollection(
37
    parameters: [
×
38
        'foo' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter'),
×
39
        'order[:property]' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter.order_filter'),
×
40

41
        'searchPartial[:property]' => new QueryParameter(filter: 'app_odm_search_filter_partial'),
×
42
        'searchExact[:property]' => new QueryParameter(filter: 'app_odm_search_filter_with_exact'),
×
43
        'searchOnTextAndDate[:property]' => new QueryParameter(filter: 'app_odm_filter_date_and_search'),
×
44
        'q' => new QueryParameter(property: 'hydra:freetextQuery'),
×
45
    ]
×
46
)]
×
47
#[ApiFilter(ODMSearchFilterValueTransformer::class, alias: 'app_odm_search_filter_partial', properties: ['foo' => 'partial'], arguments: ['key' => 'searchPartial'])]
48
#[ApiFilter(ODMSearchFilterValueTransformer::class, alias: 'app_odm_search_filter_with_exact', properties: ['foo' => 'exact'], arguments: ['key' => 'searchExact'])]
49
#[ApiFilter(ODMSearchTextAndDateFilter::class, alias: 'app_odm_filter_date_and_search', properties: ['foo', 'createdAt'], arguments: ['dateFilterProperties' => ['createdAt' => 'exclude_null'], 'searchFilterProperties' => ['foo' => 'exact']])]
50
#[ODM\Document]
51
class SearchFilterParameter
52
{
53
    /**
54
     * @var int The id
55
     */
56
    #[ODM\Field]
57
    #[ODM\Id(strategy: 'INCREMENT', type: 'int')]
58
    private ?int $id = null;
59
    #[ODM\Field]
60
    private string $foo = '';
61
    #[ODM\Field(type: 'date_immutable', nullable: true)]
62
    private ?\DateTimeImmutable $createdAt = null;
63

64
    public function getId(): ?int
65
    {
66
        return $this->id;
×
67
    }
68

69
    public function getFoo(): string
70
    {
71
        return $this->foo;
×
72
    }
73

74
    public function setFoo(string $foo): void
75
    {
76
        $this->foo = $foo;
×
77
    }
78

79
    public function getCreatedAt(): ?\DateTimeImmutable
80
    {
81
        return $this->createdAt;
×
82
    }
83

84
    public function setCreatedAt(\DateTimeImmutable $createdAt): void
85
    {
86
        $this->createdAt = $createdAt;
×
87
    }
88
}
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