Completed
Push — develop ( dbd153...7f7db1 )
by Jaap
07:29
created

Version2ExpectedArray::getCustomTargetConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 53

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 53
rs 9.0254
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\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'],
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'],
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'],
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