| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 61 | 
| Code Lines | 40 | 
| 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 | ||
| 97 | public function getHtml(string $indent) | ||
| 98 |     { | ||
| 99 | // html result. start with an empty string or a html comment | ||
| 100 |         $html  = $this->getBuilder()->getHtmlComment('ROW TWO COLUMNS CONTAINER' . ' //', $indent); | ||
| 101 | |||
| 102 | $html .= $indent . '<tr>'.PHP_EOL; | ||
| 103 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; | ||
| 104 | |||
| 105 |         $html .= $this->getBuilder()->getHtmlComment('CENTERING TABLE //', $indent . '    '); | ||
| 106 | |||
| 107 |         $html .= $indent . '    <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="'. $this->getEffectiveStyle('background-color').'">'.PHP_EOL; | ||
| 108 | $html .= $indent . ' <tr'. $this->getRowStyle() .'>'.PHP_EOL; | ||
| 109 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; | ||
| 110 | |||
| 111 |         $html .= $this->getBuilder()->getHtmlComment('FLEXIBLE CONTAINER //', $indent . '          '); | ||
| 112 | |||
| 113 | $html .= $indent . ' <table border="0" cellspacing="0" cellpadding="'. $this->cellPadding . | ||
| 114 |                                         '" bgcolor="'. $this->getEffectiveStyle('background-color'). | ||
| 115 | '" width="'. $this->getBuilder()->emailBodyWidth() . | ||
| 116 | '" class="flexibleContainer">'.PHP_EOL; | ||
| 117 | $html .= $indent . ' <tr>'.PHP_EOL; | ||
| 118 | $html .= $indent . ' <td'.$this->getRowStyle(). | ||
| 119 | ' align="center" valign="top" width="'. $this->getBuilder()->emailBodyWidth() . | ||
| 120 | '" class="flexibleContainerCell">'.PHP_EOL; | ||
| 121 | |||
| 122 |         $html .= $this->getBuilder()->getHtmlComment('CONTENT TABLE //', $indent . '               '); | ||
| 123 | |||
| 124 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%">'.PHP_EOL; | ||
| 125 | $html .= $indent . ' <tr>'.PHP_EOL; | ||
| 126 | |||
| 127 |         $html .= $this->getBuilder()->getHtmlComment('COLUMN LEFT //', $indent . '                    '); | ||
| 128 | $html .= $this->leftColumn()->getHtml($indent . ' '); | ||
| 129 |         $html .= $this->getBuilder()->getHtmlComment('// COLUMN LEFT', $indent . '                    '); | ||
| 130 | |||
| 131 |         $html .= $this->getBuilder()->getHtmlComment('COLUMN RIGHT //', $indent. '                    '); | ||
| 132 | $html .= $this->rightColumn()->getHtml($indent . ' '); | ||
| 133 |         $html .= $this->getBuilder()->getHtmlComment('// COLUMN RIGHT', $indent. '                    '); | ||
| 134 | |||
| 135 | |||
| 136 | $html .= $indent . ' </tr>'.PHP_EOL; | ||
| 137 | $html .= $indent . ' </table>'.PHP_EOL; | ||
| 138 | |||
| 139 |         $html .= $this->getBuilder()->getHtmlComment('// CONTENT TABLE', $indent . '               '); | ||
| 140 | |||
| 141 | $html .= $indent . ' </td>'.PHP_EOL; | ||
| 142 | $html .= $indent . ' </tr>'.PHP_EOL; | ||
| 143 | $html .= $indent . ' </table>'.PHP_EOL; | ||
| 144 | |||
| 145 |         $html .= $this->getBuilder()->getHtmlComment('// FLEXIBLE CONTAINER', $indent . '          '); | ||
| 146 | |||
| 147 | $html .= $indent . ' </td>'.PHP_EOL; | ||
| 148 | $html .= $indent . ' </tr>'.PHP_EOL; | ||
| 149 | $html .= $indent . ' </table>'.PHP_EOL; | ||
| 150 | |||
| 151 |         $html .= $this->getBuilder()->getHtmlComment('// CENTERING TABLE', $indent . '    '); | ||
| 152 | |||
| 153 | $html .= $indent . ' </td>'.PHP_EOL; | ||
| 154 | $html .= $indent . '</tr>'.PHP_EOL; | ||
| 155 | |||
| 156 |         $html .= $this->getBuilder()->getHtmlComment('// ' . 'ROW TWO COLUMNS CONTAINER', $indent); | ||
| 157 | return $html; | ||
| 158 | } | ||
| 160 | } |