| 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 | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] |
| 13 |
class SecurityScheme extends OA\SecurityScheme |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @param string|class-string|object|null $ref |
| 17 |
* @param string|non-empty-array<string>|null $type |
| 18 |
* @param list<Flow> $flows |
| 19 |
* @param array<string,mixed>|null $x |
| 20 |
* @param list<Attachable>|null $attachables |
| 21 |
*/ |
| 22 |
public function __construct( |
| 23 |
string|object|null $ref = null, |
| 24 |
?string $securityScheme = null, |
| 25 |
string|array|null $type = null, |
| 26 |
?string $description = Generator::UNDEFINED, |
| 27 |
?string $name = null, |
| 28 |
?string $in = null, |
| 29 |
?string $bearerFormat = null, |
| 30 |
?string $scheme = null, |
| 31 |
?string $openIdConnectUrl = null, |
| 32 |
?array $flows = null, |
| 33 |
|
| 34 |
// abstract annotation |
| 35 |
?array $x = null, |
| 36 |
?array $attachables = null |
| 37 |
) { |
| 38 |
parent::__construct([ |
| 39 |
'ref' => $ref ?? Generator::UNDEFINED, |
| 40 |
'securityScheme' => $securityScheme ?? Generator::UNDEFINED, |
| 41 |
'type' => $type ?? Generator::UNDEFINED, |
| 42 |
'description' => $description, |
| 43 |
'name' => $name ?? Generator::UNDEFINED, |
| 44 |
'in' => $in ?? Generator::UNDEFINED, |
| 45 |
'bearerFormat' => $bearerFormat ?? Generator::UNDEFINED, |
| 46 |
'scheme' => $scheme ?? Generator::UNDEFINED, |
| 47 |
'openIdConnectUrl' => $openIdConnectUrl ?? Generator::UNDEFINED, |
| 48 |
'x' => $x ?? Generator::UNDEFINED, |
| 49 |
'attachables' => $attachables ?? Generator::UNDEFINED, |
| 50 |
'value' => $this->combine($flows), |
| 51 |
]); |
| 52 |
} |
| 53 |
} |