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

getColors()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 108
Code Lines 81

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 81
c 0
b 0
f 0
dl 0
loc 108
rs 8.4145
cc 1
nc 1
nop 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
    ];
53
}
54
55
function getColors()
56
{
57
    return [
58
        'default' => [
59
            'label' => __('Default', 'flynt'),
60
            'colors' => [
61
                'accent' => [
62
                    'label' => __('Accent', 'flynt'),
63
                    'default' => '#2b44df',
64
                    'hsl' => 1,
65
                ],
66
                'headline' => [
67
                    'label' => __('Headline', 'flynt'),
68
                    'default' => '#252525',
69
                ],
70
                'text' => [
71
                    'label' => __('Text', 'flynt'),
72
                    'default' => '#353535',
73
                ],
74
                'border' => [
75
                    'label' => __('Border', 'flynt'),
76
                    'default' => '#8791BA',
77
                    'hsl' => 1,
78
                ],
79
                'background' => [
80
                    'label' => __('Background', 'flynt'),
81
                    'default' => '#ffffff',
82
                ],
83
            ],
84
        ],
85
        'light' => [
86
            'label' => __('Theme Light', 'flynt'),
87
            'colors' => [
88
                'accent' => [
89
                    'label' => __('Accent', 'flynt'),
90
                    'default' => '#2b44df',
91
                    'hsl' => 1,
92
                ],
93
                'headline' => [
94
                    'label' => __('Headline', 'flynt'),
95
                    'default' => '#252525',
96
                ],
97
                'text' => [
98
                    'label' => __('Text', 'flynt'),
99
                    'default' => '#353535',
100
                ],
101
                'border' => [
102
                    'label' => __('Border', 'flynt'),
103
                    'default' => '#8791BA',
104
                    'hsl' => 1,
105
                ],
106
                'background' => [
107
                    'label' => __('Background', 'flynt'),
108
                    'default' => '#F8F9FD',
109
                ],
110
            ],
111
        ],
112
        'dark' => [
113
            'label' => __('Theme Dark', 'flynt'),
114
            'colors' => [
115
                'accent' => [
116
                    'label' => __('Accent', 'flynt'),
117
                    'default' => '#ffffff',
118
                    'hsl' => 1,
119
                ],
120
                'headline' => [
121
                    'label' => __('Headline', 'flynt'),
122
                    'default' => '#FBFBFB',
123
                ],
124
                'text' => [
125
                    'label' => __('Text', 'flynt'),
126
                    'default' => '#E9E9EC',
127
                ],
128
                'border' => [
129
                    'label' => __('Border', 'flynt'),
130
                    'default' => '#C3C4F7',
131
                    'hsl' => 1,
132
                ],
133
                'background' => [
134
                    'label' => __('Background', 'flynt'),
135
                    'default' => '#10205A',
136
                ],
137
            ],
138
        ],
139
        'hero' => [
140
            'label' => __('Theme Hero', 'flynt'),
141
            'colors' => [
142
                'accent' => [
143
                    'label' => __('Accent', 'flynt'),
144
                    'default' => '#ffffff',
145
                    'hsl' => 1,
146
                ],
147
                'headline' => [
148
                    'label' => __('Headline', 'flynt'),
149
                    'default' => '#FBFBFB',
150
                ],
151
                'text' => [
152
                    'label' => __('Text', 'flynt'),
153
                    'default' => '#E9E9EC',
154
                ],
155
                'border' => [
156
                    'label' => __('Border', 'flynt'),
157
                    'default' => '#CDE2FD',
158
                    'hsl' => 1,
159
                ],
160
                'background' => [
161
                    'label' => __('Background', 'flynt'),
162
                    'default' => '#2B44DF',
163
                ],
164
            ],
165
        ],
166
    ];
167
}
168