Completed
Push — develop ( 8fda15...dbbcf5 )
by Jaap
14s
created

Version3ExpectedArrays::getArrayWithMultipleApis()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 76
Code Lines 51

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 51
nc 1
nop 0
dl 0
loc 76
rs 8.9667
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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\Application\Configuration\Factory;
14
15
/**
16
 * Expected phpDocumentor3 configuration arrays used for unit testing.
17
 */
18
final class Version3ExpectedArrays
19
{
20
    /**
21
     * Provides the default phpDocumentor3 configuration array.
22
     *
23
     * @return array
24
     */
25
    public static function getDefaultArray()
26
    {
27
        return [
28
            'phpdocumentor' => [
29
                'use-cache' => true,
30
                'paths' => [
31
                    'output' => 'file://build/docs',
32
                    'cache' => '/tmp/phpdoc-doc-cache',
33
                ],
34
                'versions' => [
35
                    '1.0.0' => [
36
                        'folder' => 'latest',
37
                        'api' => [
38
                            0 => [
39
                                'format' => 'php',
40
                                'source' => [
41
                                    'dsn' => 'file://.',
42
                                    'paths' => [
43
                                        0 => 'src',
44
                                    ],
45
                                ],
46
                                'ignore' => [
47
                                    'hidden' => true,
48
                                    'paths' => [
49
                                        0 => 'src/ServiceDefinitions.php',
50
                                    ],
51
                                ],
52
                                'extensions' => [
53
                                    0 => 'php',
54
                                    1 => 'php3',
55
                                    2 => 'phtml',
56
                                ],
57
                                'visibility' => ['public'],
58
                                'default-package-name' => 'Default',
59
                                'markers' => [
60
                                    0 => 'TODO',
61
                                    1 => 'FIXME',
62
                                ],
63
                            ],
64
                        ],
65
                        'guide' => [
66
                            0 => [
67
                                'format' => 'rst',
68
                                'source' => [
69
                                    'dsn' => 'file://../phpDocumentor/phpDocumentor2',
70
                                    'paths' => [
71
                                        0 => 'docs',
72
                                    ],
73
                                ],
74
                            ],
75
                        ],
76
                    ],
77
                ],
78
                'templates' => [
79
                    [
80
                        'name' => 'clean',
81
                    ],
82
                ],
83
            ],
84
        ];
85
    }
86
87
    /**
88
     * Provides a phpDocumentor3 configuration array that contains empty extensions and empty markers.
89
     *
90
     * @return array
91
     */
92
    public static function getArrayWithEmptyExtensionsAndMarkers()
93
    {
94
        return [
95
            'phpdocumentor' => [
96
                'use-cache' => true,
97
                'paths' => [
98
                    'output' => 'file://build/docs',
99
                    'cache' => '/tmp/phpdoc-doc-cache',
100
                ],
101
                'versions' => [
102
                    '' => [
103
                        'folder' => '',
104
                        'api' => [
105
                            0 => [
106
                                'format' => 'php',
107
                                'source' => [
108
                                    'dsn' => 'file://.',
109
                                    'paths' => [
110
                                        0 => '.',
111
                                    ],
112
                                ],
113
                                'ignore' => [
114
                                    'hidden' => false,
115
                                    'paths' => [],
116
                                ],
117
                                'extensions' => [],
118
                                'visibility' => ['public'],
119
                                'default-package-name' => 'Default',
120
                                'markers' => [],
121
                            ],
122
                        ],
123
                    ],
124
                ],
125
                'templates' => [
126
                    [
127
                        'name' => 'clean',
128
                    ],
129
                ],
130
            ],
131
        ];
132
    }
133
134
    /**
135
     * Provides a phpDocumentor3 configuration array that contains multiple versions.
136
     *
137
     * @return array
138
     */
139
    public static function getArrayWithMultipleVersions()
140
    {
141
        return [
142
            'phpdocumentor' => [
143
                'use-cache' => true,
144
                'paths' => [
145
                    'output' => 'file://build/docs',
146
                    'cache' => '/tmp/phpdoc-doc-cache',
147
                ],
148
                'versions' => [
149
                    '1.0.0' => [
150
                        'folder' => 'earliest',
151
                    ],
152
                    '2.0.0' => [
153
                        'folder' => 'latest',
154
                    ],
155
                ],
156
                'templates' => [
157
                    [
158
                        'name' => 'clean',
159
                    ],
160
                ],
161
            ],
162
        ];
163
    }
164
165
    public static function getArrayWithMultipleApis()
166
    {
167
        return [
168
            'phpdocumentor' => [
169
                'use-cache' => true,
170
                'paths' => [
171
                    'output' => 'file://build/docs',
172
                    'cache' => '/tmp/phpdoc-doc-cache',
173
                ],
174
                'versions' => [
175
                    '1.0.0' => [
176
                        'folder' => 'latest',
177
                        'api' => [
178
                            0 => [
179
                                'format' => 'php',
180
                                'source' => [
181
                                    'dsn' => 'file://.',
182
                                    'paths' => [
183
                                        0 => 'src',
184
                                    ],
185
                                ],
186
                                'ignore' => [
187
                                    'hidden' => true,
188
                                    'paths' => [
189
                                        0 => 'src/ServiceDefinitions.php',
190
                                    ],
191
                                ],
192
                                'extensions' => [
193
                                    0 => 'php',
194
                                    1 => 'php3',
195
                                    2 => 'phtml',
196
                                ],
197
                                'visibility' => ['public'],
198
                                'default-package-name' => 'Default',
199
                                'markers' => [
200
                                    0 => 'TODO',
201
                                    1 => 'FIXME',
202
                                ],
203
                            ],
204
                            1 => [
205
                                'format' => 'php3',
206
                                'source' => [
207
                                    'dsn' => 'file://.',
208
                                    'paths' => [
209
                                        0 => 'src',
210
                                    ],
211
                                ],
212
                                'ignore' => [
213
                                    'hidden' => true,
214
                                    'paths' => [
215
                                        0 => 'src/ServiceDefinitions.php',
216
                                    ],
217
                                ],
218
                                'extensions' => [
219
                                    0 => 'php',
220
                                    1 => 'php3',
221
                                    2 => 'phtml',
222
                                ],
223
                                'visibility' => ['public'],
224
                                'default-package-name' => 'Default',
225
                                'markers' => [
226
                                    0 => 'TODO',
227
                                    1 => 'FIXME',
228
                                ],
229
                            ],
230
                        ],
231
                    ],
232
                ],
233
                'templates' => [
234
                    [
235
                        'name' => 'clean',
236
                    ],
237
                ],
238
            ],
239
        ];
240
    }
241
242
    public static function getArrayWithMultipleGuides()
243
    {
244
        return [
245
            'phpdocumentor' => [
246
                'use-cache' => true,
247
                'paths' => [
248
                    'output' => 'file://build/docs',
249
                    'cache' => '/tmp/phpdoc-doc-cache',
250
                ],
251
                'versions' => [
252
                    '1.0.0' => [
253
                        'folder' => 'latest',
254
                        'guide' => [
255
                            0 => [
256
                                'format' => 'rst',
257
                                'source' => [
258
                                    'dsn' => 'file://../phpDocumentor/phpDocumentor2',
259
                                    'paths' => [
260
                                        0 => 'docs',
261
                                    ],
262
                                ],
263
                            ],
264
                            1 => [
265
                                'format' => 'rst',
266
                                'source' => [
267
                                    'dsn' => 'file://../phpDocumentor/phpDocumentor3',
268
                                    'paths' => [
269
                                        0 => 'docs',
270
                                    ],
271
                                ],
272
                            ],
273
                        ],
274
                    ],
275
                ],
276
                'templates' => [
277
                    [
278
                        'name' => 'clean',
279
                    ],
280
                ],
281
            ],
282
        ];
283
    }
284
285
    public static function getArrayWithMultipleTemplates()
286
    {
287
        return [
288
            'phpdocumentor' => [
289
                'use-cache' => true,
290
                'paths' => [
291
                    'output' => 'file://build/docs',
292
                    'cache' => '/tmp/phpdoc-doc-cache',
293
                ],
294
                'versions' => [
295
                    '1.0.0' => [
296
                        'folder' => 'latest',
297
                        'api' => [
298
                            0 => [
299
                                'format' => 'php',
300
                                'source' => [
301
                                    'dsn' => 'file://.',
302
                                    'paths' => [
303
                                        0 => 'src',
304
                                    ],
305
                                ],
306
                                'ignore' => [
307
                                    'hidden' => true,
308
                                    'paths' => [],
309
                                ],
310
                                'extensions' => [
311
                                    0 => 'php',
312
                                    1 => 'php3',
313
                                    2 => 'phtml',
314
                                ],
315
                                'visibility' => ['public'],
316
                                'default-package-name' => 'Default',
317
                                'markers' => [
318
                                    0 => 'TODO',
319
                                    1 => 'FIXME',
320
                                ],
321
                                'encoding' => 'utf8',
322
                                'ignore-tags' => [],
323
                                'validate' => false,
324
                            ],
325
                        ],
326
                        'guide' => [
327
                            0 => [
328
                                'format' => 'rst',
329
                                'source' => [
330
                                    'dsn' => 'file://.',
331
                                    'paths' => [
332
                                        0 => 'docs',
333
                                    ],
334
                                ],
335
                            ],
336
                        ],
337
                    ],
338
                ],
339
                'templates' => [
340
                    0 => [
341
                        'name' => 'clean',
342
                        'location' => 'https://github.com/phpDocumentor/phpDocumentor2/tree/develop/data/templates/clean',
343
                    ],
344
                    1 => [
345
                        'name' => 'tainted',
346
                        'location' => 'https://github.com/phpDocumentor/phpDocumentor2/tree/develop/data/templates/tainted',
347
                    ],
348
                ],
349
            ],
350
        ];
351
    }
352
}
353