| Conditions | 1 |
| Paths | 1 |
| Total Lines | 71 |
| Code Lines | 51 |
| 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 |
||
| 108 | public function getHtml(string $indent) |
||
| 109 | { |
||
| 110 | // html result. start with an empty string or a html comment |
||
| 111 | $html = $this->getBuilder()->getHtmlComment('ROW BUTTON ' . ' //', $indent); |
||
| 112 | |||
| 113 | $html .= $indent . '<tr>'.PHP_EOL; |
||
| 114 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
| 115 | |||
| 116 | $html .= $this->getBuilder()->getHtmlComment('CENTERING TABLE //', $indent . ' '); |
||
| 117 | |||
| 118 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="100%">'.PHP_EOL; |
||
| 119 | $html .= $indent . ' <tr '. $this->getRowStyle() .'>'.PHP_EOL; |
||
| 120 | $html .= $indent . ' <td align="center" valign="top">'.PHP_EOL; |
||
| 121 | |||
| 122 | $html .= $this->getBuilder()->getHtmlComment('FLEXIBLE CONTAINER //', $indent . ' '); |
||
| 123 | |||
| 124 | $html .= $indent . ' <table border="0" cellpadding="' . $this->cellPadding. |
||
| 125 | '" cellspacing="0" width="'. $this->getBuilder()->emailBodyWidth() . |
||
| 126 | '" class="flexibleContainer">'.PHP_EOL; |
||
| 127 | |||
| 128 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
| 129 | $html .= $indent . ' <td '. $this->getRowStyle() . |
||
| 130 | ' align="center" valign="top" width="'. $this->getBuilder()->emailBodyWidth() . |
||
| 131 | '" class="flexibleContainerCell">'.PHP_EOL; |
||
| 132 | |||
| 133 | $html .= $this->getBuilder()->getHtmlComment('CONTENT TABLE //', $indent . ' '); |
||
| 134 | |||
| 135 | $html .= $indent . ' <table border="0" cellpadding="0" cellspacing="0" width="50%"'. |
||
| 136 | ' class="emailButton" style="background-color: '. |
||
| 137 | $this->getEffectiveStyle('background-color') . ';">'.PHP_EOL; |
||
| 138 | |||
| 139 | $html .= $indent . ' <tr>'.PHP_EOL; |
||
| 140 | $html .= $indent . ' <td align="center" valign="middle" class="buttonContent" cellpadding="0" '. |
||
| 141 | 'bgcolor="'.$this->getEffectiveStyle('button_background').'"'. |
||
| 142 | ' style="'. |
||
| 143 | 'padding-top:' . $this->getEffectiveStyle('button_padding'). 'px;'. |
||
| 144 | 'padding-bottom:' . $this->getEffectiveStyle('button_padding'). 'px;'. |
||
| 145 | 'padding-left:' . $this->getEffectiveStyle('button_padding'). 'px;'. |
||
| 146 | 'padding-right:' . $this->getEffectiveStyle('button_padding'). 'px;'. |
||
| 147 | '"'. |
||
| 148 | '>'.PHP_EOL; |
||
| 149 | $html .= $indent . ' <a style="color:'. $this->getEffectiveStyle('button_color') . |
||
| 150 | ';text-decoration:none;font-family:' . $this->getEffectiveStyle('font') . |
||
| 151 | ';font-size:20px;line-height:135%;" ' . |
||
| 152 | 'href="' . $this->buttonSrc . '" target="_blank">' . |
||
| 153 | $this->buttonText . |
||
| 154 | '</a>'.PHP_EOL; |
||
| 155 | |||
| 156 | $html .= $indent . ' </td>'.PHP_EOL; |
||
| 157 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
| 158 | $html .= $indent . ' </table>'.PHP_EOL; |
||
| 159 | |||
| 160 | $html .= $this->getBuilder()->getHtmlComment('// CONTENT TABLE', $indent . ' '); |
||
| 161 | |||
| 162 | $html .= $indent . ' </td>'.PHP_EOL; |
||
| 163 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
| 164 | $html .= $indent . ' </table>'.PHP_EOL; |
||
| 165 | |||
| 166 | $html .= $this->getBuilder()->getHtmlComment('// FLEXIBLE CONTAINER', $indent . ' '); |
||
| 167 | |||
| 168 | $html .= $indent . ' </td>'.PHP_EOL; |
||
| 169 | $html .= $indent . ' </tr>'.PHP_EOL; |
||
| 170 | $html .= $indent . ' </table>'.PHP_EOL; |
||
| 171 | |||
| 172 | $html .= $this->getBuilder()->getHtmlComment('// CENTERING TABLE', $indent . ' '); |
||
| 173 | |||
| 174 | $html .= $indent . ' </td>'.PHP_EOL; |
||
| 175 | $html .= $indent . '</tr>'.PHP_EOL; |
||
| 176 | |||
| 177 | $html .= $this->getBuilder()->getHtmlComment('// ' . 'ROW BUTTON', $indent); |
||
| 178 | return $html; |
||
| 179 | } |
||
| 181 | } |