• 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/DummyValidation.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\ApiResource;
17
use ApiPlatform\Metadata\GetCollection;
18
use ApiPlatform\Metadata\Post;
19
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
20
use Symfony\Component\Validator\Constraints as Assert;
21

22
#[ApiResource(operations: [
23
    new GetCollection(),
×
24
    new Post(uriTemplate: 'dummy_validation{._format}'),
×
NEW
25
    new Post(uriTemplate: '/dummy_validation/validation_groups', validationContext: ['groups' => ['a']]),
×
26
    new Post(uriTemplate: '/dummy_validation/validation_sequence', validationContext: ['groups' => 'app.dummy_validation.group_generator'], extraProperties: ['rfc_7807_compliant_errors' => false]),
×
27
]
×
28
)]
×
29
#[ODM\Document]
30
class DummyValidation
31
{
32
    /**
33
     * @var int|null The id
34
     */
35
    #[ODM\Id(strategy: 'INCREMENT', type: 'int')]
36
    private ?int $id = null;
37
    /**
38
     * @var string|null The dummy name
39
     */
40
    #[Assert\NotNull(groups: ['a'])]
41
    #[ODM\Field(nullable: true)]
42
    private ?string $name = null;
43
    /**
44
     * @var string|null The dummy title
45
     */
46
    #[Assert\NotNull(groups: ['b'])]
47
    #[ODM\Field(nullable: true)]
48
    private ?string $title = null;
49
    /**
50
     * @var string|null The dummy code
51
     */
52
    #[ODM\Field]
53
    private ?string $code = null;
54

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

60
    public function setId(int $id): self
61
    {
62
        $this->id = $id;
×
63

64
        return $this;
×
65
    }
66

67
    public function getName(): ?string
68
    {
69
        return $this->name;
×
70
    }
71

72
    /**
73
     * @param string|null $name
74
     */
75
    public function setName($name): self
76
    {
77
        $this->name = $name;
×
78

79
        return $this;
×
80
    }
81

82
    public function getTitle(): ?string
83
    {
84
        return $this->title;
×
85
    }
86

87
    /**
88
     * @param string|null $title
89
     */
90
    public function setTitle($title): self
91
    {
92
        $this->title = $title;
×
93

94
        return $this;
×
95
    }
96

97
    public function getCode(): ?string
98
    {
99
        return $this->code;
×
100
    }
101

102
    /**
103
     * @param string $code
104
     */
105
    public function setCode($code): self
106
    {
107
        $this->code = $code;
×
108

109
        return $this;
×
110
    }
111
}
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