| 1 |
<?php declare(strict_types=1); |
| 2 |
/** |
| 3 |
* @license Apache 2.0 |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace OpenApi\Attributes; |
| 7 |
|
| 8 |
use OpenApi\Annotations as OA; |
| 9 |
use OpenApi\Generator; |
| 10 |
|
| 11 |
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] |
| 12 |
class Header extends OA\Header |
| 13 |
{ |
| 14 |
/** |
| 15 |
* @param string|class-string|object|null $ref |
| 16 |
* @param array<string,mixed>|null $x |
| 17 |
* @param list<Attachable>|null $attachables |
| 18 |
*/ |
| 19 |
public function __construct( |
| 20 |
string|object|null $ref = null, |
| 21 |
?string $header = null, |
| 22 |
?string $description = Generator::UNDEFINED, |
| 23 |
?bool $required = null, |
| 24 |
?Schema $schema = null, |
| 25 |
?bool $deprecated = null, |
| 26 |
?bool $allowEmptyValue = null, |
| 27 |
|
| 28 |
// abstract annotation |
| 29 |
?array $x = null, |
| 30 |
?array $attachables = null |
| 31 |
) { |
| 32 |
parent::__construct([ |
| 33 |
'ref' => $ref ?? Generator::UNDEFINED, |
| 34 |
'header' => $header ?? Generator::UNDEFINED, |
| 35 |
'description' => $description, |
| 36 |
'required' => $required ?? Generator::UNDEFINED, |
| 37 |
'deprecated' => $deprecated ?? Generator::UNDEFINED, |
| 38 |
'allowEmptyValue' => $allowEmptyValue ?? Generator::UNDEFINED, |
| 39 |
'x' => $x ?? Generator::UNDEFINED, |
| 40 |
'attachables' => $attachables ?? Generator::UNDEFINED, |
| 41 |
'value' => $this->combine($schema), |
| 42 |
]); |
| 43 |
} |
| 44 |
} |