| 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 | \Attribute::TARGET_METHOD)] |
| 13 |
class Link extends OA\Link |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @param string|class-string|object|null $ref |
| 17 |
* @param array<string,mixed> $parameters |
| 18 |
* @param array<string,mixed>|null $x |
| 19 |
* @param list<Attachable>|null $attachables |
| 20 |
*/ |
| 21 |
public function __construct( |
| 22 |
?string $link = null, |
| 23 |
?string $operationRef = null, |
| 24 |
string|object|null $ref = null, |
| 25 |
?string $operationId = null, |
| 26 |
?array $parameters = null, |
| 27 |
mixed $requestBody = null, |
| 28 |
?string $description = Generator::UNDEFINED, |
| 29 |
?Server $server = null, |
| 30 |
|
| 31 |
// abstract annotation |
| 32 |
?array $x = null, |
| 33 |
?array $attachables = null |
| 34 |
) { |
| 35 |
parent::__construct([ |
| 36 |
'link' => $link ?? Generator::UNDEFINED, |
| 37 |
'operationRef' => $operationRef ?? Generator::UNDEFINED, |
| 38 |
'ref' => $ref ?? Generator::UNDEFINED, |
| 39 |
'operationId' => $operationId ?? Generator::UNDEFINED, |
| 40 |
'parameters' => $parameters ?? Generator::UNDEFINED, |
| 41 |
'requestBody' => $requestBody ?? Generator::UNDEFINED, |
| 42 |
'description' => $description, |
| 43 |
'x' => $x ?? Generator::UNDEFINED, |
| 44 |
'attachables' => $attachables ?? Generator::UNDEFINED, |
| 45 |
'value' => $this->combine($server), |
| 46 |
]); |
| 47 |
} |
| 48 |
} |