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

api-platform / core / 19438754788

17 Nov 2025 05:34PM UTC coverage: 0.0%. Remained the same
19438754788

push

github

soyuka
Merge 4.2

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

19 existing lines in 18 files now uncovered.

0 of 57020 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/Extractor/YamlResourceExtractor.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\Extractor;
15

16
use ApiPlatform\Doctrine\Odm\State\Options as OdmOptions;
17
use ApiPlatform\Doctrine\Orm\State\Options as OrmOptions;
18
use ApiPlatform\Elasticsearch\State\Options as ElasticsearchOptions;
19
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
20
use ApiPlatform\Metadata\GetCollection;
21
use ApiPlatform\Metadata\HeaderParameter;
22
use ApiPlatform\Metadata\Post;
23
use ApiPlatform\Metadata\QueryParameter;
24
use ApiPlatform\OpenApi\Model\ExternalDocumentation;
25
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
26
use ApiPlatform\OpenApi\Model\Parameter;
27
use ApiPlatform\OpenApi\Model\RequestBody;
28
use ApiPlatform\OpenApi\Model\Response;
29
use ApiPlatform\State\OptionsInterface;
30
use Symfony\Component\WebLink\Link;
31
use Symfony\Component\Yaml\Exception\ParseException;
32
use Symfony\Component\Yaml\Yaml;
33

34
/**
35
 * Extracts an array of metadata from a list of YAML files.
36
 *
37
 * @author Antoine Bluchet <soyuka@gmail.com>
38
 * @author Baptiste Meyer <baptiste.meyer@gmail.com>
39
 * @author Kévin Dunglas <dunglas@gmail.com>
40
 * @author Vincent Chalamon <vincentchalamon@gmail.com>
41
 */
42
final class YamlResourceExtractor extends AbstractResourceExtractor
43
{
44
    use ResourceExtractorTrait;
45

46
    /**
47
     * {@inheritdoc}
48
     */
49
    protected function extractPath(string $path): void
50
    {
51
        try {
52
            $resourcesYaml = Yaml::parse((string) file_get_contents($path), Yaml::PARSE_CONSTANT);
×
53
        } catch (ParseException $e) {
×
54
            $e->setParsedFile($path);
×
55

56
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
×
57
        }
58

59
        if (null === $resourcesYaml = $resourcesYaml['resources'] ?? $resourcesYaml) {
×
60
            return;
×
61
        }
62

63
        if (!\is_array($resourcesYaml)) {
×
64
            throw new InvalidArgumentException(\sprintf('"resources" setting is expected to be null or an array, %s given in "%s".', \gettype($resourcesYaml), $path));
×
65
        }
66

67
        $this->buildResources($resourcesYaml, $path);
×
68
    }
69

70
    private function buildResources(array $resourcesYaml, string $path): void
71
    {
72
        foreach ($resourcesYaml as $resourceName => $resourceYaml) {
×
73
            $resourceName = $this->resolve($resourceName);
×
74

75
            if (null === $resourceYaml) {
×
76
                $resourceYaml = [[]];
×
77
            }
78

79
            if (!\array_key_exists(0, $resourceYaml)) {
×
80
                $resourceYaml = [$resourceYaml];
×
81
            }
82

83
            foreach ($resourceYaml as $key => $resourceYamlDatum) {
×
84
                if (null === $resourceYamlDatum) {
×
85
                    $resourceYamlDatum = [];
×
86
                }
87

88
                try {
89
                    $base = $this->buildExtendedBase($resourceYamlDatum);
×
90
                    $this->resources[$resourceName][$key] = array_merge($base, [
×
91
                        'operations' => $this->buildOperations($resourceYamlDatum, $base),
×
92
                        'graphQlOperations' => $this->buildGraphQlOperations($resourceYamlDatum, $base),
×
93
                    ]);
×
94
                } catch (InvalidArgumentException $exception) {
×
95
                    throw new InvalidArgumentException(\sprintf('%s in "%s" (%s).', $exception->getMessage(), $resourceName, $path));
×
96
                }
97
            }
98
        }
99
    }
100

101
    private function buildExtendedBase(array $resource): array
102
    {
103
        return array_merge($this->buildBase($resource), [
×
104
            'uriTemplate' => $this->phpize($resource, 'uriTemplate', 'string'),
×
105
            'routePrefix' => $this->phpize($resource, 'routePrefix', 'string'),
×
106
            'stateless' => $this->phpize($resource, 'stateless', 'bool'),
×
107
            'sunset' => $this->phpize($resource, 'sunset', 'string'),
×
108
            'acceptPatch' => $this->phpize($resource, 'acceptPatch', 'string'),
×
109
            'host' => $this->phpize($resource, 'host', 'string'),
×
110
            'condition' => $this->phpize($resource, 'condition', 'string'),
×
111
            'controller' => $this->phpize($resource, 'controller', 'string'),
×
112
            'queryParameterValidationEnabled' => $this->phpize($resource, 'queryParameterValidationEnabled', 'bool'),
×
113
            'types' => $this->buildArrayValue($resource, 'types'),
×
114
            'cacheHeaders' => $this->buildArrayValue($resource, 'cacheHeaders'),
×
115
            'hydraContext' => $this->buildArrayValue($resource, 'hydraContext'),
×
116
            'openapi' => $this->buildOpenapi($resource),
×
117
            'paginationViaCursor' => $this->buildArrayValue($resource, 'paginationViaCursor'),
×
118
            'exceptionToStatus' => $this->buildArrayValue($resource, 'exceptionToStatus'),
×
119
            'defaults' => $this->buildArrayValue($resource, 'defaults'),
×
120
            'requirements' => $this->buildArrayValue($resource, 'requirements'),
×
121
            'options' => $this->buildArrayValue($resource, 'options'),
×
122
            'status' => $this->phpize($resource, 'status', 'integer'),
×
123
            'schemes' => $this->buildArrayValue($resource, 'schemes'),
×
124
            'formats' => $this->buildArrayValue($resource, 'formats'),
×
125
            'uriVariables' => $this->buildUriVariables($resource),
×
126
            'inputFormats' => $this->buildArrayValue($resource, 'inputFormats'),
×
127
            'outputFormats' => $this->buildArrayValue($resource, 'outputFormats'),
×
128
            'stateOptions' => $this->buildStateOptions($resource),
×
129
            'links' => $this->buildLinks($resource),
×
130
            'headers' => $this->buildHeaders($resource),
×
131
            'parameters' => $this->buildParameters($resource),
×
132
        ]);
×
133
    }
134

135
    private function buildBase(array $resource): array
136
    {
137
        return [
×
138
            'shortName' => $this->phpize($resource, 'shortName', 'string'),
×
139
            'description' => $this->phpize($resource, 'description', 'string'),
×
140
            'urlGenerationStrategy' => $this->phpize($resource, 'urlGenerationStrategy', 'integer'),
×
141
            'deprecationReason' => $this->phpize($resource, 'deprecationReason', 'string'),
×
142
            'fetchPartial' => $this->phpize($resource, 'fetchPartial', 'bool'),
×
143
            'forceEager' => $this->phpize($resource, 'forceEager', 'bool'),
×
144
            'paginationClientEnabled' => $this->phpize($resource, 'paginationClientEnabled', 'bool'),
×
145
            'paginationClientItemsPerPage' => $this->phpize($resource, 'paginationClientItemsPerPage', 'bool'),
×
146
            'paginationClientPartial' => $this->phpize($resource, 'paginationClientPartial', 'bool'),
×
147
            'paginationEnabled' => $this->phpize($resource, 'paginationEnabled', 'bool'),
×
148
            'paginationFetchJoinCollection' => $this->phpize($resource, 'paginationFetchJoinCollection', 'bool'),
×
149
            'paginationUseOutputWalkers' => $this->phpize($resource, 'paginationUseOutputWalkers', 'bool'),
×
150
            'paginationItemsPerPage' => $this->phpize($resource, 'paginationItemsPerPage', 'integer'),
×
151
            'paginationMaximumItemsPerPage' => $this->phpize($resource, 'paginationMaximumItemsPerPage', 'integer'),
×
152
            'paginationPartial' => $this->phpize($resource, 'paginationPartial', 'bool'),
×
153
            'paginationType' => $this->phpize($resource, 'paginationType', 'string'),
×
154
            'processor' => $this->phpize($resource, 'processor', 'string'),
×
155
            'provider' => $this->phpize($resource, 'provider', 'string'),
×
156
            'security' => $this->phpize($resource, 'security', 'string'),
×
157
            'securityMessage' => $this->phpize($resource, 'securityMessage', 'string'),
×
158
            'securityPostDenormalize' => $this->phpize($resource, 'securityPostDenormalize', 'string'),
×
159
            'securityPostDenormalizeMessage' => $this->phpize($resource, 'securityPostDenormalizeMessage', 'string'),
×
160
            'securityPostValidation' => $this->phpize($resource, 'securityPostValidation', 'string'),
×
161
            'securityPostValidationMessage' => $this->phpize($resource, 'securityPostValidationMessage', 'string'),
×
162
            'input' => $this->phpize($resource, 'input', 'bool|string'),
×
163
            'output' => $this->phpize($resource, 'output', 'bool|string'),
×
164
            'normalizationContext' => $this->buildArrayValue($resource, 'normalizationContext'),
×
165
            'denormalizationContext' => $this->buildArrayValue($resource, 'denormalizationContext'),
×
166
            'collectDenormalizationErrors' => $this->phpize($resource, 'collectDenormalizationErrors', 'bool'),
×
167
            'validationContext' => $this->buildArrayValue($resource, 'validationContext'),
×
168
            'filters' => $this->buildArrayValue($resource, 'filters'),
×
169
            'order' => $this->buildArrayValue($resource, 'order'),
×
170
            'extraProperties' => $this->buildArrayValue($resource, 'extraProperties'),
×
171
            'mercure' => $this->buildMercure($resource),
×
172
            'messenger' => $this->buildMessenger($resource),
×
173
            'read' => $this->phpize($resource, 'read', 'bool'),
×
174
            'write' => $this->phpize($resource, 'write', 'bool'),
×
175
            'jsonStream' => $this->phpize($resource, 'jsonStream', 'bool'),
×
NEW
176
            'map' => $this->phpize($resource, 'map', 'bool'),
×
UNCOV
177
        ];
×
178
    }
179

180
    private function buildUriVariables(array $resource): ?array
181
    {
182
        if (!\array_key_exists('uriVariables', $resource)) {
×
183
            return null;
×
184
        }
185

186
        $uriVariables = [];
×
187
        foreach ($resource['uriVariables'] as $parameterName => $data) {
×
188
            if (\is_string($data)) {
×
189
                $uriVariables[$data] = $data;
×
190
                continue;
×
191
            }
192

193
            if (2 === (is_countable($data) ? \count($data) : 0) && isset($data[0]) && isset($data[1])) {
×
194
                $data['fromClass'] = $data[0];
×
195
                $data['fromProperty'] = $data[1];
×
196
                unset($data[0], $data[1]);
×
197
            }
198
            if (isset($data['fromClass'])) {
×
199
                $uriVariables[$parameterName]['from_class'] = $this->resolve($data['fromClass']);
×
200
            }
201
            if (isset($data['fromProperty'])) {
×
202
                $uriVariables[$parameterName]['from_property'] = $data['fromProperty'];
×
203
            }
204
            if (isset($data['toClass'])) {
×
205
                $uriVariables[$parameterName]['to_class'] = $this->resolve($data['toClass']);
×
206
            }
207
            if (isset($data['toProperty'])) {
×
208
                $uriVariables[$parameterName]['to_property'] = $data['toProperty'];
×
209
            }
210
            if (isset($data['identifiers'])) {
×
211
                $uriVariables[$parameterName]['identifiers'] = $data['identifiers'];
×
212
            }
213
            if (isset($data['compositeIdentifier'])) {
×
214
                $uriVariables[$parameterName]['composite_identifier'] = $data['compositeIdentifier'];
×
215
            }
216
            if (isset($data['security'])) {
×
217
                $uriVariables[$parameterName]['security'] = $data['security'];
×
218
            }
219
        }
220

221
        return $uriVariables;
×
222
    }
223

224
    private function buildOpenapi(array $resource): bool|OpenApiOperation|null
225
    {
226
        if (!\array_key_exists('openapi', $resource)) {
×
227
            return null;
×
228
        }
229

230
        if (!\is_array($resource['openapi'])) {
×
231
            return $this->phpize($resource, 'openapi', 'bool');
×
232
        }
233

234
        $allowedProperties = array_map(fn (\ReflectionProperty $reflProperty): string => $reflProperty->getName(), (new \ReflectionClass(OpenApiOperation::class))->getProperties());
×
235
        foreach ($resource['openapi'] as $key => $value) {
×
236
            $resource['openapi'][$key] = match ($key) {
×
237
                'externalDocs' => new ExternalDocumentation(description: $value['description'] ?? '', url: $value['url'] ?? ''),
×
238
                'requestBody' => new RequestBody(description: $value['description'] ?? '', content: isset($value['content']) ? new \ArrayObject($value['content'] ?? []) : null, required: $value['required'] ?? false),
×
239
                'callbacks' => new \ArrayObject($value ?? []),
×
240
                'responses' => array_map(fn (array $response): Response => new Response(
×
241
                    description: $response['description'] ?? '',
×
242
                    headers: isset($response['headers']) ? new \ArrayObject($response['headers']) : null,
×
243
                    content: isset($response['content']) ? new \ArrayObject($response['content']) : null,
×
244
                    links: isset($response['links']) ? new \ArrayObject($response['links']) : null
×
245
                ), $value),
×
246
                default => $value,
×
247
            };
×
248

249
            if (\in_array($key, $allowedProperties, true)) {
×
250
                continue;
×
251
            }
252

253
            $resource['openapi']['extensionProperties'][$key] = $value;
×
254
            unset($resource['openapi'][$key]);
×
255
        }
256

257
        if (\array_key_exists('parameters', $resource['openapi']) && \is_array($openapiParameters = $resource['openapi']['parameters'] ?? [])) {
×
258
            $parameters = [];
×
259
            foreach ($openapiParameters as $parameter) {
×
260
                $parameters[] = new Parameter(
×
261
                    name: $parameter['name'],
×
262
                    in: $parameter['in'],
×
263
                    description: $parameter['description'] ?? '',
×
264
                    required: $parameter['required'] ?? false,
×
265
                    deprecated: $parameter['deprecated'] ?? false,
×
266
                    allowEmptyValue: $parameter['allowEmptyValue'] ?? false,
×
267
                    schema: $parameter['schema'] ?? [],
×
268
                    style: $parameter['style'] ?? null,
×
269
                    explode: $parameter['explode'] ?? false,
×
270
                    allowReserved: $parameter['allowReserved '] ?? false,
×
271
                    example: $parameter['example'] ?? null,
×
272
                    examples: isset($parameter['examples']) ? new \ArrayObject($parameter['examples']) : null,
×
273
                    content: isset($parameter['content']) ? new \ArrayObject($parameter['content']) : null
×
274
                );
×
275
            }
276
            $resource['openapi']['parameters'] = $parameters;
×
277
        }
278

279
        return new OpenApiOperation(...$resource['openapi']);
×
280
    }
281

282
    /**
283
     * @return bool|string|string[]|null
284
     */
285
    private function buildMercure(array $resource): array|bool|string|null
286
    {
287
        if (!\array_key_exists('mercure', $resource)) {
×
288
            return null;
×
289
        }
290

291
        if (\is_string($resource['mercure'])) {
×
292
            return $this->phpize($resource, 'mercure', 'bool|string');
×
293
        }
294

295
        return $resource['mercure'];
×
296
    }
297

298
    private function buildMessenger(array $resource): bool|array|string|null
299
    {
300
        if (!\array_key_exists('messenger', $resource)) {
×
301
            return null;
×
302
        }
303

304
        return $this->phpize($resource, 'messenger', 'bool|string');
×
305
    }
306

307
    private function buildOperations(array $resource, array $root): ?array
308
    {
309
        if (!\array_key_exists('operations', $resource)) {
×
310
            return null;
×
311
        }
312

313
        $data = [];
×
314
        foreach ($resource['operations'] as $class => $operation) {
×
315
            if (null === $operation) {
×
316
                $operation = [];
×
317
            }
318

319
            if (\array_key_exists('class', $operation)) {
×
320
                if (!\array_key_exists('name', $operation) && \is_string($class)) {
×
321
                    $operation['name'] = $class;
×
322
                }
323
                $class = $operation['class'];
×
324
            }
325

326
            if (empty($class)) {
×
327
                throw new InvalidArgumentException('Missing "class" attribute');
×
328
            }
329

330
            if (!class_exists($class)) {
×
331
                throw new InvalidArgumentException(\sprintf('Operation class "%s" does not exist', $class));
×
332
            }
333

334
            $datum = $this->buildExtendedBase($operation);
×
335
            foreach ($datum as $key => $value) {
×
336
                if (null === $value) {
×
337
                    $datum[$key] = $root[$key];
×
338
                }
339
            }
340

341
            if (\in_array((string) $class, [GetCollection::class, Post::class], true)) {
×
342
                $datum['itemUriTemplate'] = $this->phpize($operation, 'itemUriTemplate', 'string');
×
343
            } elseif (isset($operation['itemUriTemplate'])) {
×
344
                throw new InvalidArgumentException(\sprintf('"itemUriTemplate" option is not allowed on a %s operation.', $class));
×
345
            }
346

347
            $data[] = array_merge($datum, [
×
348
                'read' => $this->phpize($operation, 'read', 'bool'),
×
349
                'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
×
350
                'validate' => $this->phpize($operation, 'validate', 'bool'),
×
351
                'write' => $this->phpize($operation, 'write', 'bool'),
×
352
                'serialize' => $this->phpize($operation, 'serialize', 'bool'),
×
353
                'queryParameterValidate' => $this->phpize($operation, 'queryParameterValidate', 'bool'),
×
354
                'strictQueryParameterValidation' => $this->phpize($operation, 'strictQueryParameterValidation', 'bool'),
×
355
                'hideHydraOperation' => $this->phpize($resource, 'hideHydraOperation', 'bool'),
×
356
                'priority' => $this->phpize($operation, 'priority', 'integer'),
×
357
                'name' => $this->phpize($operation, 'name', 'string'),
×
358
                'class' => (string) $class,
×
359
            ]);
×
360
        }
361

362
        return $data;
×
363
    }
364

365
    private function buildGraphQlOperations(array $resource, array $root): ?array
366
    {
367
        if (!\array_key_exists('graphQlOperations', $resource) || !\is_array($resource['graphQlOperations'])) {
×
368
            return null;
×
369
        }
370

371
        $data = [];
×
372
        foreach ($resource['graphQlOperations'] as $class => $operation) {
×
373
            if (null === $operation) {
×
374
                $operation = [];
×
375
            }
376

377
            if (\array_key_exists('class', $operation)) {
×
378
                if (!\array_key_exists('name', $operation) && \is_string($class)) {
×
379
                    $operation['name'] = $class;
×
380
                }
381
                $class = $operation['class'];
×
382
            }
383

384
            if (empty($class)) {
×
385
                throw new InvalidArgumentException('Missing "class" attribute');
×
386
            }
387

388
            if (!class_exists($class)) {
×
389
                throw new InvalidArgumentException(\sprintf('Operation class "%s" does not exist', $class));
×
390
            }
391

392
            $datum = $this->buildBase($operation);
×
393
            foreach ($datum as $key => $value) {
×
394
                if (null === $value) {
×
395
                    $datum[$key] = $root[$key];
×
396
                }
397
            }
398

399
            $data[] = array_merge($datum, [
×
400
                'resolver' => $this->phpize($operation, 'resolver', 'string'),
×
401
                'args' => $operation['args'] ?? null,
×
402
                'extraArgs' => $operation['extraArgs'] ?? null,
×
403
                'class' => (string) $class,
×
404
                'read' => $this->phpize($operation, 'read', 'bool'),
×
405
                'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
×
406
                'validate' => $this->phpize($operation, 'validate', 'bool'),
×
407
                'write' => $this->phpize($operation, 'write', 'bool'),
×
408
                'serialize' => $this->phpize($operation, 'serialize', 'bool'),
×
409
                'priority' => $this->phpize($operation, 'priority', 'integer'),
×
410
                'name' => $this->phpize($operation, 'name', 'string'),
×
411
            ]);
×
412
        }
413

414
        return $data ?: null;
×
415
    }
416

417
    private function buildStateOptions(array $resource): ?OptionsInterface
418
    {
419
        $stateOptions = $resource['stateOptions'] ?? [];
×
420
        if (!\is_array($stateOptions)) {
×
421
            return null;
×
422
        }
423

424
        if (!$stateOptions) {
×
425
            return null;
×
426
        }
427

428
        $configuration = reset($stateOptions);
×
429
        switch (key($stateOptions)) {
×
430
            case 'elasticsearchOptions':
×
431
                if (class_exists(ElasticsearchOptions::class)) {
×
432
                    return new ElasticsearchOptions($configuration['index'] ?? null);
×
433
                }
434
                break;
×
435
            case 'doctrineOdmOptions':
×
436
                if (class_exists(OdmOptions::class)) {
×
437
                    return new OdmOptions($configuration['documentClass'] ?? null);
×
438
                }
439
                break;
×
440
            case 'doctrineOrmOptions':
×
441
                if (class_exists(OrmOptions::class)) {
×
442
                    return new OrmOptions($configuration['entityClass'] ?? null);
×
443
                }
444
                break;
×
445
        }
446

447
        return null;
×
448
    }
449

450
    /**
451
     * @return Link[]
452
     */
453
    private function buildLinks(array $resource): ?array
454
    {
455
        if (!isset($resource['links']) || !\is_array($resource['links'])) {
×
456
            return null;
×
457
        }
458

459
        $links = [];
×
460
        foreach ($resource['links'] as $link) {
×
461
            $links[] = new Link(rel: $link['rel'], href: $link['href']);
×
462
        }
463

464
        return $links;
×
465
    }
466

467
    /**
468
     * @return array<string, string>
469
     */
470
    private function buildHeaders(array $resource): ?array
471
    {
472
        if (!isset($resource['headers']) || !\is_array($resource['headers'])) {
×
473
            return null;
×
474
        }
475

476
        $headers = [];
×
477
        foreach ($resource['headers'] as $key => $value) {
×
478
            $headers[$key] = $value;
×
479
        }
480

481
        return $headers;
×
482
    }
483

484
    /**
485
     * @return array<string, \ApiPlatform\Metadata\Parameter>
486
     */
487
    private function buildParameters(array $resource): ?array
488
    {
489
        if (!isset($resource['parameters']) || !\is_array($resource['parameters'])) {
×
490
            return null;
×
491
        }
492

493
        $parameters = [];
×
494
        foreach ($resource['parameters'] as $key => $parameter) {
×
495
            $cl = ($parameter['in'] ?? 'query') === 'header' ? HeaderParameter::class : QueryParameter::class;
×
496
            $parameters[$key] = new $cl(
×
497
                key: $key,
×
498
                required: $this->phpize($parameter, 'required', 'bool'),
×
499
                schema: $parameter['schema'] ?? null,
×
500
                openApi: ($parameter['openapi'] ?? null) ? new Parameter(
×
501
                    name: $parameter['openapi']['name'],
×
502
                    in: $parameter['in'] ?? 'query',
×
503
                    description: $parameter['openapi']['description'] ?? '',
×
504
                    required: $parameter['openapi']['required'] ?? $parameter['required'] ?? false,
×
505
                    deprecated: $parameter['openapi']['deprecated'] ?? false,
×
506
                    allowEmptyValue: $parameter['openapi']['allowEmptyValue'] ?? false,
×
507
                    schema: $parameter['openapi']['schema'] ?? $parameter['schema'] ?? [],
×
508
                    style: $parameter['openapi']['style'] ?? null,
×
509
                    explode: $parameter['openapi']['explode'] ?? false,
×
510
                    allowReserved: $parameter['openapi']['allowReserved '] ?? false,
×
511
                    example: $parameter['openapi']['example'] ?? null,
×
512
                    examples: isset($parameter['openapi']['examples']) ? new \ArrayObject($parameter['openapi']['examples']) : null,
×
513
                    content: isset($parameter['openapi']['content']) ? new \ArrayObject($parameter['openapi']['content']) : null
×
514
                ) : null,
×
515
                provider: $this->phpize($parameter, 'provider', 'string'),
×
516
                filter: $this->phpize($parameter, 'filter', 'string'),
×
517
                property: $this->phpize($parameter, 'property', 'string'),
×
518
                description: $this->phpize($parameter, 'description', 'string'),
×
519
                priority: $this->phpize($parameter, 'priority', 'integer'),
×
520
                extraProperties: $this->buildArrayValue($parameter, 'extraProperties') ?? [],
×
521
            );
×
522
        }
523

524
        return $parameters;
×
525
    }
526
}
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