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

api-platform / core / 13175753759

06 Feb 2025 09:30AM UTC coverage: 0.0% (-7.7%) from 7.663%
13175753759

Pull #6947

github

web-flow
Merge 432a515ad into de2d298e3
Pull Request #6947: fix(metadata): remove temporary fix for ArrayCollection

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

11655 existing lines in 385 files now uncovered.

0 of 47351 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 FilterInterface|string|null                                        $filter
30
     * @param mixed                                                              $constraints     an array of Symfony constraints, or an array of Laravel rules
31
     */
32
    public function __construct(
33
        protected ?string $key = null,
34
        protected ?array $schema = null,
35
        protected OpenApiParameter|array|false|null $openApi = null,
36
        protected mixed $provider = null,
37
        protected mixed $filter = null,
38
        protected ?string $property = null,
39
        protected ?string $description = null,
40
        protected ?bool $required = null,
41
        protected ?int $priority = null,
42
        protected ?false $hydra = null,
43
        protected mixed $constraints = null,
44
        protected string|\Stringable|null $security = null,
45
        protected ?string $securityMessage = null,
46
        protected ?array $extraProperties = [],
47
        protected ?array $filterContext = null,
48
    ) {
UNCOV
49
    }
×
50

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

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

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

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

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

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

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

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

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

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

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

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

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

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

130
    /**
131
     * @return array<string, mixed>
132
     */
133
    public function getExtraProperties(): array
134
    {
UNCOV
135
        return $this->extraProperties;
×
136
    }
137

138
    public function getFilterContext(): ?array
139
    {
UNCOV
140
        return $this->filterContext;
×
141
    }
142

143
    public function withKey(string $key): static
144
    {
UNCOV
145
        $self = clone $this;
×
UNCOV
146
        $self->key = $key;
×
147

UNCOV
148
        return $self;
×
149
    }
150

151
    public function withPriority(int $priority): static
152
    {
UNCOV
153
        $self = clone $this;
×
UNCOV
154
        $self->priority = $priority;
×
155

UNCOV
156
        return $self;
×
157
    }
158

159
    /**
160
     * @param array{type?: string} $schema
161
     */
162
    public function withSchema(array $schema): static
163
    {
UNCOV
164
        $self = clone $this;
×
UNCOV
165
        $self->schema = $schema;
×
166

UNCOV
167
        return $self;
×
168
    }
169

170
    /**
171
     * @param OpenApiParameter[]|OpenApiParameter|bool $openApi
172
     */
173
    public function withOpenApi(OpenApiParameter|array|bool $openApi): static
174
    {
UNCOV
175
        $self = clone $this;
×
UNCOV
176
        $self->openApi = $openApi;
×
177

UNCOV
178
        return $self;
×
179
    }
180

181
    /**
182
     * @param ParameterProviderInterface|string $provider
183
     */
184
    public function withProvider(mixed $provider): static
185
    {
UNCOV
186
        $self = clone $this;
×
UNCOV
187
        $self->provider = $provider;
×
188

UNCOV
189
        return $self;
×
190
    }
191

192
    /**
193
     * @param FilterInterface|string $filter
194
     */
195
    public function withFilter(mixed $filter): static
196
    {
197
        $self = clone $this;
×
198
        $self->filter = $filter;
×
199

200
        return $self;
×
201
    }
202

203
    public function withProperty(string $property): static
204
    {
UNCOV
205
        $self = clone $this;
×
UNCOV
206
        $self->property = $property;
×
207

UNCOV
208
        return $self;
×
209
    }
210

211
    public function withDescription(string $description): static
212
    {
213
        $self = clone $this;
×
214
        $self->description = $description;
×
215

216
        return $self;
×
217
    }
218

219
    public function withRequired(bool $required): static
220
    {
221
        $self = clone $this;
×
222
        $self->required = $required;
×
223

224
        return $self;
×
225
    }
226

227
    public function withHydra(false $hydra): static
228
    {
229
        $self = clone $this;
×
230
        $self->hydra = $hydra;
×
231

232
        return $self;
×
233
    }
234

235
    public function withConstraints(mixed $constraints): static
236
    {
UNCOV
237
        $self = clone $this;
×
UNCOV
238
        $self->constraints = $constraints;
×
239

UNCOV
240
        return $self;
×
241
    }
242

243
    public function withSecurity(string|\Stringable|null $security): self
244
    {
245
        $self = clone $this;
×
246
        $self->security = $security;
×
247

248
        return $self;
×
249
    }
250

251
    public function withSecurityMessage(?string $securityMessage): self
252
    {
253
        $self = clone $this;
×
254
        $self->securityMessage = $securityMessage;
×
255

256
        return $self;
×
257
    }
258

259
    /**
260
     * @param array<string, mixed> $extraProperties
261
     */
262
    public function withExtraProperties(array $extraProperties): static
263
    {
UNCOV
264
        $self = clone $this;
×
UNCOV
265
        $self->extraProperties = $extraProperties;
×
266

UNCOV
267
        return $self;
×
268
    }
269
}
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