Conditions | 2 |
Paths | 2 |
Total Lines | 59 |
Code Lines | 38 |
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 |
||
39 | public function getHtml(string $indent) |
||
40 | { |
||
41 | // html result. start with an empty string or a html comment |
||
42 | $html = $this->getBuilder()->getHtmlComment('ROW CONTAINER' . ' //', $indent); |
||
43 | |||
44 | $html .= $indent . '<tr>'.PHP_EOL; |
||
45 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
46 | |||
47 | $html .= $this->getBuilder()->getHtmlComment('CENTERING TABLE //', $indent . ' '); |
||
48 | |||
49 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="'. $this->getEffectiveStyle('background-color').'">'.PHP_EOL; |
||
50 | $html .= $indent . ' <tr '. $this->getRowStyle() .'>'.PHP_EOL; |
||
51 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
52 | |||
53 | $html .= $this->getBuilder()->getHtmlComment('FLEXIBLE CONTAINER //', $indent . ' '); |
||
54 | |||
55 | $html .= $indent . ' <table border="0" cellspacing="0" cellpadding="' . $this->cellPadding . |
||
56 | '" bgcolor="'. $this->getEffectiveStyle('background-color'). |
||
57 | '" width="'. $this->getBuilder()->emailBodyWidth() . |
||
58 | '" class="flexibleContainer">'.PHP_EOL; |
||
59 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
60 | $html .= $indent . ' <td '. $this->getRowStyle() . |
||
61 | ' align="center" valign="top" width="'. $this->getBuilder()->emailBodyWidth() . |
||
62 | '" class="flexibleContainerCell">'.PHP_EOL; |
||
63 | |||
64 | $html .= $this->getBuilder()->getHtmlComment('CONTENT TABLE //', $indent . ' '); |
||
65 | |||
66 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%">'.PHP_EOL; |
||
67 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
68 | $html .= $indent . ' <td align="'. $this->horizontalAlign .'" valign="'. $this->verticalAlign .'" style="color:'. $this->getEffectiveStyle('color') . ';" bgcolor="'. $this->getEffectiveStyle('background-color') . '">'.PHP_EOL; |
||
69 | |||
70 | // render child elements collection |
||
71 | foreach ($this->childElements as $element){ |
||
72 | $html .= $element->getHtml($indent . ' '). PHP_EOL; |
||
73 | } |
||
74 | |||
75 | $html .= $indent . ' </td>'.PHP_EOL; |
||
76 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
77 | $html .= $indent . ' </table>'.PHP_EOL; |
||
78 | |||
79 | $html .= $this->getBuilder()->getHtmlComment('// CONTENT TABLE', $indent . ' '); |
||
80 | |||
81 | $html .= $indent . ' </td>'.PHP_EOL; |
||
82 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
83 | $html .= $indent . ' </table>'.PHP_EOL; |
||
84 | |||
85 | $html .= $this->getBuilder()->getHtmlComment('// FLEXIBLE CONTAINER', $indent . ' '); |
||
86 | |||
87 | $html .= $indent . ' </td>'.PHP_EOL; |
||
88 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
89 | $html .= $indent . ' </table>'.PHP_EOL; |
||
90 | |||
91 | $html .= $this->getBuilder()->getHtmlComment('// CENTERING TABLE', $indent . ' '); |
||
92 | |||
93 | $html .= $indent . ' </td>'.PHP_EOL; |
||
94 | $html .= $indent . '</tr>'.PHP_EOL; |
||
95 | |||
96 | $html .= $this->getBuilder()->getHtmlComment('// ' . 'ROW CONTAINER', $indent); |
||
97 | return $html; |
||
98 | } |
||
100 | } |