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

api-platform / core / 5761736306

pending completion
5761736306

push

github

web-flow
fix(openapi): model Example, Header and Reference (#5716)

81 of 81 new or added lines in 4 files covered. (100.0%)

9297 of 16116 relevant lines covered (57.69%)

52.5 hits per line

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

/src/OpenApi/Model/Reference.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\OpenApi\Model;
15

16
use Symfony\Component\Serializer\Annotation\SerializedName;
17

18
final class Reference
19
{
20
    use ExtensionTrait;
21

22
    public function __construct(private string $ref, private ?string $summary = null, private ?string $description = null)
23
    {
24
    }
×
25

26
    public function getSummary(): ?string
27
    {
28
        return $this->summary;
×
29
    }
30

31
    public function withSummary(string $summary): self
32
    {
33
        $clone = clone $this;
×
34
        $clone->summary = $summary;
×
35

36
        return $clone;
×
37
    }
38

39
    public function getDescription(): ?string
40
    {
41
        return $this->description;
×
42
    }
43

44
    public function withDescription(string $description): self
45
    {
46
        $clone = clone $this;
×
47
        $clone->description = $description;
×
48

49
        return $clone;
×
50
    }
51

52
    #[SerializedName('$ref')]
53
    public function getRef(): string
54
    {
55
        return $this->ref;
×
56
    }
57

58
    public function withRef(string $ref): self
59
    {
60
        $clone = clone $this;
×
61
        $clone->ref = $ref;
×
62

63
        return $clone;
×
64
    }
65
}
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