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

api-platform / core / 16050929464

03 Jul 2025 12:51PM UTC coverage: 22.065% (+0.2%) from 21.821%
16050929464

push

github

soyuka
chore: todo improvement

11516 of 52192 relevant lines covered (22.06%)

22.08 hits per line

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

57.09
/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\State\OptionsInterface;
29
use Symfony\Component\WebLink\Link;
30
use Symfony\Component\Yaml\Exception\ParseException;
31
use Symfony\Component\Yaml\Yaml;
32

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

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

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

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

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

66
        $this->buildResources($resourcesYaml, $path);
102✔
67
    }
68

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

74
            if (null === $resourceYaml) {
102✔
75
                $resourceYaml = [[]];
102✔
76
            }
77

78
            if (!\array_key_exists(0, $resourceYaml)) {
102✔
79
                $resourceYaml = [$resourceYaml];
102✔
80
            }
81

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

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

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

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

177
    private function buildUriVariables(array $resource): ?array
178
    {
179
        if (!\array_key_exists('uriVariables', $resource)) {
102✔
180
            return null;
102✔
181
        }
182

183
        $uriVariables = [];
102✔
184
        foreach ($resource['uriVariables'] as $parameterName => $data) {
102✔
185
            if (\is_string($data)) {
102✔
186
                $uriVariables[$data] = $data;
×
187
                continue;
×
188
            }
189

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

218
        return $uriVariables;
102✔
219
    }
220

221
    private function buildOpenapi(array $resource): bool|OpenApiOperation|null
222
    {
223
        if (!\array_key_exists('openapi', $resource)) {
102✔
224
            return null;
102✔
225
        }
226

227
        if (!\is_array($resource['openapi'])) {
102✔
228
            return $this->phpize($resource, 'openapi', 'bool');
×
229
        }
230

231
        $allowedProperties = array_map(fn (\ReflectionProperty $reflProperty): string => $reflProperty->getName(), (new \ReflectionClass(OpenApiOperation::class))->getProperties());
102✔
232
        foreach ($resource['openapi'] as $key => $value) {
102✔
233
            $resource['openapi'][$key] = match ($key) {
102✔
234
                'externalDocs' => new ExternalDocumentation(description: $value['description'] ?? '', url: $value['url'] ?? ''),
×
235
                'requestBody' => new RequestBody(description: $value['description'] ?? '', content: isset($value['content']) ? new \ArrayObject($value['content'] ?? []) : null, required: $value['required'] ?? false),
×
236
                'callbacks' => new \ArrayObject($value ?? []),
×
237
                default => $value,
102✔
238
            };
102✔
239

240
            if (\in_array($key, $allowedProperties, true)) {
102✔
241
                continue;
×
242
            }
243

244
            $resource['openapi']['extensionProperties'][$key] = $value;
102✔
245
            unset($resource['openapi'][$key]);
102✔
246
        }
247

248
        if (\array_key_exists('parameters', $resource['openapi']) && \is_array($openapiParameters = $resource['openapi']['parameters'] ?? [])) {
102✔
249
            $parameters = [];
×
250
            foreach ($openapiParameters as $parameter) {
×
251
                $parameters[] = new Parameter(
×
252
                    name: $parameter['name'],
×
253
                    in: $parameter['in'],
×
254
                    description: $parameter['description'] ?? '',
×
255
                    required: $parameter['required'] ?? false,
×
256
                    deprecated: $parameter['deprecated'] ?? false,
×
257
                    allowEmptyValue: $parameter['allowEmptyValue'] ?? false,
×
258
                    schema: $parameter['schema'] ?? [],
×
259
                    style: $parameter['style'] ?? null,
×
260
                    explode: $parameter['explode'] ?? false,
×
261
                    allowReserved: $parameter['allowReserved '] ?? false,
×
262
                    example: $parameter['example'] ?? null,
×
263
                    examples: isset($parameter['examples']) ? new \ArrayObject($parameter['examples']) : null,
×
264
                    content: isset($parameter['content']) ? new \ArrayObject($parameter['content']) : null
×
265
                );
×
266
            }
267
            $resource['openapi']['parameters'] = $parameters;
×
268
        }
269

270
        return new OpenApiOperation(...$resource['openapi']);
102✔
271
    }
272

273
    /**
274
     * @return bool|string|string[]|null
275
     */
276
    private function buildMercure(array $resource): array|bool|string|null
277
    {
278
        if (!\array_key_exists('mercure', $resource)) {
102✔
279
            return null;
102✔
280
        }
281

282
        if (\is_string($resource['mercure'])) {
×
283
            return $this->phpize($resource, 'mercure', 'bool|string');
×
284
        }
285

286
        return $resource['mercure'];
×
287
    }
288

289
    private function buildMessenger(array $resource): bool|array|string|null
290
    {
291
        if (!\array_key_exists('messenger', $resource)) {
102✔
292
            return null;
102✔
293
        }
294

295
        return $this->phpize($resource, 'messenger', 'bool|string');
×
296
    }
297

298
    private function buildOperations(array $resource, array $root): ?array
299
    {
300
        if (!\array_key_exists('operations', $resource)) {
102✔
301
            return null;
102✔
302
        }
303

304
        $data = [];
102✔
305
        foreach ($resource['operations'] as $class => $operation) {
102✔
306
            if (null === $operation) {
102✔
307
                $operation = [];
102✔
308
            }
309

310
            if (\array_key_exists('class', $operation)) {
102✔
311
                if (!\array_key_exists('name', $operation) && \is_string($class)) {
×
312
                    $operation['name'] = $class;
×
313
                }
314
                $class = $operation['class'];
×
315
            }
316

317
            if (empty($class)) {
102✔
318
                throw new InvalidArgumentException('Missing "class" attribute');
×
319
            }
320

321
            if (!class_exists($class)) {
102✔
322
                throw new InvalidArgumentException(\sprintf('Operation class "%s" does not exist', $class));
×
323
            }
324

325
            $datum = $this->buildExtendedBase($operation);
102✔
326
            foreach ($datum as $key => $value) {
102✔
327
                if (null === $value) {
102✔
328
                    $datum[$key] = $root[$key];
102✔
329
                }
330
            }
331

332
            if (\in_array((string) $class, [GetCollection::class, Post::class], true)) {
102✔
333
                $datum['itemUriTemplate'] = $this->phpize($operation, 'itemUriTemplate', 'string');
102✔
334
            } elseif (isset($operation['itemUriTemplate'])) {
102✔
335
                throw new InvalidArgumentException(\sprintf('"itemUriTemplate" option is not allowed on a %s operation.', $class));
×
336
            }
337

338
            $data[] = array_merge($datum, [
102✔
339
                'read' => $this->phpize($operation, 'read', 'bool'),
102✔
340
                'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
102✔
341
                'validate' => $this->phpize($operation, 'validate', 'bool'),
102✔
342
                'write' => $this->phpize($operation, 'write', 'bool'),
102✔
343
                'serialize' => $this->phpize($operation, 'serialize', 'bool'),
102✔
344
                'queryParameterValidate' => $this->phpize($operation, 'queryParameterValidate', 'bool'),
102✔
345
                'strictQueryParameterValidation' => $this->phpize($operation, 'strictQueryParameterValidation', 'bool'),
102✔
346
                'hideHydraOperation' => $this->phpize($resource, 'hideHydraOperation', 'bool'),
102✔
347
                'priority' => $this->phpize($operation, 'priority', 'integer'),
102✔
348
                'name' => $this->phpize($operation, 'name', 'string'),
102✔
349
                'class' => (string) $class,
102✔
350
            ]);
102✔
351
        }
352

353
        return $data;
102✔
354
    }
355

356
    private function buildGraphQlOperations(array $resource, array $root): ?array
357
    {
358
        if (!\array_key_exists('graphQlOperations', $resource) || !\is_array($resource['graphQlOperations'])) {
102✔
359
            return null;
102✔
360
        }
361

362
        $data = [];
102✔
363
        foreach ($resource['graphQlOperations'] as $class => $operation) {
102✔
364
            if (null === $operation) {
×
365
                $operation = [];
×
366
            }
367

368
            if (\array_key_exists('class', $operation)) {
×
369
                if (!\array_key_exists('name', $operation) && \is_string($class)) {
×
370
                    $operation['name'] = $class;
×
371
                }
372
                $class = $operation['class'];
×
373
            }
374

375
            if (empty($class)) {
×
376
                throw new InvalidArgumentException('Missing "class" attribute');
×
377
            }
378

379
            if (!class_exists($class)) {
×
380
                throw new InvalidArgumentException(\sprintf('Operation class "%s" does not exist', $class));
×
381
            }
382

383
            $datum = $this->buildBase($operation);
×
384
            foreach ($datum as $key => $value) {
×
385
                if (null === $value) {
×
386
                    $datum[$key] = $root[$key];
×
387
                }
388
            }
389

390
            $data[] = array_merge($datum, [
×
391
                'resolver' => $this->phpize($operation, 'resolver', 'string'),
×
392
                'args' => $operation['args'] ?? null,
×
393
                'extraArgs' => $operation['extraArgs'] ?? null,
×
394
                'class' => (string) $class,
×
395
                'read' => $this->phpize($operation, 'read', 'bool'),
×
396
                'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
×
397
                'validate' => $this->phpize($operation, 'validate', 'bool'),
×
398
                'write' => $this->phpize($operation, 'write', 'bool'),
×
399
                'serialize' => $this->phpize($operation, 'serialize', 'bool'),
×
400
                'priority' => $this->phpize($operation, 'priority', 'integer'),
×
401
                'name' => $this->phpize($operation, 'name', 'string'),
×
402
            ]);
×
403
        }
404

405
        return $data ?: null;
102✔
406
    }
407

408
    private function buildStateOptions(array $resource): ?OptionsInterface
409
    {
410
        $stateOptions = $resource['stateOptions'] ?? [];
102✔
411
        if (!\is_array($stateOptions)) {
102✔
412
            return null;
×
413
        }
414

415
        if (!$stateOptions) {
102✔
416
            return null;
102✔
417
        }
418

419
        $configuration = reset($stateOptions);
×
420
        switch (key($stateOptions)) {
×
421
            case 'elasticsearchOptions':
×
422
                if (class_exists(ElasticsearchOptions::class)) {
×
423
                    return new ElasticsearchOptions($configuration['index'] ?? null);
×
424
                }
425
                break;
×
426
            case 'doctrineOdmOptions':
×
427
                if (class_exists(OdmOptions::class)) {
×
428
                    return new OdmOptions($configuration['documentClass'] ?? null);
×
429
                }
430
                break;
×
431
            case 'doctrineOrmOptions':
×
432
                if (class_exists(OrmOptions::class)) {
×
433
                    return new OrmOptions($configuration['entityClass'] ?? null);
×
434
                }
435
                break;
×
436
        }
437

438
        return null;
×
439
    }
440

441
    /**
442
     * @return Link[]
443
     */
444
    private function buildLinks(array $resource): ?array
445
    {
446
        if (!isset($resource['links']) || !\is_array($resource['links'])) {
102✔
447
            return null;
102✔
448
        }
449

450
        $links = [];
×
451
        foreach ($resource['links'] as $link) {
×
452
            $links[] = new Link(rel: $link['rel'], href: $link['href']);
×
453
        }
454

455
        return $links;
×
456
    }
457

458
    /**
459
     * @return array<string, string>
460
     */
461
    private function buildHeaders(array $resource): ?array
462
    {
463
        if (!isset($resource['headers']) || !\is_array($resource['headers'])) {
102✔
464
            return null;
102✔
465
        }
466

467
        $headers = [];
×
468
        foreach ($resource['headers'] as $key => $value) {
×
469
            $headers[$key] = $value;
×
470
        }
471

472
        return $headers;
×
473
    }
474

475
    /**
476
     * @return array<string, \ApiPlatform\Metadata\Parameter>
477
     */
478
    private function buildParameters(array $resource): ?array
479
    {
480
        if (!isset($resource['parameters']) || !\is_array($resource['parameters'])) {
102✔
481
            return null;
102✔
482
        }
483

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

515
        return $parameters;
×
516
    }
517
}
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