1 | <?php |
||
2 | |||
3 | |||
4 | namespace Apie\OpenapiSchema\Spec; |
||
5 | |||
6 | use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension; |
||
7 | use Apie\OpenapiSchema\Contract\InfoContract; |
||
8 | use Apie\OpenapiSchema\Map\SecurityRequirementList; |
||
9 | use Apie\OpenapiSchema\Map\ServerList; |
||
10 | use Apie\OpenapiSchema\Map\TagList; |
||
11 | use Apie\OpenapiSchema\ValueObjects\OpenApiVersion; |
||
12 | use Apie\ValueObjects\ValueObjectInterface; |
||
13 | |||
14 | /** |
||
15 | * @see https://swagger.io/specification/#openapi-object |
||
16 | */ |
||
17 | final class Document implements ValueObjectInterface |
||
18 | { |
||
19 | use CompositeValueObjectWithExtension; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
20 | |||
21 | /** |
||
22 | * @var OpenApiVersion |
||
23 | */ |
||
24 | private $openapi; |
||
25 | |||
26 | /** |
||
27 | * @var InfoContract|Info |
||
28 | */ |
||
29 | private $info; |
||
30 | |||
31 | /** |
||
32 | * @var ServerList|null |
||
33 | */ |
||
34 | private $servers; |
||
0 ignored issues
–
show
|
|||
35 | |||
36 | /** |
||
37 | * @var Paths |
||
38 | */ |
||
39 | private $paths; |
||
40 | |||
41 | /** |
||
42 | * @var Components|null |
||
43 | */ |
||
44 | private $components; |
||
45 | |||
46 | /** |
||
47 | * @var SecurityRequirementList|null |
||
48 | */ |
||
49 | private $security; |
||
0 ignored issues
–
show
|
|||
50 | |||
51 | /** |
||
52 | * @var TagList|null |
||
53 | */ |
||
54 | private $tags; |
||
0 ignored issues
–
show
|
|||
55 | |||
56 | /** |
||
57 | * @var ExternalDocs|null |
||
58 | */ |
||
59 | private $externalDocs; |
||
0 ignored issues
–
show
|
|||
60 | |||
61 | public function __construct(InfoContract $info, Paths $paths) |
||
62 | { |
||
63 | $this->openapi = new OpenApiVersion(''); |
||
64 | $this->info = $info; |
||
65 | $this->paths = $paths; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return Paths |
||
70 | */ |
||
71 | public function getPaths(): Paths |
||
72 | { |
||
73 | return $this->paths; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return Components|null |
||
78 | */ |
||
79 | public function getComponents(): ?Components |
||
80 | { |
||
81 | return $this->components; |
||
82 | } |
||
83 | } |
||
84 |