Conditions | 2 |
Paths | 2 |
Total Lines | 73 |
Code Lines | 71 |
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 |
||
15 | public function clear() |
||
16 | { |
||
17 | unset($this->css); |
||
18 | $this->css = []; |
||
19 | if ($this->html) { |
||
20 | $this->add("ADDRESS", ""); |
||
21 | $this->add("APPLET", ""); |
||
22 | $this->add("AREA", ""); |
||
23 | $this->add("A", "text-decoration : underline; color : Blue;"); |
||
24 | $this->add("A:visited", "color : Purple;"); |
||
25 | $this->add("BASE", ""); |
||
26 | $this->add("BASEFONT", ""); |
||
27 | $this->add("BIG", ""); |
||
28 | $this->add("BLOCKQUOTE", ""); |
||
29 | $this->add("BODY", ""); |
||
30 | $this->add("BR", ""); |
||
31 | $this->add("B", "font-weight: bold;"); |
||
32 | $this->add("CAPTION", ""); |
||
33 | $this->add("CENTER", ""); |
||
34 | $this->add("CITE", ""); |
||
35 | $this->add("CODE", ""); |
||
36 | $this->add("DD", ""); |
||
37 | $this->add("DFN", ""); |
||
38 | $this->add("DIR", ""); |
||
39 | $this->add("DIV", ""); |
||
40 | $this->add("DL", ""); |
||
41 | $this->add("DT", ""); |
||
42 | $this->add("EM", ""); |
||
43 | $this->add("FONT", ""); |
||
44 | $this->add("FORM", ""); |
||
45 | $this->add("H1", ""); |
||
46 | $this->add("H2", ""); |
||
47 | $this->add("H3", ""); |
||
48 | $this->add("H4", ""); |
||
49 | $this->add("H5", ""); |
||
50 | $this->add("H6", ""); |
||
51 | $this->add("HEAD", ""); |
||
52 | $this->add("HR", ""); |
||
53 | $this->add("HTML", ""); |
||
54 | $this->add("IMG", ""); |
||
55 | $this->add("INPUT", ""); |
||
56 | $this->add("ISINDEX", ""); |
||
57 | $this->add("I", "font-style: italic;"); |
||
58 | $this->add("KBD", ""); |
||
59 | $this->add("LINK", ""); |
||
60 | $this->add("LI", ""); |
||
61 | $this->add("MAP", ""); |
||
62 | $this->add("MENU", ""); |
||
63 | $this->add("META", ""); |
||
64 | $this->add("OL", ""); |
||
65 | $this->add("OPTION", ""); |
||
66 | $this->add("PARAM", ""); |
||
67 | $this->add("PRE", ""); |
||
68 | $this->add("P", ""); |
||
69 | $this->add("SAMP", ""); |
||
70 | $this->add("SCRIPT", ""); |
||
71 | $this->add("SELECT", ""); |
||
72 | $this->add("SMALL", ""); |
||
73 | $this->add("STRIKE", ""); |
||
74 | $this->add("STRONG", ""); |
||
75 | $this->add("STYLE", ""); |
||
76 | $this->add("SUB", ""); |
||
77 | $this->add("SUP", ""); |
||
78 | $this->add("TABLE", ""); |
||
79 | $this->add("TD", ""); |
||
80 | $this->add("TEXTAREA", ""); |
||
81 | $this->add("TH", ""); |
||
82 | $this->add("TITLE", ""); |
||
83 | $this->add("TR", ""); |
||
84 | $this->add("TT", ""); |
||
85 | $this->add("UL", ""); |
||
86 | $this->add("U", "text-decoration : underline;"); |
||
87 | $this->add("VAR", ""); |
||
88 | } |
||
270 |