|
| 1 | +<?php declare(strict_types=1); |
| 2 | + |
| 3 | +/** |
| 4 | + * @license Apache 2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +namespace OpenApi\Attributes; |
| 8 | + |
| 9 | +use OpenApi\Annotations as OA; |
| 10 | +use OpenApi\Generator; |
| 11 | + |
| 12 | +#[\Attribute(\Attribute::TARGET_CLASS)] |
| 13 | +class Encoding extends OA\Encoding |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @param Header[] $headers |
| 17 | + * @param array<string,mixed>|null $x |
| 18 | + * @param Attachable[]|null $attachables |
| 19 | + */ |
| 20 | + public function __construct( |
| 21 | + ?string $property = null, |
| 22 | + ?string $contentType = null, |
| 23 | + ?array $headers = null, |
| 24 | + ?string $style = null, |
| 25 | + ?bool $explode = null, |
| 26 | + ?bool $allowReserved = null, |
| 27 | + // annotation |
| 28 | + ?array $x = null, |
| 29 | + ?array $attachables = null |
| 30 | + ) { |
| 31 | + parent::__construct([ |
| 32 | + 'property' => $property ?? Generator::UNDEFINED, |
| 33 | + 'contentType' => $contentType ?? Generator::UNDEFINED, |
| 34 | + 'style' => $style ?? Generator::UNDEFINED, |
| 35 | + 'explode' => $explode ?? Generator::UNDEFINED, |
| 36 | + 'allowReserved' => $allowReserved ?? Generator::UNDEFINED, |
| 37 | + 'x' => $x ?? Generator::UNDEFINED, |
| 38 | + 'attachables' => $attachables ?? Generator::UNDEFINED, |
| 39 | + 'value' => $this->combine($headers), |
| 40 | + ]); |
| 41 | + } |
| 42 | +} |
0 commit comments