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

api-platform / core / 18060089452

27 Sep 2025 12:57PM UTC coverage: 0.0% (-21.8%) from 21.793%
18060089452

Pull #7397

github

web-flow
Merge 479f46b8d into abe0438be
Pull Request #7397: fix(jsonschema/jsonld): make `@id` and `@type` properties required only in the JSON-LD schema for output

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

11967 existing lines in 393 files now uncovered.

0 of 53914 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/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;
×
23
    }
24

25
    /**
26
     * @param string $status
27
     */
28
    public function addResponse(Response $response, $status = 'default'): self
29
    {
30
        $this->responses[$status] = $response;
×
31

32
        return $this;
×
33
    }
34

35
    public function getOperationId(): ?string
36
    {
UNCOV
37
        return $this->operationId;
×
38
    }
39

40
    public function getTags(): ?array
41
    {
UNCOV
42
        return $this->tags;
×
43
    }
44

45
    public function getResponses(): ?array
46
    {
UNCOV
47
        return $this->responses;
×
48
    }
49

50
    public function getSummary(): ?string
51
    {
UNCOV
52
        return $this->summary;
×
53
    }
54

55
    public function getDescription(): ?string
56
    {
UNCOV
57
        return $this->description;
×
58
    }
59

60
    public function getExternalDocs(): ?ExternalDocumentation
61
    {
UNCOV
62
        return $this->externalDocs;
×
63
    }
64

65
    public function getParameters(): ?array
66
    {
UNCOV
67
        return $this->parameters;
×
68
    }
69

70
    public function getRequestBody(): ?RequestBody
71
    {
UNCOV
72
        return $this->requestBody;
×
73
    }
74

75
    public function getCallbacks(): ?\ArrayObject
76
    {
UNCOV
77
        return $this->callbacks;
×
78
    }
79

80
    public function getDeprecated(): ?bool
81
    {
UNCOV
82
        return $this->deprecated;
×
83
    }
84

85
    public function getSecurity(): ?array
86
    {
UNCOV
87
        return $this->security;
×
88
    }
89

90
    public function getServers(): ?array
91
    {
UNCOV
92
        return $this->servers;
×
93
    }
94

95
    public function withOperationId(string $operationId): self
96
    {
97
        $clone = clone $this;
×
98
        $clone->operationId = $operationId;
×
99

100
        return $clone;
×
101
    }
102

103
    public function withTags(array $tags): self
104
    {
105
        $clone = clone $this;
×
106
        $clone->tags = $tags;
×
107

108
        return $clone;
×
109
    }
110

111
    public function withResponses(array $responses): self
112
    {
113
        $clone = clone $this;
×
114
        $clone->responses = $responses;
×
115

116
        return $clone;
×
117
    }
118

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

UNCOV
127
        return $clone;
×
128
    }
129

130
    public function withSummary(string $summary): self
131
    {
132
        $clone = clone $this;
×
133
        $clone->summary = $summary;
×
134

135
        return $clone;
×
136
    }
137

138
    public function withDescription(string $description): self
139
    {
140
        $clone = clone $this;
×
141
        $clone->description = $description;
×
142

143
        return $clone;
×
144
    }
145

146
    public function withExternalDocs(ExternalDocumentation $externalDocs): self
147
    {
148
        $clone = clone $this;
×
149
        $clone->externalDocs = $externalDocs;
×
150

151
        return $clone;
×
152
    }
153

154
    public function withParameters(array $parameters): self
155
    {
UNCOV
156
        $clone = clone $this;
×
UNCOV
157
        $clone->parameters = $parameters;
×
158

UNCOV
159
        return $clone;
×
160
    }
161

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

UNCOV
170
        return $clone;
×
171
    }
172

173
    public function withRequestBody(?RequestBody $requestBody = null): self
174
    {
UNCOV
175
        $clone = clone $this;
×
UNCOV
176
        $clone->requestBody = $requestBody;
×
177

UNCOV
178
        return $clone;
×
179
    }
180

181
    public function withCallbacks(\ArrayObject $callbacks): self
182
    {
183
        $clone = clone $this;
×
184
        $clone->callbacks = $callbacks;
×
185

186
        return $clone;
×
187
    }
188

189
    public function withDeprecated(bool $deprecated): self
190
    {
191
        $clone = clone $this;
×
192
        $clone->deprecated = $deprecated;
×
193

194
        return $clone;
×
195
    }
196

197
    public function withSecurity(?array $security = null): self
198
    {
199
        $clone = clone $this;
×
200
        $clone->security = $security;
×
201

202
        return $clone;
×
203
    }
204

205
    public function withServers(?array $servers = null): self
206
    {
207
        $clone = clone $this;
×
208
        $clone->servers = $servers;
×
209

210
        return $clone;
×
211
    }
212
}
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

© 2026 Coveralls, Inc