Passed
Pull Request — master (#258)
by
unknown
04:21
created

getVariables()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 290
Code Lines 205

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 205
nc 1
nop 0
dl 0
loc 290
rs 8
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 getVariables()
10
{
11
    return [
12
        [
13
            'label' => __('Sizes', 'flynt'),
14
            'name' => 'sizes',
15
            'type' => 'section',
16
            'priority' => 160,
17
            'fields' => [
18
                [
19
                    'label' => __('Container Max Width', 'flynt'),
20
                    'name' => 'container-max-width',
21
                    'type' => 'flynt-range',
22
                    'default' => 1440,
23
                    'unit' => 'px',
24
                    'input_attrs' => [
25
                        'min' => 700,
26
                        'max' => 1600,
27
                        'step' => 1,
28
                    ],
29
                ],
30
                [
31
                    'label' => __('Container Padding Desktop', 'flynt'),
32
                    'name' => 'container-padding-desktop',
33
                    'type' => 'flynt-range',
34
                    'default' => 64,
35
                    'unit' => 'px',
36
                    'input_attrs' => [
37
                        'min' => 0,
38
                        'max' => 240,
39
                        'step' => 1,
40
                    ],
41
                ],
42
                [
43
                    'label' => __('Container Padding Tablet', 'flynt'),
44
                    'name' => 'container-padding-tablet',
45
                    'type' => 'flynt-range',
46
                    'default' => 32,
47
                    'unit' => 'px',
48
                    'input_attrs' => [
49
                        'min' => 0,
50
                        'max' => 64,
51
                        'step' => 1,
52
                    ],
53
                ],
54
                [
55
                    'label' => __('Container Padding Mobile', 'flynt'),
56
                    'name' => 'container-padding-mobile',
57
                    'type' => 'flynt-range',
58
                    'default' => 16,
59
                    'unit' => 'px',
60
                    'input_attrs' => [
61
                        'min' => 0,
62
                        'max' => 32,
63
                        'step' => 1,
64
                    ],
65
                ],
66
                [
67
                    'label' => __('Content Max Width', 'flynt'),
68
                    'name' => 'content-max-width',
69
                    'type' => 'flynt-range',
70
                    'default' => 690,
71
                    'unit' => 'px',
72
                    'input_attrs' => [
73
                        'min' => 0,
74
                        'max' => 1440,
75
                        'step' => 1,
76
                    ],
77
                ],
78
                [
79
                    'label' => __('Content Max Width Large', 'flynt'),
80
                    'name' => 'content-max-width-large',
81
                    'type' => 'flynt-range',
82
                    'default' => 860,
83
                    'unit' => 'px',
84
                    'input_attrs' => [
85
                        'min' => 0,
86
                        'max' => 1440,
87
                        'step' => 1,
88
                    ],
89
                ],
90
                [
91
                    'label' => __('Component Spacing', 'flynt'),
92
                    'name' => 'component-spacing-base',
93
                    'type' => 'flynt-range',
94
                    'default' => 48,
95
                    'unit' => 'px',
96
                    'input_attrs' => [
97
                        'min' => 0,
98
                        'max' => 96,
99
                        'step' => 1,
100
                    ],
101
                ],
102
                [
103
                    'label' => __('Gutter Width', 'flynt'),
104
                    'name' => 'gutter-width',
105
                    'type' => 'flynt-range',
106
                    'default' => 24,
107
                    'unit' => 'px',
108
                    'input_attrs' => [
109
                        'min' => 0,
110
                        'max' => 48,
111
                        'step' => 4,
112
                    ],
113
                ],
114
                [
115
                    'label' => __('Box Spacing', 'flynt'),
116
                    'name' => 'box-spacing',
117
                    'type' => 'flynt-range',
118
                    'default' => 32,
119
                    'unit' => 'px',
120
                    'input_attrs' => [
121
                        'min' => 16,
122
                        'max' => 48,
123
                        'step' => 4,
124
                    ],
125
                ],
126
                [
127
                    'label' => __('Box Border Radius', 'flynt'),
128
                    'name' => 'box-border-radius',
129
                    'type' => 'flynt-range',
130
                    'default' => 16,
131
                    'unit' => 'px',
132
                    'input_attrs' => [
133
                        'min' => 0,
134
                        'max' => 32,
135
                        'step' => 1,
136
                    ],
137
                ],
138
            ]
139
        ],
140
        [
141
            'label' => __('Colors', 'flynt'),
142
            'name' => 'colors',
143
            'type' => 'panel',
144
            'priority' => 161,
145
            'sections' => [
146
                [
147
                    'label' => __('Default', 'flynt'),
148
                    'name' => 'default',
149
                    'type' => 'section',
150
                    'fields' => [
151
                        [
152
                            'label' => __('Accent', 'flynt'),
153
                            'name' => 'theme-default-color-accent',
154
                            'type' => 'color',
155
                            'default' => '#2b44df',
156
                            'hsl' => 1,
157
                        ],
158
                        [
159
                            'label' => __('Headline', 'flynt'),
160
                            'name' => 'theme-default-color-headline',
161
                            'type' => 'color',
162
                            'default' => '#252525',
163
                        ],
164
                        [
165
                            'label' => __('Text', 'flynt'),
166
                            'name' => 'theme-default-color-text',
167
                            'type' => 'color',
168
                            'default' => '#353535',
169
                        ],
170
                        [
171
                            'label' => __('Border', 'flynt'),
172
                            'name' => 'theme-default-color-border',
173
                            'type' => 'color',
174
                            'default' => '#8791BA',
175
                            'hsl' => 1,
176
                        ],
177
                        [
178
                            'label' => __('Background', 'flynt'),
179
                            'name' => 'theme-default-color-background',
180
                            'type' => 'color',
181
                            'default' => '#ffffff',
182
                        ],
183
                    ]
184
                ],
185
                [
186
                    'label' => __('Theme Light', 'flynt'),
187
                    'name' => 'light',
188
                    'type' => 'section',
189
                    'fields' => [
190
                        [
191
                            'label' => __('Accent', 'flynt'),
192
                            'name' => 'theme-light-color-accent',
193
                            'type' => 'color',
194
                            'default' => '#2b44df',
195
                            'hsl' => 1,
196
                        ],
197
                        [
198
                            'label' => __('Headline', 'flynt'),
199
                            'name' => 'theme-light-color-headline',
200
                            'type' => 'color',
201
                            'default' => '#252525',
202
                        ],
203
                        [
204
                            'label' => __('Text', 'flynt'),
205
                            'name' => 'theme-light-color-text',
206
                            'type' => 'color',
207
                            'default' => '#353535',
208
                        ],
209
                        [
210
                            'label' => __('Border', 'flynt'),
211
                            'name' => 'theme-light-color-border',
212
                            'type' => 'color',
213
                            'default' => '#8791BA',
214
                            'hsl' => 1,
215
                        ],
216
                        [
217
                            'label' => __('Background', 'flynt'),
218
                            'name' => 'theme-light-color-background',
219
                            'type' => 'color',
220
                            'default' => '#F8F9FD',
221
                        ],
222
                    ]
223
                ],
224
                [
225
                    'label' => __('Theme Dark', 'flynt'),
226
                    'name' => 'dark',
227
                    'type' => 'section',
228
                    'fields' => [
229
                        [
230
                            'label' => __('Accent', 'flynt'),
231
                            'name' => 'theme-dark-color-accent',
232
                            'type' => 'color',
233
                            'default' => '#ffc261',
234
                            'hsl' => 1,
235
                        ],
236
                        [
237
                            'label' => __('Headline', 'flynt'),
238
                            'name' => 'theme-dark-color-headline',
239
                            'type' => 'color',
240
                            'default' => '#FBFBFB',
241
                        ],
242
                        [
243
                            'label' => __('Text', 'flynt'),
244
                            'name' => 'theme-dark-color-text',
245
                            'type' => 'color',
246
                            'default' => '#E9E9EC',
247
                        ],
248
                        [
249
                            'label' => __('Border', 'flynt'),
250
                            'name' => 'theme-dark-color-border',
251
                            'type' => 'color',
252
                            'default' => '#C3C4F7',
253
                            'hsl' => 1,
254
                        ],
255
                        [
256
                            'label' => __('Background', 'flynt'),
257
                            'name' => 'theme-dark-color-background',
258
                            'type' => 'color',
259
                            'default' => '#10205A',
260
                        ],
261
                    ]
262
                ],
263
                [
264
                    'label' => __('Theme Hero', 'flynt'),
265
                    'name' => 'hero',
266
                    'type' => 'section',
267
                    'fields' => [
268
                        [
269
                            'label' => __('Accent', 'flynt'),
270
                            'name' => 'theme-hero-color-accent',
271
                            'type' => 'color',
272
                            'default' => '#ffc261',
273
                            'hsl' => 1,
274
                        ],
275
                        [
276
                            'label' => __('Headline', 'flynt'),
277
                            'name' => 'theme-hero-color-headline',
278
                            'type' => 'color',
279
                            'default' => '#FBFBFB',
280
                        ],
281
                        [
282
                            'label' => __('Text', 'flynt'),
283
                            'name' => 'theme-hero-color-text',
284
                            'type' => 'color',
285
                            'default' => '#E9E9EC',
286
                        ],
287
                        [
288
                            'label' => __('Border', 'flynt'),
289
                            'name' => 'theme-hero-color-border',
290
                            'type' => 'color',
291
                            'default' => '#CDE2FD',
292
                            'hsl' => 1,
293
                        ],
294
                        [
295
                            'label' => __('Background', 'flynt'),
296
                            'name' => 'theme-hero-color-background',
297
                            'type' => 'color',
298
                            'default' => '#2B44DF',
299
                        ],
300
                    ]
301
                ],
302
            ]
303
        ]
304
    ];
305
}
306