• 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

44.26
/src/OpenApi/Model/Operation.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
final class Operation
17
{
18
    use ExtensionTrait;
19

20
    public function __construct(private ?string $operationId = null, private ?array $tags = null, private ?array $responses = null, private ?string $summary = null, private ?string $description = null, private ?ExternalDocumentation $externalDocs = null, private ?array $parameters = null, private ?RequestBody $requestBody = null, private ?\ArrayObject $callbacks = null, private ?bool $deprecated = null, private ?array $security = null, private ?array $servers = null, array $extensionProperties = [])
21
    {
UNCOV
22
        $this->extensionProperties = $extensionProperties;
89✔
23
    }
24

25
    public function addResponse(Response $response, $status = 'default'): self
26
    {
27
        $this->responses[$status] = $response;
×
28

29
        return $this;
×
30
    }
31

32
    public function getOperationId(): ?string
33
    {
UNCOV
34
        return $this->operationId;
22✔
35
    }
36

37
    public function getTags(): ?array
38
    {
UNCOV
39
        return $this->tags;
22✔
40
    }
41

42
    public function getResponses(): ?array
43
    {
UNCOV
44
        return $this->responses;
22✔
45
    }
46

47
    public function getSummary(): ?string
48
    {
UNCOV
49
        return $this->summary;
22✔
50
    }
51

52
    public function getDescription(): ?string
53
    {
UNCOV
54
        return $this->description;
22✔
55
    }
56

57
    public function getExternalDocs(): ?ExternalDocumentation
58
    {
UNCOV
59
        return $this->externalDocs;
22✔
60
    }
61

62
    public function getParameters(): ?array
63
    {
UNCOV
64
        return $this->parameters;
22✔
65
    }
66

67
    public function getRequestBody(): ?RequestBody
68
    {
UNCOV
69
        return $this->requestBody;
22✔
70
    }
71

72
    public function getCallbacks(): ?\ArrayObject
73
    {
UNCOV
74
        return $this->callbacks;
22✔
75
    }
76

77
    public function getDeprecated(): ?bool
78
    {
UNCOV
79
        return $this->deprecated;
22✔
80
    }
81

82
    public function getSecurity(): ?array
83
    {
UNCOV
84
        return $this->security;
22✔
85
    }
86

87
    public function getServers(): ?array
88
    {
UNCOV
89
        return $this->servers;
22✔
90
    }
91

92
    public function withOperationId(string $operationId): self
93
    {
94
        $clone = clone $this;
×
95
        $clone->operationId = $operationId;
×
96

97
        return $clone;
×
98
    }
99

100
    public function withTags(array $tags): self
101
    {
102
        $clone = clone $this;
×
103
        $clone->tags = $tags;
×
104

105
        return $clone;
×
106
    }
107

108
    public function withResponses(array $responses): self
109
    {
110
        $clone = clone $this;
×
111
        $clone->responses = $responses;
×
112

113
        return $clone;
×
114
    }
115

116
    public function withResponse(int|string $status, Response $response): self
117
    {
UNCOV
118
        $clone = clone $this;
22✔
UNCOV
119
        if (!\is_array($clone->responses)) {
22✔
120
            $clone->responses = [];
×
121
        }
UNCOV
122
        $clone->responses[(string) $status] = $response;
22✔
123

UNCOV
124
        return $clone;
22✔
125
    }
126

127
    public function withSummary(string $summary): self
128
    {
129
        $clone = clone $this;
×
130
        $clone->summary = $summary;
×
131

132
        return $clone;
×
133
    }
134

135
    public function withDescription(string $description): self
136
    {
137
        $clone = clone $this;
×
138
        $clone->description = $description;
×
139

140
        return $clone;
×
141
    }
142

143
    public function withExternalDocs(ExternalDocumentation $externalDocs): self
144
    {
145
        $clone = clone $this;
×
146
        $clone->externalDocs = $externalDocs;
×
147

148
        return $clone;
×
149
    }
150

151
    public function withParameters(array $parameters): self
152
    {
UNCOV
153
        $clone = clone $this;
22✔
UNCOV
154
        $clone->parameters = $parameters;
22✔
155

UNCOV
156
        return $clone;
22✔
157
    }
158

159
    public function withParameter(Parameter $parameter): self
160
    {
UNCOV
161
        $clone = clone $this;
22✔
UNCOV
162
        if (!\is_array($clone->parameters)) {
22✔
163
            $clone->parameters = [];
×
164
        }
UNCOV
165
        $clone->parameters[] = $parameter;
22✔
166

UNCOV
167
        return $clone;
22✔
168
    }
169

170
    public function withRequestBody(?RequestBody $requestBody = null): self
171
    {
UNCOV
172
        $clone = clone $this;
20✔
UNCOV
173
        $clone->requestBody = $requestBody;
20✔
174

UNCOV
175
        return $clone;
20✔
176
    }
177

178
    public function withCallbacks(\ArrayObject $callbacks): self
179
    {
180
        $clone = clone $this;
×
181
        $clone->callbacks = $callbacks;
×
182

183
        return $clone;
×
184
    }
185

186
    public function withDeprecated(bool $deprecated): self
187
    {
188
        $clone = clone $this;
×
189
        $clone->deprecated = $deprecated;
×
190

191
        return $clone;
×
192
    }
193

194
    public function withSecurity(?array $security = null): self
195
    {
196
        $clone = clone $this;
×
197
        $clone->security = $security;
×
198

199
        return $clone;
×
200
    }
201

202
    public function withServers(?array $servers = null): self
203
    {
204
        $clone = clone $this;
×
205
        $clone->servers = $servers;
×
206

207
        return $clone;
×
208
    }
209
}
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