Debian Codegraph @

vendor/zircote/swagger-php/src/Attributes/Response.php

raw
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::IS_REPEATABLE)]
13 class Response extends OA\Response
14 {
15 /**
16 * @param string|class-string|object|null $ref
17 * @param list<Header> $headers
18 * @param MediaType|JsonContent|XmlContent|Attachable|array<MediaType|JsonContent|XmlContent|Attachable> $content
19 * @param list<Link> $links
20 * @param array<string,mixed>|null $x
21 * @param list<Attachable>|null $attachables
22 */
23 public function __construct(
24 string|object|null $ref = null,
25 int|string|null $response = null,
26 ?string $description = Generator::UNDEFINED,
27 ?array $headers = null,
28 MediaType|JsonContent|XmlContent|Attachable|array|null $content = null,
29 ?array $links = null,
30
31 // abstract annotation
32 ?array $x = null,
33 ?array $attachables = null
34 ) {
35 parent::__construct([
36 'ref' => $ref ?? Generator::UNDEFINED,
37 'response' => $response ?? Generator::UNDEFINED,
38 'description' => $description,
39 'x' => $x ?? Generator::UNDEFINED,
40 'attachables' => $attachables ?? Generator::UNDEFINED,
41 'value' => $this->combine($headers, $content, $links),
42 ]);
43 }
44 }