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

getSizes()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 101
Code Lines 81

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 81
nc 1
nop 0
dl 0
loc 101
rs 8.4145
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
    ];
113
}
114
115
function getColors()
116
{
117
    return [
118
        'default' => [
119
            'label' => __('Default', 'flynt'),
120
            'colors' => [
121
                'accent' => [
122
                    'label' => __('Accent', 'flynt'),
123
                    'default' => '#2b44df',
124
                    'hsl' => 1,
125
                ],
126
                'headline' => [
127
                    'label' => __('Headline', 'flynt'),
128
                    'default' => '#252525',
129
                ],
130
                'text' => [
131
                    'label' => __('Text', 'flynt'),
132
                    'default' => '#353535',
133
                ],
134
                'border' => [
135
                    'label' => __('Border', 'flynt'),
136
                    'default' => '#8791BA',
137
                    'hsl' => 1,
138
                ],
139
                'background' => [
140
                    'label' => __('Background', 'flynt'),
141
                    'default' => '#ffffff',
142
                ],
143
            ],
144
        ],
145
        'light' => [
146
            'label' => __('Theme Light', 'flynt'),
147
            'colors' => [
148
                'accent' => [
149
                    'label' => __('Accent', 'flynt'),
150
                    'default' => '#2b44df',
151
                    'hsl' => 1,
152
                ],
153
                'headline' => [
154
                    'label' => __('Headline', 'flynt'),
155
                    'default' => '#252525',
156
                ],
157
                'text' => [
158
                    'label' => __('Text', 'flynt'),
159
                    'default' => '#353535',
160
                ],
161
                'border' => [
162
                    'label' => __('Border', 'flynt'),
163
                    'default' => '#8791BA',
164
                    'hsl' => 1,
165
                ],
166
                'background' => [
167
                    'label' => __('Background', 'flynt'),
168
                    'default' => '#F8F9FD',
169
                ],
170
            ],
171
        ],
172
        'dark' => [
173
            'label' => __('Theme Dark', 'flynt'),
174
            'colors' => [
175
                'accent' => [
176
                    'label' => __('Accent', 'flynt'),
177
                    'default' => '#ffffff',
178
                    'hsl' => 1,
179
                ],
180
                'headline' => [
181
                    'label' => __('Headline', 'flynt'),
182
                    'default' => '#FBFBFB',
183
                ],
184
                'text' => [
185
                    'label' => __('Text', 'flynt'),
186
                    'default' => '#E9E9EC',
187
                ],
188
                'border' => [
189
                    'label' => __('Border', 'flynt'),
190
                    'default' => '#C3C4F7',
191
                    'hsl' => 1,
192
                ],
193
                'background' => [
194
                    'label' => __('Background', 'flynt'),
195
                    'default' => '#10205A',
196
                ],
197
            ],
198
        ],
199
        'hero' => [
200
            'label' => __('Theme Hero', 'flynt'),
201
            'colors' => [
202
                'accent' => [
203
                    'label' => __('Accent', 'flynt'),
204
                    'default' => '#ffffff',
205
                    'hsl' => 1,
206
                ],
207
                'headline' => [
208
                    'label' => __('Headline', 'flynt'),
209
                    'default' => '#FBFBFB',
210
                ],
211
                'text' => [
212
                    'label' => __('Text', 'flynt'),
213
                    'default' => '#E9E9EC',
214
                ],
215
                'border' => [
216
                    'label' => __('Border', 'flynt'),
217
                    'default' => '#CDE2FD',
218
                    'hsl' => 1,
219
                ],
220
                'background' => [
221
                    'label' => __('Background', 'flynt'),
222
                    'default' => '#2B44DF',
223
                ],
224
            ],
225
        ],
226
    ];
227
}
228