| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
/** |
| 4 |
* @license Apache 2.0 |
| 5 |
*/ |
| 6 |
|
| 7 |
namespace OpenApi\Annotations; |
| 8 |
|
| 9 |
/** |
| 10 |
* A container for custom data to be attached to an annotation. |
| 11 |
* |
| 12 |
* These will be ignored by `swagger-php` but can be used for custom processing. |
| 13 |
* |
| 14 |
* @Annotation |
| 15 |
*/ |
| 16 |
class Attachable extends AbstractAnnotation |
| 17 |
{ |
| 18 |
/** |
| 19 |
* @inheritdoc |
| 20 |
*/ |
| 21 |
public static $_parents = [ |
| 22 |
AdditionalProperties::class, |
| 23 |
Components::class, |
| 24 |
Contact::class, |
| 25 |
Delete::class, |
| 26 |
Discriminator::class, |
| 27 |
Encoding::class, |
| 28 |
Examples::class, |
| 29 |
ExternalDocumentation::class, |
| 30 |
Flow::class, |
| 31 |
Get::class, |
| 32 |
Head::class, |
| 33 |
Header::class, |
| 34 |
Info::class, |
| 35 |
Items::class, |
| 36 |
JsonContent::class, |
| 37 |
License::class, |
| 38 |
Link::class, |
| 39 |
MediaType::class, |
| 40 |
OpenApi::class, |
| 41 |
Operation::class, |
| 42 |
Options::class, |
| 43 |
Parameter::class, |
| 44 |
Patch::class, |
| 45 |
PathItem::class, |
| 46 |
PathParameter::class, |
| 47 |
Post::class, |
| 48 |
Property::class, |
| 49 |
Put::class, |
| 50 |
RequestBody::class, |
| 51 |
Response::class, |
| 52 |
Schema::class, |
| 53 |
SecurityScheme::class, |
| 54 |
Server::class, |
| 55 |
ServerVariable::class, |
| 56 |
Tag::class, |
| 57 |
Trace::class, |
| 58 |
Webhook::class, |
| 59 |
Xml::class, |
| 60 |
XmlContent::class, |
| 61 |
]; |
| 62 |
|
| 63 |
/** |
| 64 |
* Allows to type-hint a specific parent annotation class. |
| 65 |
* |
| 66 |
* Container to allow custom annotations that are limited to a subset of potential parent |
| 67 |
* annotation classes. |
| 68 |
* |
| 69 |
* @return array<class-string>|null List of valid parent annotation classes. If <code>null</code>, the default nesting rules apply. |
| 70 |
*/ |
| 71 |
public function allowedParents(): ?array |
| 72 |
{ |
| 73 |
return null; |
| 74 |
} |
| 75 |
} |