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