1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* This file is part of phpDocumentor. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @link https://phpdoc.org |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace phpDocumentor\Configuration; |
15
|
|
|
|
16
|
|
|
use phpDocumentor\Dsn; |
17
|
|
|
use phpDocumentor\Path; |
18
|
|
|
|
19
|
|
|
class VersionSpecification |
20
|
|
|
{ |
21
|
|
|
/** @var string */ |
22
|
|
|
private $number; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var array< |
26
|
|
|
* int, |
27
|
|
|
* array{ |
28
|
|
|
* source: array{dsn: Dsn, paths: array<Path>}, |
29
|
|
|
* output?: string, |
30
|
|
|
* ignore?: array{paths: non-empty-array<Path>}, |
31
|
|
|
* extensions?: non-empty-list<string>, |
32
|
|
|
* visibility?: array<string>, |
33
|
|
|
* default-package-name?: string, |
34
|
|
|
* include-source?: bool, |
35
|
|
|
* markers?: non-empty-list<string>, |
36
|
|
|
* ignore-tags?: non-empty-list<string>, |
37
|
|
|
* examples?: array{dsn: Dsn, paths: list<string>}, |
38
|
|
|
* encoding?: string, |
39
|
|
|
* validate?: bool |
40
|
|
|
* }> |
41
|
|
|
*/ |
42
|
|
|
public $api; |
43
|
|
|
|
44
|
|
|
/** @var array<mixed>|null */ |
45
|
|
|
public $guides; |
46
|
|
|
|
47
|
|
|
//phpcs:disable Squiz.Commenting.FunctionComment.MissingParamName squizlabs/PHP_CodeSniffer/issues/2591 |
48
|
|
|
/** |
49
|
|
|
* @param array< |
50
|
|
|
* int, |
51
|
|
|
* array{ |
52
|
|
|
* source: array{dsn: Dsn, paths: array<Path>}, |
53
|
|
|
* output?: string, |
54
|
|
|
* ignore?: array{paths: non-empty-array<Path>}, |
55
|
|
|
* extensions?: non-empty-list<string>, |
56
|
|
|
* visibility?: array<string>, |
57
|
|
|
* default-package-name?: string, |
58
|
|
|
* include-source?: bool, |
59
|
|
|
* markers?: non-empty-list<string>, |
60
|
|
|
* ignore-tags?: non-empty-list<string>, |
61
|
|
|
* examples?: array{dsn: Dsn, paths: list<string>} |
62
|
|
|
* }> $api |
63
|
|
|
* @param array<mixed>|null $guides |
64
|
|
|
*/ |
65
|
|
|
//phpcs:enable Squiz.Commenting.FunctionComment.MissingParamName |
66
|
|
|
public function __construct(string $number, array $api, ?array $guides) |
67
|
|
|
{ |
68
|
|
|
$this->number = $number; |
69
|
|
|
$this->api = $api; |
70
|
|
|
$this->guides = $guides; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function getNumber() : string |
74
|
|
|
{ |
75
|
|
|
return $this->number; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return array< |
|
|
|
|
80
|
|
|
* int, |
81
|
|
|
* array{ |
82
|
|
|
* source: array{dsn: Dsn, paths: array<Path>}, |
83
|
|
|
* output?: string, |
84
|
|
|
* ignore?: array{paths: non-empty-array<Path>}, |
85
|
|
|
* extensions?: non-empty-list<string>, |
86
|
|
|
* visibility?: array<string>, |
87
|
|
|
* default-package-name?: string, |
88
|
|
|
* include-source?: bool, |
89
|
|
|
* markers?: non-empty-list<string>, |
90
|
|
|
* ignore-tags?: non-empty-list<string>, |
91
|
|
|
* examples?: array{dsn: Dsn, paths: list<string>} |
92
|
|
|
* }> |
93
|
|
|
*/ |
94
|
|
|
public function getApi() : array |
95
|
|
|
{ |
96
|
|
|
return $this->api; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
//phpcs:disable Squiz.Commenting.FunctionComment.MissingParamName squizlabs/PHP_CodeSniffer/issues/2591 |
100
|
|
|
/** |
101
|
|
|
* @param array< |
102
|
|
|
* int, |
103
|
|
|
* array{ |
104
|
|
|
* source: array{dsn: Dsn, paths: array<Path>}, |
105
|
|
|
* output?: string, |
106
|
|
|
* ignore?: array{paths: non-empty-array<Path>}, |
107
|
|
|
* extensions?: non-empty-list<string>, |
108
|
|
|
* visibility?: array<string>, |
109
|
|
|
* default-package-name?: string, |
110
|
|
|
* include-source?: bool, |
111
|
|
|
* markers?: non-empty-list<string>, |
112
|
|
|
* ignore-tags?: non-empty-list<string>, |
113
|
|
|
* examples?: array{dsn: Dsn, paths: list<string>} |
114
|
|
|
* }> $api |
115
|
|
|
*/ |
116
|
|
|
//phpcs:enable Squiz.Commenting.FunctionComment.MissingParamName |
117
|
|
|
public function setApi(array $api) : void |
118
|
|
|
{ |
119
|
|
|
$this->api = $api; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
//phpcs:disable Squiz.Commenting.FunctionComment.MissingParamName squizlabs/PHP_CodeSniffer/issues/2591 |
123
|
|
|
/** |
124
|
|
|
* @param array{ |
125
|
|
|
* source: array{dsn: Dsn, paths: array<Path>}, |
126
|
|
|
* output?: string, |
127
|
|
|
* ignore?: array{paths: non-empty-array<Path>}, |
128
|
|
|
* extensions?: non-empty-list<string>, |
129
|
|
|
* visibility?: array<string>, |
130
|
|
|
* default-package-name?: string, |
131
|
|
|
* include-source?: bool, |
132
|
|
|
* markers?: non-empty-list<string>, |
133
|
|
|
* ignore-tags?: non-empty-list<string>, |
134
|
|
|
* examples?: array{dsn: Dsn, paths: list<string>} |
135
|
|
|
* } $api |
136
|
|
|
*/ |
137
|
|
|
//phpcs:enable Squiz.Commenting.FunctionComment.MissingParamName |
138
|
|
|
public function addApi(array $api) : void |
139
|
|
|
{ |
140
|
|
|
$this->api[] = $api; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return array<mixed>|null |
145
|
|
|
*/ |
146
|
|
|
public function getGuides() : ?array |
147
|
|
|
{ |
148
|
|
|
return $this->guides; |
149
|
|
|
} |
150
|
|
|
} |
151
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.