| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 130 | 
| Code Lines | 98 | 
| 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 | ], | ||
| 41 | 'background' => [ | ||
| 42 |                     'label'       => __('Background', 'flynt'), | ||
| 43 | 'default' => '#ffffff', | ||
| 44 | 'description' => '', | ||
| 45 | ], | ||
| 46 | ], | ||
| 47 | ], | ||
| 48 | 'light' => [ | ||
| 49 |             'name' => __('Theme Light', 'flynt'), | ||
| 50 | 'colors' => [ | ||
| 51 | 'accent' => [ | ||
| 52 |                     'label'       => __('Accent', 'flynt'), | ||
| 53 | 'default' => '#2b44df', | ||
| 54 | 'description' => '', | ||
| 55 | 'hsl' => 1, | ||
| 56 | ], | ||
| 57 | 'headline' => [ | ||
| 58 |                     'label'       => __('Headline', 'flynt'), | ||
| 59 | 'default' => '#252525', | ||
| 60 | 'description' => '', | ||
| 61 | ], | ||
| 62 | 'text' => [ | ||
| 63 |                     'label'       => __('Text', 'flynt'), | ||
| 64 | 'default' => '#353535', | ||
| 65 | 'description' => '', | ||
| 66 | ], | ||
| 67 | 'border' => [ | ||
| 68 |                     'label'       => __('Border', 'flynt'), | ||
| 69 | 'default' => '#8791BA', | ||
| 70 | 'description' => '', | ||
| 71 | ], | ||
| 72 | 'background' => [ | ||
| 73 |                     'label'       => __('Background', 'flynt'), | ||
| 74 | 'default' => '#F8F9FD', | ||
| 75 | 'description' => '', | ||
| 76 | ], | ||
| 77 | ], | ||
| 78 | ], | ||
| 79 | 'dark' => [ | ||
| 80 |             'name' => __('Theme Dark', 'flynt'), | ||
| 81 | 'colors' => [ | ||
| 82 | 'accent' => [ | ||
| 83 |                     'label'       => __('Accent', 'flynt'), | ||
| 84 | 'default' => '#ffffff', | ||
| 85 | 'description' => '', | ||
| 86 | 'hsl' => 1, | ||
| 87 | ], | ||
| 88 | 'headline' => [ | ||
| 89 |                     'label'       => __('Headline', 'flynt'), | ||
| 90 | 'default' => '#FBFBFB', | ||
| 91 | 'description' => '', | ||
| 92 | ], | ||
| 93 | 'text' => [ | ||
| 94 |                     'label'       => __('Text', 'flynt'), | ||
| 95 | 'default' => '#E9E9EC', | ||
| 96 | 'description' => '', | ||
| 97 | ], | ||
| 98 | 'border' => [ | ||
| 99 |                     'label'       => __('Border', 'flynt'), | ||
| 100 | 'default' => '#C3C4F7', | ||
| 101 | 'description' => '', | ||
| 102 | ], | ||
| 103 | 'background' => [ | ||
| 104 |                     'label'       => __('Background', 'flynt'), | ||
| 105 | 'default' => '#10205A', | ||
| 106 | 'description' => '', | ||
| 107 | ], | ||
| 108 | ], | ||
| 109 | ], | ||
| 110 | 'hero' => [ | ||
| 111 |             'name' => __('Theme Hero', 'flynt'), | ||
| 112 | 'colors' => [ | ||
| 113 | 'accent' => [ | ||
| 114 |                     'label'       => __('Accent', 'flynt'), | ||
| 115 | 'default' => '#ffffff', | ||
| 116 | 'description' => '', | ||
| 117 | 'hsl' => 1, | ||
| 118 | ], | ||
| 119 | 'headline' => [ | ||
| 120 |                     'label'       => __('Headline', 'flynt'), | ||
| 121 | 'default' => '#FBFBFB', | ||
| 122 | 'description' => '', | ||
| 123 | ], | ||
| 124 | 'text' => [ | ||
| 125 |                     'label'       => __('Text', 'flynt'), | ||
| 126 | 'default' => '#E9E9EC', | ||
| 127 | 'description' => '', | ||
| 128 | ], | ||
| 129 | 'border' => [ | ||
| 130 |                     'label'       => __('Border', 'flynt'), | ||
| 131 | 'default' => '#CDE2FD', | ||
| 132 | 'description' => '', | ||
| 133 | ], | ||
| 134 | 'background' => [ | ||
| 135 |                     'label'       => __('Background', 'flynt'), | ||
| 136 | 'default' => '#2B44DF', | ||
| 137 | 'description' => '', | ||
| 138 | ], | ||
| 139 | ], | ||
| 140 | ], | ||
| 141 | ]; | ||
| 142 | |||
| 143 | return $themes; | ||
| 144 | } | ||
| 246 |