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

api-platform / core / 15775135891

20 Jun 2025 08:42AM UTC coverage: 22.065% (+0.2%) from 21.876%
15775135891

push

github

soyuka
Merge 4.1

13 of 103 new or added lines in 10 files covered. (12.62%)

868 existing lines in 35 files now uncovered.

11487 of 52060 relevant lines covered (22.06%)

21.72 hits per line

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

58.89
/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\Elasticsearch\State\Options;
17
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
18
use ApiPlatform\Metadata\GetCollection;
19
use ApiPlatform\Metadata\HeaderParameter;
20
use ApiPlatform\Metadata\Post;
21
use ApiPlatform\Metadata\QueryParameter;
22
use ApiPlatform\OpenApi\Model\ExternalDocumentation;
23
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
24
use ApiPlatform\OpenApi\Model\Parameter;
25
use ApiPlatform\OpenApi\Model\RequestBody;
26
use ApiPlatform\State\OptionsInterface;
27
use Symfony\Component\WebLink\Link;
28
use Symfony\Component\Yaml\Exception\ParseException;
29
use Symfony\Component\Yaml\Yaml;
30

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

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

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

56
        if (null === $resourcesYaml = $resourcesYaml['resources'] ?? $resourcesYaml) {
98✔
57
            return;
×
58
        }
59

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

64
        $this->buildResources($resourcesYaml, $path);
98✔
65
    }
66

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

72
            if (null === $resourceYaml) {
98✔
73
                $resourceYaml = [[]];
98✔
74
            }
75

76
            if (!\array_key_exists(0, $resourceYaml)) {
98✔
77
                $resourceYaml = [$resourceYaml];
98✔
78
            }
79

80
            foreach ($resourceYaml as $key => $resourceYamlDatum) {
98✔
81
                if (null === $resourceYamlDatum) {
98✔
82
                    $resourceYamlDatum = [];
98✔
83
                }
84

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

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

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

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

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

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

216
        return $uriVariables;
98✔
217
    }
218

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

225
        if (!\is_array($resource['openapi'])) {
98✔
UNCOV
226
            return $this->phpize($resource, 'openapi', 'bool');
×
227
        }
228

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

238
            if (\in_array($key, $allowedProperties, true)) {
98✔
UNCOV
239
                continue;
×
240
            }
241

242
            $resource['openapi']['extensionProperties'][$key] = $value;
98✔
243
            unset($resource['openapi'][$key]);
98✔
244
        }
245

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

268
        return new OpenApiOperation(...$resource['openapi']);
98✔
269
    }
270

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

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

UNCOV
284
        return $resource['mercure'];
×
285
    }
286

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

UNCOV
293
        return $this->phpize($resource, 'messenger', 'bool|string');
×
294
    }
295

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

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

308
            if (\array_key_exists('class', $operation)) {
98✔
UNCOV
309
                if (!\array_key_exists('name', $operation) && \is_string($class)) {
×
310
                    $operation['name'] = $class;
×
311
                }
UNCOV
312
                $class = $operation['class'];
×
313
            }
314

315
            if (empty($class)) {
98✔
UNCOV
316
                throw new InvalidArgumentException('Missing "class" attribute');
×
317
            }
318

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

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

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

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

351
        return $data;
98✔
352
    }
353

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

360
        $data = [];
98✔
361
        foreach ($resource['graphQlOperations'] as $class => $operation) {
98✔
UNCOV
362
            if (null === $operation) {
×
363
                $operation = [];
×
364
            }
365

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

UNCOV
373
            if (empty($class)) {
×
374
                throw new InvalidArgumentException('Missing "class" attribute');
×
375
            }
376

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

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

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

403
        return $data ?: null;
98✔
404
    }
405

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

413
        if (!$stateOptions) {
98✔
414
            return null;
98✔
415
        }
416

UNCOV
417
        $configuration = reset($stateOptions);
×
418
        switch (key($stateOptions)) {
×
419
            case 'elasticsearchOptions':
×
420
                if (class_exists(Options::class)) {
×
421
                    return new Options($configuration['index'] ?? null);
×
422
                }
423
        }
424

UNCOV
425
        return null;
×
426
    }
427

428
    /**
429
     * @return Link[]
430
     */
431
    private function buildLinks(array $resource): ?array
432
    {
433
        if (!isset($resource['links']) || !\is_array($resource['links'])) {
98✔
434
            return null;
98✔
435
        }
436

UNCOV
437
        $links = [];
×
438
        foreach ($resource['links'] as $link) {
×
439
            $links[] = new Link(rel: $link['rel'], href: $link['href']);
×
440
        }
441

UNCOV
442
        return $links;
×
443
    }
444

445
    /**
446
     * @return array<string, string>
447
     */
448
    private function buildHeaders(array $resource): ?array
449
    {
450
        if (!isset($resource['headers']) || !\is_array($resource['headers'])) {
98✔
451
            return null;
98✔
452
        }
453

UNCOV
454
        $headers = [];
×
455
        foreach ($resource['headers'] as $key => $value) {
×
456
            $headers[$key] = $value;
×
457
        }
458

UNCOV
459
        return $headers;
×
460
    }
461

462
    /**
463
     * @return array<string, \ApiPlatform\Metadata\Parameter>
464
     */
465
    private function buildParameters(array $resource): ?array
466
    {
467
        if (!isset($resource['parameters']) || !\is_array($resource['parameters'])) {
98✔
468
            return null;
98✔
469
        }
470

UNCOV
471
        $parameters = [];
×
472
        foreach ($resource['parameters'] as $key => $parameter) {
×
473
            $cl = ($parameter['in'] ?? 'query') === 'header' ? HeaderParameter::class : QueryParameter::class;
×
474
            $parameters[$key] = new $cl(
×
475
                key: $key,
×
476
                required: $this->phpize($parameter, 'required', 'bool'),
×
477
                schema: $parameter['schema'] ?? null,
×
478
                openApi: ($parameter['openapi'] ?? null) ? new Parameter(
×
479
                    name: $parameter['openapi']['name'],
×
480
                    in: $parameter['in'] ?? 'query',
×
481
                    description: $parameter['openapi']['description'] ?? '',
×
482
                    required: $parameter['openapi']['required'] ?? $parameter['required'] ?? false,
×
483
                    deprecated: $parameter['openapi']['deprecated'] ?? false,
×
484
                    allowEmptyValue: $parameter['openapi']['allowEmptyValue'] ?? false,
×
485
                    schema: $parameter['openapi']['schema'] ?? $parameter['schema'] ?? [],
×
486
                    style: $parameter['openapi']['style'] ?? null,
×
487
                    explode: $parameter['openapi']['explode'] ?? false,
×
488
                    allowReserved: $parameter['openapi']['allowReserved '] ?? false,
×
489
                    example: $parameter['openapi']['example'] ?? null,
×
490
                    examples: isset($parameter['openapi']['examples']) ? new \ArrayObject($parameter['openapi']['examples']) : null,
×
491
                    content: isset($parameter['openapi']['content']) ? new \ArrayObject($parameter['openapi']['content']) : null
×
492
                ) : null,
×
493
                provider: $this->phpize($parameter, 'provider', 'string'),
×
494
                filter: $this->phpize($parameter, 'filter', 'string'),
×
495
                property: $this->phpize($parameter, 'property', 'string'),
×
496
                description: $this->phpize($parameter, 'description', 'string'),
×
497
                priority: $this->phpize($parameter, 'priority', 'integer'),
×
498
                extraProperties: $this->buildArrayValue($parameter, 'extraProperties') ?? [],
×
499
            );
×
500
        }
501

UNCOV
502
        return $parameters;
×
503
    }
504
}
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