| Conditions | 1 |
| Paths | 1 |
| Total Lines | 107 |
| Code Lines | 104 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 46 | public static function getNamedToHexMap() |
||
| 47 | { |
||
| 48 | // Named colors longer than hex counterpart |
||
| 49 | return array( |
||
| 50 | 'aliceblue' => '#f0f8ff', |
||
| 51 | 'antiquewhite' => '#faebd7', |
||
| 52 | 'aquamarine' => '#7fffd4', |
||
| 53 | 'black' => '#000', |
||
| 54 | 'blanchedalmond' => '#ffebcd', |
||
| 55 | 'blueviolet' => '#8a2be2', |
||
| 56 | 'burlywood' => '#deb887', |
||
| 57 | 'cadetblue' => '#5f9ea0', |
||
| 58 | 'chartreuse' => '#7fff00', |
||
| 59 | 'chocolate' => '#d2691e', |
||
| 60 | 'cornflowerblue' => '#6495ed', |
||
| 61 | 'cornsilk' => '#fff8dc', |
||
| 62 | 'darkblue' => '#00008b', |
||
| 63 | 'darkcyan' => '#008b8b', |
||
| 64 | 'darkgoldenrod' => '#b8860b', |
||
| 65 | 'darkgray' => '#a9a9a9', |
||
| 66 | 'darkgreen' => '#006400', |
||
| 67 | 'darkgrey' => '#a9a9a9', |
||
| 68 | 'darkkhaki' => '#bdb76b', |
||
| 69 | 'darkmagenta' => '#8b008b', |
||
| 70 | 'darkolivegreen' => '#556b2f', |
||
| 71 | 'darkorange' => '#ff8c00', |
||
| 72 | 'darkorchid' => '#9932cc', |
||
| 73 | 'darksalmon' => '#e9967a', |
||
| 74 | 'darkseagreen' => '#8fbc8f', |
||
| 75 | 'darkslateblue' => '#483d8b', |
||
| 76 | 'darkslategray' => '#2f4f4f', |
||
| 77 | 'darkslategrey' => '#2f4f4f', |
||
| 78 | 'darkturquoise' => '#00ced1', |
||
| 79 | 'darkviolet' => '#9400d3', |
||
| 80 | 'deeppink' => '#ff1493', |
||
| 81 | 'deepskyblue' => '#00bfff', |
||
| 82 | 'dodgerblue' => '#1e90ff', |
||
| 83 | 'firebrick' => '#b22222', |
||
| 84 | 'floralwhite' => '#fffaf0', |
||
| 85 | 'forestgreen' => '#228b22', |
||
| 86 | 'fuchsia' => '#f0f', |
||
| 87 | 'gainsboro' => '#dcdcdc', |
||
| 88 | 'ghostwhite' => '#f8f8ff', |
||
| 89 | 'goldenrod' => '#daa520', |
||
| 90 | 'greenyellow' => '#adff2f', |
||
| 91 | 'honeydew' => '#f0fff0', |
||
| 92 | 'indianred' => '#cd5c5c', |
||
| 93 | 'lavender' => '#e6e6fa', |
||
| 94 | 'lavenderblush' => '#fff0f5', |
||
| 95 | 'lawngreen' => '#7cfc00', |
||
| 96 | 'lemonchiffon' => '#fffacd', |
||
| 97 | 'lightblue' => '#add8e6', |
||
| 98 | 'lightcoral' => '#f08080', |
||
| 99 | 'lightcyan' => '#e0ffff', |
||
| 100 | 'lightgoldenrodyellow' => '#fafad2', |
||
| 101 | 'lightgray' => '#d3d3d3', |
||
| 102 | 'lightgreen' => '#90ee90', |
||
| 103 | 'lightgrey' => '#d3d3d3', |
||
| 104 | 'lightpink' => '#ffb6c1', |
||
| 105 | 'lightsalmon' => '#ffa07a', |
||
| 106 | 'lightseagreen' => '#20b2aa', |
||
| 107 | 'lightskyblue' => '#87cefa', |
||
| 108 | 'lightslategray' => '#778899', |
||
| 109 | 'lightslategrey' => '#778899', |
||
| 110 | 'lightsteelblue' => '#b0c4de', |
||
| 111 | 'lightyellow' => '#ffffe0', |
||
| 112 | 'limegreen' => '#32cd32', |
||
| 113 | 'mediumaquamarine' => '#66cdaa', |
||
| 114 | 'mediumblue' => '#0000cd', |
||
| 115 | 'mediumorchid' => '#ba55d3', |
||
| 116 | 'mediumpurple' => '#9370db', |
||
| 117 | 'mediumseagreen' => '#3cb371', |
||
| 118 | 'mediumslateblue' => '#7b68ee', |
||
| 119 | 'mediumspringgreen' => '#00fa9a', |
||
| 120 | 'mediumturquoise' => '#48d1cc', |
||
| 121 | 'mediumvioletred' => '#c71585', |
||
| 122 | 'midnightblue' => '#191970', |
||
| 123 | 'mintcream' => '#f5fffa', |
||
| 124 | 'mistyrose' => '#ffe4e1', |
||
| 125 | 'moccasin' => '#ffe4b5', |
||
| 126 | 'navajowhite' => '#ffdead', |
||
| 127 | 'olivedrab' => '#6b8e23', |
||
| 128 | 'orangered' => '#ff4500', |
||
| 129 | 'palegoldenrod' => '#eee8aa', |
||
| 130 | 'palegreen' => '#98fb98', |
||
| 131 | 'paleturquoise' => '#afeeee', |
||
| 132 | 'palevioletred' => '#db7093', |
||
| 133 | 'papayawhip' => '#ffefd5', |
||
| 134 | 'peachpuff' => '#ffdab9', |
||
| 135 | 'powderblue' => '#b0e0e6', |
||
| 136 | 'rebeccapurple' => '#663399', |
||
| 137 | 'rosybrown' => '#bc8f8f', |
||
| 138 | 'royalblue' => '#4169e1', |
||
| 139 | 'saddlebrown' => '#8b4513', |
||
| 140 | 'sandybrown' => '#f4a460', |
||
| 141 | 'seagreen' => '#2e8b57', |
||
| 142 | 'seashell' => '#fff5ee', |
||
| 143 | 'slateblue' => '#6a5acd', |
||
| 144 | 'slategray' => '#708090', |
||
| 145 | 'slategrey' => '#708090', |
||
| 146 | 'springgreen' => '#00ff7f', |
||
| 147 | 'steelblue' => '#4682b4', |
||
| 148 | 'turquoise' => '#40e0d0', |
||
| 149 | 'white' => '#fff', |
||
| 150 | 'whitesmoke' => '#f5f5f5', |
||
| 151 | 'yellow' => '#ff0', |
||
| 152 | 'yellowgreen' => '#9acd32' |
||
| 153 | ); |
||
| 156 |