Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
Code Lines | 37 |
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 |
||
68 | public function getHtml(string $indent) |
||
69 | { |
||
70 | // html result. start with an empty string or a html comment |
||
71 | $html = $this->getBuilder()->getHtmlComment('ROW IMAGE CONTAINER' . ' //', $indent); |
||
72 | |||
73 | $html .= $indent . '<tr>'.PHP_EOL; |
||
74 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
75 | |||
76 | $html .= $this->getBuilder()->getHtmlComment('CENTERING TABLE //', $indent . ' '); |
||
77 | |||
78 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="'. $this->getEffectiveStyle('background-color').'">'.PHP_EOL; |
||
79 | $html .= $indent . ' <tr '.$this->getRowStyle() .'>'.PHP_EOL; |
||
80 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
81 | |||
82 | $html .= $this->getBuilder()->getHtmlComment('FLEXIBLE CONTAINER //', $indent . ' '); |
||
83 | |||
84 | $html .= $indent . ' <table border="0" cellspacing="0" cellpadding="' . $this->cellPadding . |
||
85 | '" bgcolor="'. $this->getEffectiveStyle('background-color'). |
||
86 | '" width="'. $this->getBuilder()->emailBodyWidth() . |
||
87 | '" class="flexibleContainer">'.PHP_EOL; |
||
88 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
89 | $html .= $indent . ' <td '. $this->getRowStyle() . |
||
90 | ' align="center" valign="top" width="'. $this->getBuilder()->emailBodyWidth() . |
||
91 | '" class="flexibleContainerCell">'.PHP_EOL; |
||
92 | |||
93 | $html .= $this->getBuilder()->getHtmlComment('CONTENT TABLE //', $indent . ' '); |
||
94 | |||
95 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%">'.PHP_EOL; |
||
96 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
97 | $html .= $indent . ' <td valign="top" class="imageContent" color="'. $this->getEffectiveStyle('color') . '" bgcolor="'. $this->getEffectiveStyle('background-color') . '">'.PHP_EOL; |
||
98 | |||
99 | $html .= $this->image->getHtml($indent . ' ').PHP_EOL;; |
||
100 | |||
101 | $html .= $indent . ' </td>'.PHP_EOL; |
||
102 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
103 | $html .= $indent . ' </table>'.PHP_EOL; |
||
104 | |||
105 | $html .= $this->getBuilder()->getHtmlComment('// CONTENT TABLE', $indent . ' '); |
||
106 | |||
107 | $html .= $indent . ' </td>'.PHP_EOL; |
||
108 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
109 | $html .= $indent . ' </table>'.PHP_EOL; |
||
110 | |||
111 | $html .= $this->getBuilder()->getHtmlComment('// FLEXIBLE CONTAINER', $indent . ' '); |
||
112 | |||
113 | $html .= $indent . ' </td>'.PHP_EOL; |
||
114 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
115 | $html .= $indent . ' </table>'.PHP_EOL; |
||
116 | |||
117 | $html .= $this->getBuilder()->getHtmlComment('// CENTERING TABLE', $indent . ' '); |
||
118 | |||
119 | $html .= $indent . ' </td>'.PHP_EOL; |
||
120 | $html .= $indent . '</tr>'.PHP_EOL; |
||
121 | |||
122 | $html .= $this->getBuilder()->getHtmlComment('// ' . 'ROW IMAGE CONTAINER', $indent); |
||
123 | return $html; |
||
124 | } |
||
126 | } |