| Conditions | 1 |
| Paths | 1 |
| Total Lines | 101 |
| Code Lines | 81 |
| 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 |
||
| 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 | ], |
||
| 228 |