| Conditions | 1 |
| Paths | 1 |
| Total Lines | 134 |
| Code Lines | 102 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 14 | function getThemesConfig() |
||
| 15 | { |
||
| 16 | $themes = [ |
||
| 17 | 'default' => [ |
||
| 18 | 'name' => __('Default', 'flynt'), |
||
| 19 | 'colors' => [ |
||
| 20 | 'accent' => [ |
||
| 21 | 'label' => __('Accent', 'flynt'), |
||
| 22 | 'default' => '#2b44df', |
||
| 23 | 'description' => '', |
||
| 24 | 'hsl' => 1, |
||
| 25 | ], |
||
| 26 | 'headline' => [ |
||
| 27 | 'label' => __('Headline', 'flynt'), |
||
| 28 | 'default' => '#252525', |
||
| 29 | 'description' => '', |
||
| 30 | ], |
||
| 31 | 'text' => [ |
||
| 32 | 'label' => __('Text', 'flynt'), |
||
| 33 | 'default' => '#353535', |
||
| 34 | 'description' => '', |
||
| 35 | ], |
||
| 36 | 'border' => [ |
||
| 37 | 'label' => __('Border', 'flynt'), |
||
| 38 | 'default' => '#8791BA', |
||
| 39 | 'description' => '', |
||
| 40 | 'hsl' => 1, |
||
| 41 | ], |
||
| 42 | 'background' => [ |
||
| 43 | 'label' => __('Background', 'flynt'), |
||
| 44 | 'default' => '#ffffff', |
||
| 45 | 'description' => '', |
||
| 46 | ], |
||
| 47 | ], |
||
| 48 | ], |
||
| 49 | 'light' => [ |
||
| 50 | 'name' => __('Theme Light', 'flynt'), |
||
| 51 | 'colors' => [ |
||
| 52 | 'accent' => [ |
||
| 53 | 'label' => __('Accent', 'flynt'), |
||
| 54 | 'default' => '#2b44df', |
||
| 55 | 'description' => '', |
||
| 56 | 'hsl' => 1, |
||
| 57 | ], |
||
| 58 | 'headline' => [ |
||
| 59 | 'label' => __('Headline', 'flynt'), |
||
| 60 | 'default' => '#252525', |
||
| 61 | 'description' => '', |
||
| 62 | ], |
||
| 63 | 'text' => [ |
||
| 64 | 'label' => __('Text', 'flynt'), |
||
| 65 | 'default' => '#353535', |
||
| 66 | 'description' => '', |
||
| 67 | ], |
||
| 68 | 'border' => [ |
||
| 69 | 'label' => __('Border', 'flynt'), |
||
| 70 | 'default' => '#8791BA', |
||
| 71 | 'description' => '', |
||
| 72 | 'hsl' => 1, |
||
| 73 | ], |
||
| 74 | 'background' => [ |
||
| 75 | 'label' => __('Background', 'flynt'), |
||
| 76 | 'default' => '#F8F9FD', |
||
| 77 | 'description' => '', |
||
| 78 | ], |
||
| 79 | ], |
||
| 80 | ], |
||
| 81 | 'dark' => [ |
||
| 82 | 'name' => __('Theme Dark', 'flynt'), |
||
| 83 | 'colors' => [ |
||
| 84 | 'accent' => [ |
||
| 85 | 'label' => __('Accent', 'flynt'), |
||
| 86 | 'default' => '#ffffff', |
||
| 87 | 'description' => '', |
||
| 88 | 'hsl' => 1, |
||
| 89 | ], |
||
| 90 | 'headline' => [ |
||
| 91 | 'label' => __('Headline', 'flynt'), |
||
| 92 | 'default' => '#FBFBFB', |
||
| 93 | 'description' => '', |
||
| 94 | ], |
||
| 95 | 'text' => [ |
||
| 96 | 'label' => __('Text', 'flynt'), |
||
| 97 | 'default' => '#E9E9EC', |
||
| 98 | 'description' => '', |
||
| 99 | ], |
||
| 100 | 'border' => [ |
||
| 101 | 'label' => __('Border', 'flynt'), |
||
| 102 | 'default' => '#C3C4F7', |
||
| 103 | 'description' => '', |
||
| 104 | 'hsl' => 1, |
||
| 105 | ], |
||
| 106 | 'background' => [ |
||
| 107 | 'label' => __('Background', 'flynt'), |
||
| 108 | 'default' => '#10205A', |
||
| 109 | 'description' => '', |
||
| 110 | ], |
||
| 111 | ], |
||
| 112 | ], |
||
| 113 | 'hero' => [ |
||
| 114 | 'name' => __('Theme Hero', 'flynt'), |
||
| 115 | 'colors' => [ |
||
| 116 | 'accent' => [ |
||
| 117 | 'label' => __('Accent', 'flynt'), |
||
| 118 | 'default' => '#ffffff', |
||
| 119 | 'description' => '', |
||
| 120 | 'hsl' => 1, |
||
| 121 | ], |
||
| 122 | 'headline' => [ |
||
| 123 | 'label' => __('Headline', 'flynt'), |
||
| 124 | 'default' => '#FBFBFB', |
||
| 125 | 'description' => '', |
||
| 126 | ], |
||
| 127 | 'text' => [ |
||
| 128 | 'label' => __('Text', 'flynt'), |
||
| 129 | 'default' => '#E9E9EC', |
||
| 130 | 'description' => '', |
||
| 131 | ], |
||
| 132 | 'border' => [ |
||
| 133 | 'label' => __('Border', 'flynt'), |
||
| 134 | 'default' => '#CDE2FD', |
||
| 135 | 'description' => '', |
||
| 136 | 'hsl' => 1, |
||
| 137 | ], |
||
| 138 | 'background' => [ |
||
| 139 | 'label' => __('Background', 'flynt'), |
||
| 140 | 'default' => '#2B44DF', |
||
| 141 | 'description' => '', |
||
| 142 | ], |
||
| 143 | ], |
||
| 144 | ], |
||
| 145 | ]; |
||
| 146 | |||
| 147 | return $themes; |
||
| 148 | } |
||
| 250 |