Passed
Pull Request — master (#258)
by
unknown
05:18
created

getSizes()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 121
Code Lines 97

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 97
nc 1
nop 0
dl 0
loc 121
rs 8.0654
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
/**
4
 * Define theme variables.
5
 */
6
7
namespace Flynt\Variables;
8
9
function getSizes()
10
{
11
    return [
12
        'container-max-width' => [
13
            'label' => __('Container Max Width', 'flynt'),
14
            'default' => 1440,
15
            'unit' => 'px',
16
            'options' => [
17
                'min' => 700,
18
                'max' => 1600,
19
                'step' => 1,
20
            ],
21
        ],
22
        'container-padding-desktop' => [
23
            'label' => __('Container Padding Desktop', 'flynt'),
24
            'default' => 64,
25
            'unit' => 'px',
26
            'options' => [
27
                'min' => 0,
28
                'max' => 128,
29
                'step' => 1,
30
            ],
31
        ],
32
        'container-padding-tablet' => [
33
            'label' => __('Container Padding Tablet', 'flynt'),
34
            'default' => 32,
35
            'unit' => 'px',
36
            'options' => [
37
                'min' => 0,
38
                'max' => 64,
39
                'step' => 1,
40
            ],
41
        ],
42
        'container-padding-mobile' => [
43
            'label' => __('Container Padding Mobile', 'flynt'),
44
            'default' => 16,
45
            'unit' => 'px',
46
            'options' => [
47
                'min' => 0,
48
                'max' => 32,
49
                'step' => 1,
50
            ],
51
        ],
52
        'content-max-width' => [
53
            'label' => __('Content Max Width', 'flynt'),
54
            'default' => 690,
55
            'unit' => 'px',
56
            'options' => [
57
                'min' => 0,
58
                'max' => 1440,
59
                'step' => 1,
60
            ],
61
        ],
62
        'content-max-width-large' => [
63
            'label' => __('Content Max Width Large', 'flynt'),
64
            'default' => 860,
65
            'unit' => 'px',
66
            'options' => [
67
                'min' => 0,
68
                'max' => 1440,
69
                'step' => 1,
70
            ],
71
        ],
72
        'component-spacing-desktop' => [
73
            'label' => __('Component Spacing Desktop', 'flynt'),
74
            'default' => 128,
75
            'unit' => 'px',
76
            'options' => [
77
                'min' => 0,
78
                'max' => 128,
79
                'step' => 1,
80
            ],
81
        ],
82
        'component-spacing-tablet' => [
83
            'label' => __('Component Spacing Tablet', 'flynt'),
84
            'default' => 96,
85
            'unit' => 'px',
86
            'options' => [
87
                'min' => 0,
88
                'max' => 128,
89
                'step' => 1,
90
            ],
91
        ],
92
        'component-spacing-mobile' => [
93
            'label' => __('Component Spacing Mobile', 'flynt'),
94
            'default' => 48,
95
            'unit' => 'px',
96
            'options' => [
97
                'min' => 0,
98
                'max' => 96,
99
                'step' => 1,
100
            ],
101
        ],
102
        'gutter-width' => [
103
            'label' => __('Gutter Width', 'flynt'),
104
            'default' => 24,
105
            'unit' => 'px',
106
            'options' => [
107
                'min' => 4,
108
                'max' => 24,
109
                'step' => 4,
110
            ],
111
        ],
112
        'box-spacing' => [
113
            'label' => __('Box Spacing', 'flynt'),
114
            'default' => 32,
115
            'unit' => 'px',
116
            'options' => [
117
                'min' => 0,
118
                'max' => 32,
119
                'step' => 1,
120
            ],
121
        ],
122
        'box-border-radius' => [
123
            'label' => __('Box Border Radius', 'flynt'),
124
            'default' => 16,
125
            'unit' => 'px',
126
            'options' => [
127
                'min' => 0,
128
                'max' => 32,
129
                'step' => 1,
130
            ],
131
        ],
132
    ];
133
}
134
135
function getColors()
136
{
137
    return [
138
        'default' => [
139
            'label' => __('Default', 'flynt'),
140
            'colors' => [
141
                'accent' => [
142
                    'label' => __('Accent', 'flynt'),
143
                    'default' => '#2b44df',
144
                    'hsl' => 1,
145
                ],
146
                'headline' => [
147
                    'label' => __('Headline', 'flynt'),
148
                    'default' => '#252525',
149
                ],
150
                'text' => [
151
                    'label' => __('Text', 'flynt'),
152
                    'default' => '#353535',
153
                ],
154
                'border' => [
155
                    'label' => __('Border', 'flynt'),
156
                    'default' => '#8791BA',
157
                    'hsl' => 1,
158
                ],
159
                'background' => [
160
                    'label' => __('Background', 'flynt'),
161
                    'default' => '#ffffff',
162
                ],
163
            ],
164
        ],
165
        'light' => [
166
            'label' => __('Theme Light', 'flynt'),
167
            'colors' => [
168
                'accent' => [
169
                    'label' => __('Accent', 'flynt'),
170
                    'default' => '#2b44df',
171
                    'hsl' => 1,
172
                ],
173
                'headline' => [
174
                    'label' => __('Headline', 'flynt'),
175
                    'default' => '#252525',
176
                ],
177
                'text' => [
178
                    'label' => __('Text', 'flynt'),
179
                    'default' => '#353535',
180
                ],
181
                'border' => [
182
                    'label' => __('Border', 'flynt'),
183
                    'default' => '#8791BA',
184
                    'hsl' => 1,
185
                ],
186
                'background' => [
187
                    'label' => __('Background', 'flynt'),
188
                    'default' => '#F8F9FD',
189
                ],
190
            ],
191
        ],
192
        'dark' => [
193
            'label' => __('Theme Dark', 'flynt'),
194
            'colors' => [
195
                'accent' => [
196
                    'label' => __('Accent', 'flynt'),
197
                    'default' => '#ffffff',
198
                    'hsl' => 1,
199
                ],
200
                'headline' => [
201
                    'label' => __('Headline', 'flynt'),
202
                    'default' => '#FBFBFB',
203
                ],
204
                'text' => [
205
                    'label' => __('Text', 'flynt'),
206
                    'default' => '#E9E9EC',
207
                ],
208
                'border' => [
209
                    'label' => __('Border', 'flynt'),
210
                    'default' => '#C3C4F7',
211
                    'hsl' => 1,
212
                ],
213
                'background' => [
214
                    'label' => __('Background', 'flynt'),
215
                    'default' => '#10205A',
216
                ],
217
            ],
218
        ],
219
        'hero' => [
220
            'label' => __('Theme Hero', 'flynt'),
221
            'colors' => [
222
                'accent' => [
223
                    'label' => __('Accent', 'flynt'),
224
                    'default' => '#ffffff',
225
                    'hsl' => 1,
226
                ],
227
                'headline' => [
228
                    'label' => __('Headline', 'flynt'),
229
                    'default' => '#FBFBFB',
230
                ],
231
                'text' => [
232
                    'label' => __('Text', 'flynt'),
233
                    'default' => '#E9E9EC',
234
                ],
235
                'border' => [
236
                    'label' => __('Border', 'flynt'),
237
                    'default' => '#CDE2FD',
238
                    'hsl' => 1,
239
                ],
240
                'background' => [
241
                    'label' => __('Background', 'flynt'),
242
                    'default' => '#2B44DF',
243
                ],
244
            ],
245
        ],
246
    ];
247
}
248