1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of phpDocumentor. |
4
|
|
|
* |
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
6
|
|
|
* file that was distributed with this source code. |
7
|
|
|
* |
8
|
|
|
* @copyright 2010-2017 Mike van Riel<[email protected]> |
9
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT |
10
|
|
|
* @link http://phpdoc.org |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace phpDocumentor\Configuration\Factory; |
14
|
|
|
|
15
|
|
|
use phpDocumentor\DomainModel\Dsn; |
16
|
|
|
use phpDocumentor\DomainModel\Path; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Expected phpDocumentor2 configuration arrays used for unit testing. |
20
|
|
|
*/ |
21
|
|
|
final class Version2ExpectedArray |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Provides the default phpDocumentor2 configuration array. |
25
|
|
|
* |
26
|
|
|
* @return array |
27
|
|
|
*/ |
28
|
|
|
public static function getDefaultArray() |
29
|
|
|
{ |
30
|
|
|
return [ |
31
|
|
|
'phpdocumentor' => [ |
32
|
|
|
'title' => 'my-doc', |
33
|
|
|
'use-cache' => true, |
34
|
|
|
'paths' => [ |
35
|
|
|
'output' => new \phpDocumentor\DomainModel\Dsn('build/docs'), |
36
|
|
|
'cache' => new \phpDocumentor\DomainModel\Path('/tmp/phpdoc-doc-cache'), |
37
|
|
|
], |
38
|
|
|
'versions' => [ |
39
|
|
|
'1.0.0' => [ |
40
|
|
|
'folder' => '', |
41
|
|
|
'api' => [ |
42
|
|
|
[ |
43
|
|
|
'format' => 'php', |
44
|
|
|
'source' => [ |
45
|
|
|
'dsn' => new Dsn('file://' . getcwd()), |
46
|
|
|
'paths' => [ |
47
|
|
|
0 => 'src', |
48
|
|
|
], |
49
|
|
|
], |
50
|
|
|
'ignore' => [ |
51
|
|
|
'hidden' => true, |
52
|
|
|
'symlinks' => true, |
53
|
|
|
'paths' => [], |
54
|
|
|
], |
55
|
|
|
'extensions' => [ |
56
|
|
|
0 => 'php', |
57
|
|
|
1 => 'php3', |
58
|
|
|
2 => 'phtml', |
59
|
|
|
], |
60
|
|
|
'visibility' => ['public', 'protected', 'private'], |
61
|
|
|
'default-package-name' => 'Default', |
62
|
|
|
'markers' => [ |
63
|
|
|
0 => 'TODO', |
64
|
|
|
1 => 'FIXME', |
65
|
|
|
], |
66
|
|
|
'encoding' => 'utf8', |
67
|
|
|
'ignore-tags' => [], |
68
|
|
|
'validate' => false, |
69
|
|
|
], |
70
|
|
|
], |
71
|
|
|
], |
72
|
|
|
], |
73
|
|
|
'templates' => [ |
74
|
|
|
[ |
75
|
|
|
'name' => 'clean', |
76
|
|
|
], |
77
|
|
|
], |
78
|
|
|
], |
79
|
|
|
]; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Provides the phpDocumentor2 configuration array with multiple ignore paths. |
84
|
|
|
* |
85
|
|
|
* @return array |
86
|
|
|
*/ |
87
|
|
|
public static function getArrayWithMultipleIgnorePaths() |
88
|
|
|
{ |
89
|
|
|
return [ |
90
|
|
|
'phpdocumentor' => [ |
91
|
|
|
'title' => 'my-doc', |
92
|
|
|
'use-cache' => true, |
93
|
|
|
'paths' => [ |
94
|
|
|
'output' => new \phpDocumentor\DomainModel\Dsn('build/docs'), |
95
|
|
|
'cache' => new Path('/tmp/phpdoc-doc-cache'), |
96
|
|
|
], |
97
|
|
|
'versions' => [ |
98
|
|
|
'1.0.0' => [ |
99
|
|
|
'folder' => '', |
100
|
|
|
'api' => [ |
101
|
|
|
[ |
102
|
|
|
'format' => 'php', |
103
|
|
|
'source' => [ |
104
|
|
|
'dsn' => new Dsn('file://' . getcwd()), |
105
|
|
|
'paths' => [ |
106
|
|
|
0 => 'src', |
107
|
|
|
], |
108
|
|
|
], |
109
|
|
|
'ignore' => [ |
110
|
|
|
'hidden' => true, |
111
|
|
|
'symlinks' => true, |
112
|
|
|
'paths' => [ |
113
|
|
|
0 => 'vendor/*', |
114
|
|
|
1 => 'logs/*', |
115
|
|
|
], |
116
|
|
|
], |
117
|
|
|
'extensions' => [ |
118
|
|
|
0 => 'php', |
119
|
|
|
1 => 'php3', |
120
|
|
|
2 => 'phtml', |
121
|
|
|
], |
122
|
|
|
'visibility' => ['public', 'protected', 'private'], |
123
|
|
|
'default-package-name' => 'Default', |
124
|
|
|
'markers' => [ |
125
|
|
|
0 => 'TODO', |
126
|
|
|
1 => 'FIXME', |
127
|
|
|
], |
128
|
|
|
'encoding' => 'utf8', |
129
|
|
|
'ignore-tags' => [], |
130
|
|
|
'validate' => false, |
131
|
|
|
], |
132
|
|
|
], |
133
|
|
|
], |
134
|
|
|
], |
135
|
|
|
'templates' => [ |
136
|
|
|
[ |
137
|
|
|
'name' => 'clean', |
138
|
|
|
], |
139
|
|
|
], |
140
|
|
|
], |
141
|
|
|
]; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
public static function getCustomTargetConfig() |
145
|
|
|
{ |
146
|
|
|
return [ |
147
|
|
|
'phpdocumentor' => [ |
148
|
|
|
'title' => 'my-doc', |
149
|
|
|
'use-cache' => true, |
150
|
|
|
'paths' => [ |
151
|
|
|
'output' => new \phpDocumentor\DomainModel\Dsn('build/api/docs'), |
152
|
|
|
'cache' => new \phpDocumentor\DomainModel\Path('/tmp/phpdoc-doc-cache'), |
153
|
|
|
], |
154
|
|
|
'versions' => [ |
155
|
|
|
'1.0.0' => [ |
156
|
|
|
'folder' => '', |
157
|
|
|
'api' => [ |
158
|
|
|
[ |
159
|
|
|
'format' => 'php', |
160
|
|
|
'source' => [ |
161
|
|
|
'dsn' => new Dsn('file://' . getcwd()), |
162
|
|
|
'paths' => [ |
163
|
|
|
0 => 'src', |
164
|
|
|
], |
165
|
|
|
], |
166
|
|
|
'ignore' => [ |
167
|
|
|
'hidden' => true, |
168
|
|
|
'symlinks' => true, |
169
|
|
|
'paths' => [], |
170
|
|
|
], |
171
|
|
|
'extensions' => [ |
172
|
|
|
0 => 'php', |
173
|
|
|
1 => 'php3', |
174
|
|
|
2 => 'phtml', |
175
|
|
|
], |
176
|
|
|
'visibility' => ['public', 'protected', 'private'], |
177
|
|
|
'default-package-name' => 'Default', |
178
|
|
|
'markers' => [ |
179
|
|
|
0 => 'TODO', |
180
|
|
|
1 => 'FIXME', |
181
|
|
|
], |
182
|
|
|
'encoding' => 'utf8', |
183
|
|
|
'ignore-tags' => [], |
184
|
|
|
'validate' => false, |
185
|
|
|
], |
186
|
|
|
], |
187
|
|
|
], |
188
|
|
|
], |
189
|
|
|
'templates' => [ |
190
|
|
|
[ |
191
|
|
|
'name' => 'clean', |
192
|
|
|
], |
193
|
|
|
], |
194
|
|
|
], |
195
|
|
|
]; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* Provides a configuration with visibility |
200
|
|
|
* |
201
|
|
|
* @return array |
202
|
|
|
*/ |
203
|
|
|
public static function getDefinedVisibility() |
204
|
|
|
{ |
205
|
|
|
return [ |
206
|
|
|
'phpdocumentor' => [ |
207
|
|
|
'title' => 'my-doc', |
208
|
|
|
'use-cache' => true, |
209
|
|
|
'paths' => [ |
210
|
|
|
'output' => new \phpDocumentor\DomainModel\Dsn('build/docs'), |
211
|
|
|
'cache' => new \phpDocumentor\DomainModel\Path('/tmp/phpdoc-doc-cache'), |
212
|
|
|
], |
213
|
|
|
'versions' => [ |
214
|
|
|
'1.0.0' => [ |
215
|
|
|
'folder' => '', |
216
|
|
|
'api' => [ |
217
|
|
|
[ |
218
|
|
|
'format' => 'php', |
219
|
|
|
'source' => [ |
220
|
|
|
'dsn' => new Dsn('file://' . getcwd()), |
221
|
|
|
'paths' => [ |
222
|
|
|
0 => 'src', |
223
|
|
|
], |
224
|
|
|
], |
225
|
|
|
'ignore' => [ |
226
|
|
|
'hidden' => true, |
227
|
|
|
'symlinks' => true, |
228
|
|
|
'paths' => [], |
229
|
|
|
], |
230
|
|
|
'extensions' => [ |
231
|
|
|
0 => 'php', |
232
|
|
|
1 => 'php3', |
233
|
|
|
2 => 'phtml', |
234
|
|
|
], |
235
|
|
|
'visibility' => ['public', 'protected'], |
236
|
|
|
'default-package-name' => 'Default', |
237
|
|
|
'markers' => [ |
238
|
|
|
0 => 'TODO', |
239
|
|
|
1 => 'FIXME', |
240
|
|
|
], |
241
|
|
|
'encoding' => 'utf8', |
242
|
|
|
'ignore-tags' => [], |
243
|
|
|
'validate' => false, |
244
|
|
|
], |
245
|
|
|
], |
246
|
|
|
], |
247
|
|
|
], |
248
|
|
|
'templates' => [ |
249
|
|
|
[ |
250
|
|
|
'name' => 'clean', |
251
|
|
|
], |
252
|
|
|
], |
253
|
|
|
], |
254
|
|
|
]; |
255
|
|
|
} |
256
|
|
|
} |
257
|
|
|
|