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

api-platform / core / 14954769666

11 May 2025 10:14AM UTC coverage: 0.0% (-8.5%) from 8.457%
14954769666

Pull #7135

github

web-flow
Merge bf21e0bc7 into 4dd0cdfc4
Pull Request #7135: fix(symfony,laravel): InvalidUriVariableException status code (e400)

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

11040 existing lines in 370 files now uncovered.

0 of 48303 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/Metadata/Parameter.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\Metadata;
15

16
use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter;
17
use ApiPlatform\State\ParameterNotFound;
18
use ApiPlatform\State\ParameterProviderInterface;
19

20
/**
21
 * @experimental
22
 */
23
abstract class Parameter
24
{
25
    /**
26
     * @param (array<string, mixed>&array{type?: string, default?: string})|null $schema
27
     * @param array<string, mixed>                                               $extraProperties
28
     * @param ParameterProviderInterface|callable|string|null                    $provider
29
     * @param list<string>                                                       $properties      a list of properties this parameter applies to (works with the :property placeholder)
30
     * @param FilterInterface|string|null                                        $filter
31
     * @param mixed                                                              $constraints     an array of Symfony constraints, or an array of Laravel rules
32
     */
33
    public function __construct(
34
        protected ?string $key = null,
35
        protected ?array $schema = null,
36
        protected OpenApiParameter|array|false|null $openApi = null,
37
        protected mixed $provider = null,
38
        protected mixed $filter = null,
39
        protected ?string $property = null,
40
        protected ?string $description = null,
41
        protected ?array $properties = null,
42
        protected ?bool $required = null,
43
        protected ?int $priority = null,
44
        protected ?false $hydra = null,
45
        protected mixed $constraints = null,
46
        protected string|\Stringable|null $security = null,
47
        protected ?string $securityMessage = null,
48
        protected ?array $extraProperties = [],
49
        protected array|string|null $filterContext = null,
50
    ) {
UNCOV
51
    }
×
52

53
    public function getKey(): ?string
54
    {
UNCOV
55
        return $this->key;
×
56
    }
57

58
    /**
59
     * @return (array<string, mixed>&array{type?: string, default?: string})|null $schema
60
     */
61
    public function getSchema(): ?array
62
    {
UNCOV
63
        return $this->schema;
×
64
    }
65

66
    /**
67
     * @return OpenApiParameter[]|OpenApiParameter|bool|null
68
     */
69
    public function getOpenApi(): OpenApiParameter|array|bool|null
70
    {
UNCOV
71
        return $this->openApi;
×
72
    }
73

74
    public function getProvider(): mixed
75
    {
UNCOV
76
        return $this->provider;
×
77
    }
78

79
    public function getProperty(): ?string
80
    {
UNCOV
81
        return $this->property;
×
82
    }
83

84
    public function getFilter(): mixed
85
    {
UNCOV
86
        return $this->filter;
×
87
    }
88

89
    public function getDescription(): ?string
90
    {
UNCOV
91
        return $this->description;
×
92
    }
93

94
    public function getRequired(): ?bool
95
    {
UNCOV
96
        return $this->required;
×
97
    }
98

99
    public function getPriority(): ?int
100
    {
UNCOV
101
        return $this->priority;
×
102
    }
103

104
    public function getHydra(): ?bool
105
    {
UNCOV
106
        return $this->hydra;
×
107
    }
108

109
    public function getConstraints(): mixed
110
    {
UNCOV
111
        return $this->constraints;
×
112
    }
113

114
    public function getSecurity(): string|\Stringable|null
115
    {
UNCOV
116
        return $this->security;
×
117
    }
118

119
    public function getSecurityMessage(): ?string
120
    {
UNCOV
121
        return $this->securityMessage;
×
122
    }
123

124
    /**
125
     * The computed value of this parameter, located into extraProperties['_api_values'].
126
     */
127
    public function getValue(mixed $default = new ParameterNotFound()): mixed
128
    {
UNCOV
129
        return $this->extraProperties['_api_values'] ?? $default;
×
130
    }
131

132
    public function setValue(mixed $value): static
133
    {
134
        $this->extraProperties['_api_values'] = $value;
×
135

136
        return $this;
×
137
    }
138

139
    /**
140
     * @return array<string, mixed>
141
     */
142
    public function getExtraProperties(): array
143
    {
UNCOV
144
        return $this->extraProperties;
×
145
    }
146

147
    public function getFilterContext(): array|string|null
148
    {
UNCOV
149
        return $this->filterContext;
×
150
    }
151

152
    public function withKey(string $key): static
153
    {
UNCOV
154
        $self = clone $this;
×
UNCOV
155
        $self->key = $key;
×
156

UNCOV
157
        return $self;
×
158
    }
159

160
    public function withPriority(int $priority): static
161
    {
UNCOV
162
        $self = clone $this;
×
UNCOV
163
        $self->priority = $priority;
×
164

UNCOV
165
        return $self;
×
166
    }
167

168
    /**
169
     * @param array{type?: string} $schema
170
     */
171
    public function withSchema(array $schema): static
172
    {
UNCOV
173
        $self = clone $this;
×
UNCOV
174
        $self->schema = $schema;
×
175

UNCOV
176
        return $self;
×
177
    }
178

179
    /**
180
     * @param OpenApiParameter[]|OpenApiParameter|bool $openApi
181
     */
182
    public function withOpenApi(OpenApiParameter|array|bool $openApi): static
183
    {
UNCOV
184
        $self = clone $this;
×
UNCOV
185
        $self->openApi = $openApi;
×
186

UNCOV
187
        return $self;
×
188
    }
189

190
    /**
191
     * @param ParameterProviderInterface|string $provider
192
     */
193
    public function withProvider(mixed $provider): static
194
    {
UNCOV
195
        $self = clone $this;
×
UNCOV
196
        $self->provider = $provider;
×
197

UNCOV
198
        return $self;
×
199
    }
200

201
    /**
202
     * @param FilterInterface|string $filter
203
     */
204
    public function withFilter(mixed $filter): static
205
    {
206
        $self = clone $this;
×
207
        $self->filter = $filter;
×
208

209
        return $self;
×
210
    }
211

212
    public function withFilterContext(array|string $filterContext): static
213
    {
214
        $self = clone $this;
×
215
        $self->filterContext = $filterContext;
×
216

217
        return $self;
×
218
    }
219

220
    public function withProperty(string $property): static
221
    {
UNCOV
222
        $self = clone $this;
×
UNCOV
223
        $self->property = $property;
×
224

UNCOV
225
        return $self;
×
226
    }
227

228
    public function withDescription(string $description): static
229
    {
230
        $self = clone $this;
×
231
        $self->description = $description;
×
232

233
        return $self;
×
234
    }
235

236
    public function withRequired(bool $required): static
237
    {
238
        $self = clone $this;
×
239
        $self->required = $required;
×
240

241
        return $self;
×
242
    }
243

244
    public function withHydra(false $hydra): static
245
    {
246
        $self = clone $this;
×
247
        $self->hydra = $hydra;
×
248

249
        return $self;
×
250
    }
251

252
    public function withConstraints(mixed $constraints): static
253
    {
UNCOV
254
        $self = clone $this;
×
UNCOV
255
        $self->constraints = $constraints;
×
256

UNCOV
257
        return $self;
×
258
    }
259

260
    public function withSecurity(string|\Stringable|null $security): static
261
    {
262
        $self = clone $this;
×
263
        $self->security = $security;
×
264

265
        return $self;
×
266
    }
267

268
    public function withSecurityMessage(?string $securityMessage): static
269
    {
270
        $self = clone $this;
×
271
        $self->securityMessage = $securityMessage;
×
272

273
        return $self;
×
274
    }
275

276
    /**
277
     * @param array<string, mixed> $extraProperties
278
     */
279
    public function withExtraProperties(array $extraProperties): static
280
    {
UNCOV
281
        $self = clone $this;
×
UNCOV
282
        $self->extraProperties = $extraProperties;
×
283

UNCOV
284
        return $self;
×
285
    }
286

287
    public function getProperties(): ?array
288
    {
UNCOV
289
        return $this->properties;
×
290
    }
291

292
    public function withProperties(?array $properties): self
293
    {
294
        $self = clone $this;
×
295
        $self->properties = $properties;
×
296

297
        return $self;
×
298
    }
299
}
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