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

api-platform / core / 15133993414

20 May 2025 09:30AM UTC coverage: 26.313% (-1.2%) from 27.493%
15133993414

Pull #7161

github

web-flow
Merge e2c03d45f into 5459ba375
Pull Request #7161: fix(metadata): infer parameter string type from schema

0 of 2 new or added lines in 1 file covered. (0.0%)

11019 existing lines in 363 files now uncovered.

12898 of 49018 relevant lines covered (26.31%)

34.33 hits per line

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

28.95
/src/OpenApi/OpenApi.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;
15

16
use ApiPlatform\OpenApi\Model\Components;
17
use ApiPlatform\OpenApi\Model\ExtensionTrait;
18
use ApiPlatform\OpenApi\Model\Info;
19
use ApiPlatform\OpenApi\Model\Paths;
20

21
final class OpenApi
22
{
23
    use ExtensionTrait;
24

25
    public const VERSION = '3.1.0';
26

27
    private string $openapi = self::VERSION;
28
    private Components $components;
29

30
    public function __construct(private Info $info, private array $servers, private Paths $paths, ?Components $components = null, private array $security = [], private array $tags = [], private $externalDocs = null, private ?string $jsonSchemaDialect = null, private readonly ?\ArrayObject $webhooks = null)
31
    {
UNCOV
32
        $this->components = $components ?? new Components();
28✔
33
    }
34

35
    public function getOpenapi(): string
36
    {
UNCOV
37
        return $this->openapi;
22✔
38
    }
39

40
    public function getInfo(): Info
41
    {
UNCOV
42
        return $this->info;
27✔
43
    }
44

45
    public function getServers(): array
46
    {
UNCOV
47
        return $this->servers;
22✔
48
    }
49

50
    public function getPaths(): Paths
51
    {
UNCOV
52
        return $this->paths;
22✔
53
    }
54

55
    public function getComponents(): Components
56
    {
UNCOV
57
        return $this->components;
22✔
58
    }
59

60
    public function getSecurity(): array
61
    {
UNCOV
62
        return $this->security;
22✔
63
    }
64

65
    public function getTags(): array
66
    {
UNCOV
67
        return $this->tags;
22✔
68
    }
69

70
    public function getExternalDocs(): ?array
71
    {
UNCOV
72
        return $this->externalDocs;
22✔
73
    }
74

75
    public function getJsonSchemaDialect(): ?string
76
    {
UNCOV
77
        return $this->jsonSchemaDialect;
22✔
78
    }
79

80
    public function getWebhooks(): ?\ArrayObject
81
    {
UNCOV
82
        return $this->webhooks;
22✔
83
    }
84

85
    public function withOpenapi(string $openapi): self
86
    {
87
        $clone = clone $this;
×
88
        $clone->openapi = $openapi;
×
89

90
        return $clone;
×
91
    }
92

93
    public function withInfo(Info $info): self
94
    {
95
        $clone = clone $this;
×
96
        $clone->info = $info;
×
97

98
        return $clone;
×
99
    }
100

101
    public function withServers(array $servers): self
102
    {
103
        $clone = clone $this;
×
104
        $clone->servers = $servers;
×
105

106
        return $clone;
×
107
    }
108

109
    public function withPaths(Paths $paths): self
110
    {
111
        $clone = clone $this;
×
112
        $clone->paths = $paths;
×
113

114
        return $clone;
×
115
    }
116

117
    public function withComponents(Components $components): self
118
    {
119
        $clone = clone $this;
×
120
        $clone->components = $components;
×
121

122
        return $clone;
×
123
    }
124

125
    public function withSecurity(array $security): self
126
    {
127
        $clone = clone $this;
×
128
        $clone->security = $security;
×
129

130
        return $clone;
×
131
    }
132

133
    public function withTags(array $tags): self
134
    {
135
        $clone = clone $this;
×
136
        $clone->tags = $tags;
×
137

138
        return $clone;
×
139
    }
140

141
    public function withExternalDocs(array $externalDocs): self
142
    {
143
        $clone = clone $this;
×
144
        $clone->externalDocs = $externalDocs;
×
145

146
        return $clone;
×
147
    }
148

149
    public function withJsonSchemaDialect(?string $jsonSchemaDialect): self
150
    {
151
        $clone = clone $this;
×
152
        $clone->jsonSchemaDialect = $jsonSchemaDialect;
×
153

154
        return $clone;
×
155
    }
156
}
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