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

api-platform / core / 17158226138

22 Aug 2025 02:38PM UTC coverage: 22.203% (-0.006%) from 22.209%
17158226138

Pull #7303

github

web-flow
Merge d35038aad into 9e382e01b
Pull Request #7303: fix(test): replace `Collection|iterable` with `Collection` and add appropriate PHPDoc tags

0 of 20 new or added lines in 8 files covered. (0.0%)

7 existing lines in 7 files now uncovered.

11699 of 52692 relevant lines covered (22.2%)

24.2 hits per line

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

0.0
/src/Doctrine/Odm/Tests/Fixtures/Document/Dummy.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\Odm\Tests\Fixtures\Document;
15

16
use Doctrine\Common\Collections\ArrayCollection;
17
use Doctrine\Common\Collections\Collection;
18
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
19
use Symfony\Component\Validator\Constraints as Assert;
20

21
/**
22
 * Dummy.
23
 *
24
 * @author Kévin Dunglas <dunglas@gmail.com>
25
 * @author Alexandre Delplace <alexandre.delplacemille@gmail.com>
26
 */
27
#[ODM\Document]
28
class Dummy
29
{
30
    #[ODM\Id(strategy: 'INCREMENT', type: 'int', nullable: true)]
31
    private ?int $id = null;
32
    /**
33
     * @var string|null The dummy name
34
     */
35
    #[Assert\NotBlank]
36
    #[ODM\Field(type: 'string')]
37
    private $name;
38
    /**
39
     * @var string|null The dummy name alias
40
     */
41
    #[ODM\Field(nullable: true)]
42
    private $alias;
43
    /**
44
     * @var array|null foo
45
     */
46
    private ?array $foo = null;
47
    /**
48
     * @var string|null A short description of the item
49
     */
50
    #[ODM\Field(type: 'string', nullable: true)]
51
    public $description;
52
    /**
53
     * @var string|null A dummy
54
     */
55
    #[ODM\Field(nullable: true)]
56
    public $dummy;
57
    /**
58
     * @var bool|null A dummy boolean
59
     */
60
    #[ODM\Field(type: 'bool', nullable: true)]
61
    public ?bool $dummyBoolean = null;
62
    /**
63
     * @var \DateTime|null A dummy date
64
     */
65
    #[ODM\Field(type: 'date', nullable: true)]
66
    public $dummyDate;
67
    /**
68
     * @var float|null A dummy float
69
     */
70
    #[ODM\Field(type: 'float', nullable: true)]
71
    public $dummyFloat;
72
    /**
73
     * @var float|null A dummy price
74
     */
75
    #[ODM\Field(type: 'float', nullable: true)]
76
    public $dummyPrice;
77
    #[ODM\ReferenceOne(targetDocument: RelatedDummy::class, storeAs: 'id', nullable: true)]
78
    public ?RelatedDummy $relatedDummy = null;
79
    /**
80
     * @return Collection<int, RelatedDummy>|iterable
81
     */
82
    #[ODM\ReferenceMany(targetDocument: RelatedDummy::class, storeAs: 'id', nullable: true)]
83
    public Collection|iterable $relatedDummies;
84
    #[ODM\Field(type: 'hash', nullable: true)]
85
    public array $jsonData = [];
86
    #[ODM\Field(type: 'collection', nullable: true)]
87
    public array $arrayData = [];
88
    /**
89
     * @var string|null
90
     */
91
    #[ODM\Field(nullable: true)]
92
    public $nameConverted;
93
    /**
94
     * @var RelatedOwnedDummy|null
95
     */
96
    #[ODM\ReferenceOne(targetDocument: RelatedOwnedDummy::class, cascade: ['persist'], mappedBy: 'owningDummy', nullable: true)]
97
    public $relatedOwnedDummy;
98
    /**
99
     * @var RelatedOwningDummy|null
100
     */
101
    #[ODM\ReferenceOne(targetDocument: RelatedOwningDummy::class, cascade: ['persist'], inversedBy: 'ownedDummy', nullable: true, storeAs: 'id')]
102
    public $relatedOwningDummy;
103

104
    public static function staticMethod(): void
105
    {
106
    }
×
107

108
    public function __construct()
109
    {
110
        $this->relatedDummies = new ArrayCollection();
×
111
    }
112

113
    public function getId(): ?int
114
    {
115
        return $this->id;
×
116
    }
117

118
    public function setId($id): void
119
    {
120
        $this->id = $id;
×
121
    }
122

123
    public function setName($name): void
124
    {
125
        $this->name = $name;
×
126
    }
127

128
    public function getName()
129
    {
130
        return $this->name;
×
131
    }
132

133
    public function setAlias($alias): void
134
    {
135
        $this->alias = $alias;
×
136
    }
137

138
    public function getAlias()
139
    {
140
        return $this->alias;
×
141
    }
142

143
    public function setDescription($description): void
144
    {
145
        $this->description = $description;
×
146
    }
147

148
    public function getDescription()
149
    {
150
        return $this->description;
×
151
    }
152

153
    public function getFoo(): ?array
154
    {
155
        return $this->foo;
×
156
    }
157

158
    public function setFoo(?array $foo = null): void
159
    {
160
        $this->foo = $foo;
×
161
    }
162

163
    public function setDummyDate(?\DateTime $dummyDate = null): void
164
    {
165
        $this->dummyDate = $dummyDate;
×
166
    }
167

168
    public function getDummyDate()
169
    {
170
        return $this->dummyDate;
×
171
    }
172

173
    public function setDummyPrice($dummyPrice)
174
    {
175
        $this->dummyPrice = $dummyPrice;
×
176

177
        return $this;
×
178
    }
179

180
    public function getDummyPrice()
181
    {
182
        return $this->dummyPrice;
×
183
    }
184

185
    public function setJsonData(array $jsonData): void
186
    {
187
        $this->jsonData = $jsonData;
×
188
    }
189

190
    public function getJsonData(): array
191
    {
192
        return $this->jsonData;
×
193
    }
194

195
    public function setArrayData(array $arrayData): void
196
    {
197
        $this->arrayData = $arrayData;
×
198
    }
199

200
    public function getArrayData(): array
201
    {
202
        return $this->arrayData;
×
203
    }
204

205
    public function getRelatedDummy(): ?RelatedDummy
206
    {
207
        return $this->relatedDummy;
×
208
    }
209

210
    public function setRelatedDummy(RelatedDummy $relatedDummy): void
211
    {
212
        $this->relatedDummy = $relatedDummy;
×
213
    }
214

215
    public function addRelatedDummy(RelatedDummy $relatedDummy): void
216
    {
NEW
217
        if (!$this->relatedDummies instanceof Collection) {
×
NEW
218
            return;
×
219
        }
220

UNCOV
221
        $this->relatedDummies->add($relatedDummy);
×
222
    }
223

224
    public function getRelatedOwnedDummy()
225
    {
226
        return $this->relatedOwnedDummy;
×
227
    }
228

229
    public function setRelatedOwnedDummy(RelatedOwnedDummy $relatedOwnedDummy): void
230
    {
231
        $this->relatedOwnedDummy = $relatedOwnedDummy;
×
232
        if ($this !== $this->relatedOwnedDummy->getOwningDummy()) {
×
233
            $this->relatedOwnedDummy->setOwningDummy($this);
×
234
        }
235
    }
236

237
    public function getRelatedOwningDummy()
238
    {
239
        return $this->relatedOwningDummy;
×
240
    }
241

242
    public function setRelatedOwningDummy(RelatedOwningDummy $relatedOwningDummy): void
243
    {
244
        $this->relatedOwningDummy = $relatedOwningDummy;
×
245
    }
246

247
    public function isDummyBoolean(): ?bool
248
    {
249
        return $this->dummyBoolean;
×
250
    }
251

252
    public function setDummyBoolean(?bool $dummyBoolean): void
253
    {
254
        $this->dummyBoolean = $dummyBoolean;
×
255
    }
256

257
    public function setDummy($dummy = null): void
258
    {
259
        $this->dummy = $dummy;
×
260
    }
261

262
    public function getDummy()
263
    {
264
        return $this->dummy;
×
265
    }
266
}
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