Completed
Push — develop ( 851c69...392713 )
by Jaap
06:06
created

Version2ExpectedArray   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 300
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 300
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultArray() 0 54 1
B getArrayWithMultipleIgnorePaths() 0 57 1
A getCustomTargetConfig() 0 54 1
A getDefinedVisibility() 0 54 1
A getCustomEncoding() 0 54 1
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\Dsn;
16
use phpDocumentor\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\Dsn('build/docs'),
36
                    'cache' => new \phpDocumentor\Path('build/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
                                'include-source' => false,
63
                                'markers' => [
64
                                    0 => 'TODO',
65
                                    1 => 'FIXME',
66
                                ],
67
                                'encoding' => 'utf-8',
68
                                'ignore-tags' => [],
69
                                'validate' => false,
70
                            ],
71
                        ],
72
                    ],
73
                ],
74
                'templates' => [
75
                    [
76
                        'name' => 'clean',
77
                    ],
78
                ],
79
            ],
80
        ];
81
    }
82
83
    /**
84
     * Provides the phpDocumentor2 configuration array with multiple ignore paths.
85
     *
86
     * @return array
87
     */
88
    public static function getArrayWithMultipleIgnorePaths()
89
    {
90
        return [
91
            'phpdocumentor' => [
92
                'title' => 'my-doc',
93
                'use-cache' => true,
94
                'paths' => [
95
                    'output' => new \phpDocumentor\Dsn('build/docs'),
96
                    'cache' => new Path('/build/cache'),
97
                ],
98
                'versions' => [
99
                    '1.0.0' => [
100
                        'folder' => '',
101
                        'api' => [
102
                            [
103
                                'format' => 'php',
104
                                'source' => [
105
                                    'dsn' => new Dsn('file://' . getcwd()),
106
                                    'paths' => [
107
                                        0 => 'src',
108
                                    ],
109
                                ],
110
                                'ignore' => [
111
                                    'hidden' => true,
112
                                    'symlinks' => true,
113
                                    'paths' => [
114
                                        0 => 'vendor/*',
115
                                        1 => 'logs/*',
116
                                    ],
117
                                ],
118
                                'extensions' => [
119
                                    0 => 'php',
120
                                    1 => 'php3',
121
                                    2 => 'phtml',
122
                                ],
123
                                'visibility' => ['public', 'protected', 'private'],
124
                                'default-package-name' => 'Default',
125
                                'include-source' => false,
126
                                'markers' => [
127
                                    0 => 'TODO',
128
                                    1 => 'FIXME',
129
                                ],
130
                                'encoding' => 'utf-8',
131
                                'ignore-tags' => [],
132
                                'validate' => false,
133
                            ],
134
                        ],
135
                    ],
136
                ],
137
                'templates' => [
138
                    [
139
                        'name' => 'clean',
140
                    ],
141
                ],
142
            ],
143
        ];
144
    }
145
146
    public static function getCustomTargetConfig()
147
    {
148
        return [
149
            'phpdocumentor' => [
150
                'title' => 'my-doc',
151
                'use-cache' => true,
152
                'paths' => [
153
                    'output' => new \phpDocumentor\Dsn('build/api/docs'),
154
                    'cache' => new \phpDocumentor\Path('/tmp/phpdoc-doc-cache'),
155
                ],
156
                'versions' => [
157
                    '1.0.0' => [
158
                        'folder' => '',
159
                        'api' => [
160
                            [
161
                                'format' => 'php',
162
                                'source' => [
163
                                    'dsn' => new Dsn('file://' . getcwd()),
164
                                    'paths' => [
165
                                        0 => 'src',
166
                                    ],
167
                                ],
168
                                'ignore' => [
169
                                    'hidden' => true,
170
                                    'symlinks' => true,
171
                                    'paths' => [],
172
                                ],
173
                                'extensions' => [
174
                                    0 => 'php',
175
                                    1 => 'php3',
176
                                    2 => 'phtml',
177
                                ],
178
                                'visibility' => ['public', 'protected', 'private'],
179
                                'default-package-name' => 'Default',
180
                                'include-source' => false,
181
                                'markers' => [
182
                                    0 => 'TODO',
183
                                    1 => 'FIXME',
184
                                ],
185
                                'encoding' => 'utf-8',
186
                                'ignore-tags' => [],
187
                                'validate' => false,
188
                            ],
189
                        ],
190
                    ],
191
                ],
192
                'templates' => [
193
                    [
194
                        'name' => 'clean',
195
                    ],
196
                ],
197
            ],
198
        ];
199
    }
200
201
    /**
202
     * Provides a configuration with visibility
203
     *
204
     * @return array
205
     */
206
    public static function getDefinedVisibility()
207
    {
208
        return [
209
            'phpdocumentor' => [
210
                'title' => 'my-doc',
211
                'use-cache' => true,
212
                'paths' => [
213
                    'output' => new \phpDocumentor\Dsn('build/docs'),
214
                    'cache' => new \phpDocumentor\Path('/tmp/phpdoc-doc-cache'),
215
                ],
216
                'versions' => [
217
                    '1.0.0' => [
218
                        'folder' => '',
219
                        'api' => [
220
                            [
221
                                'format' => 'php',
222
                                'source' => [
223
                                    'dsn' => new Dsn('file://' . getcwd()),
224
                                    'paths' => [
225
                                        0 => 'src',
226
                                    ],
227
                                ],
228
                                'ignore' => [
229
                                    'hidden' => true,
230
                                    'symlinks' => true,
231
                                    'paths' => [],
232
                                ],
233
                                'extensions' => [
234
                                    0 => 'php',
235
                                    1 => 'php3',
236
                                    2 => 'phtml',
237
                                ],
238
                                'visibility' => ['public', 'protected'],
239
                                'default-package-name' => 'Default',
240
                                'include-source' => false,
241
                                'markers' => [
242
                                    0 => 'TODO',
243
                                    1 => 'FIXME',
244
                                ],
245
                                'encoding' => 'utf-8',
246
                                'ignore-tags' => [],
247
                                'validate' => false,
248
                            ],
249
                        ],
250
                    ],
251
                ],
252
                'templates' => [
253
                    [
254
                        'name' => 'clean',
255
                    ],
256
                ],
257
            ],
258
        ];
259
    }
260
261
    /**
262
     * Provides the phpDocumentor2 configuration with encoding.
263
     *
264
     * @return array
265
     */
266
    public static function getCustomEncoding() : array
267
    {
268
        return [
269
            'phpdocumentor' => [
270
                'title' => 'my-doc',
271
                'use-cache' => true,
272
                'paths' => [
273
                    'output' => new \phpDocumentor\Dsn('build/docs'),
274
                    'cache' => new \phpDocumentor\Path('/tmp/phpdoc-doc-cache'),
275
                ],
276
                'versions' => [
277
                    '1.0.0' => [
278
                        'folder' => '',
279
                        'api' => [
280
                            [
281
                                'format' => 'php',
282
                                'source' => [
283
                                    'dsn' => new Dsn('file://' . getcwd()),
284
                                    'paths' => [
285
                                        0 => 'src',
286
                                    ],
287
                                ],
288
                                'ignore' => [
289
                                    'hidden' => true,
290
                                    'symlinks' => true,
291
                                    'paths' => [],
292
                                ],
293
                                'extensions' => [
294
                                    0 => 'php',
295
                                    1 => 'php3',
296
                                    2 => 'phtml',
297
                                ],
298
                                'visibility' => ['public', 'protected', 'private'],
299
                                'default-package-name' => 'Default',
300
                                'include-source' => false,
301
                                'markers' => [
302
                                    0 => 'TODO',
303
                                    1 => 'FIXME',
304
                                ],
305
                                'encoding' => 'ISO-8859-1',
306
                                'ignore-tags' => [],
307
                                'validate' => false,
308
                            ],
309
                        ],
310
                    ],
311
                ],
312
                'templates' => [
313
                    [
314
                        'name' => 'clean',
315
                    ],
316
                ],
317
            ],
318
        ];
319
    }
320
}
321