@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function getBuilder() |
| 60 | 60 | { |
| 61 | 61 | // try with the first level parent |
| 62 | - if ($this->parent instanceof HtmlEmailBuilder){ |
|
| 62 | + if ($this->parent instanceof HtmlEmailBuilder) { |
|
| 63 | 63 | return $this->parent; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -90,21 +90,21 @@ discard block |
||
| 90 | 90 | public function getEffectiveStyle(string $key) |
| 91 | 91 | { |
| 92 | 92 | // first look if key style is defined in this element |
| 93 | - if (array_key_exists($key, $this->styles)){ |
|
| 93 | + if (array_key_exists($key, $this->styles)) { |
|
| 94 | 94 | return $this->styles[$key]; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // look into parent |
| 98 | - if (!$this->parent instanceof HtmlEmailBuilder){ |
|
| 98 | + if (!$this->parent instanceof HtmlEmailBuilder) { |
|
| 99 | 99 | $style = $this->parent->getEffectiveStyle($key); |
| 100 | - if (!empty($style)){ |
|
| 100 | + if (!empty($style)) { |
|
| 101 | 101 | return $style; |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // get default |
| 106 | - if (in_array($key, $this->knowStyles)){ |
|
| 107 | - switch ($key){ |
|
| 106 | + if (in_array($key, $this->knowStyles)) { |
|
| 107 | + switch ($key) { |
|
| 108 | 108 | case 'padding-top': return '0'; |
| 109 | 109 | case 'padding-bottom': return '0'; |
| 110 | 110 | case 'padding-left': return '0'; |
@@ -130,18 +130,18 @@ discard block |
||
| 130 | 130 | protected function getInlineStyles() |
| 131 | 131 | { |
| 132 | 132 | $stylesCollection = []; |
| 133 | - foreach ($this->styles as $key => $value){ |
|
| 134 | - $stylesCollection[] = $key. ':' . $value; |
|
| 133 | + foreach ($this->styles as $key => $value) { |
|
| 134 | + $stylesCollection[] = $key . ':' . $value; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // check for mandatory styles |
| 138 | - foreach ($this->mandatoryStyles as $style){ |
|
| 139 | - if (!array_key_exists($style, $this->styles)){ |
|
| 138 | + foreach ($this->mandatoryStyles as $style) { |
|
| 139 | + if (!array_key_exists($style, $this->styles)) { |
|
| 140 | 140 | $stylesCollection[] = $style . ':' . $this->getEffectiveStyle($style); |
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - return !empty($stylesCollection) ? ' style="'. implode(';', $stylesCollection) .'"' : ''; |
|
| 144 | + return !empty($stylesCollection) ? ' style="' . implode(';', $stylesCollection) . '"' : ''; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | } |
| 148 | 148 | \ No newline at end of file |
@@ -157,14 +157,14 @@ discard block |
||
| 157 | 157 | $html .= '</head>' . PHP_EOL; |
| 158 | 158 | |
| 159 | 159 | // start body (document body, not the email body...), center table |
| 160 | - $html .= '<body bgcolor="'. $this->backsideBackgroundColor .'" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">'. PHP_EOL; |
|
| 160 | + $html .= '<body bgcolor="' . $this->backsideBackgroundColor . '" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">' . PHP_EOL; |
|
| 161 | 161 | |
| 162 | 162 | $html .= $this->getHtmlComment('CENTER THE EMAIL //', ' '); |
| 163 | 163 | |
| 164 | - $html .= ' <center style="background-color:'. $this->backsideBackgroundColor .';">'. PHP_EOL; |
|
| 165 | - $html .= ' <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;">'. PHP_EOL; |
|
| 166 | - $html .= ' <tr>'. PHP_EOL; |
|
| 167 | - $html .= ' <td align="center" valign="top" id="bodyCell">'. PHP_EOL; |
|
| 164 | + $html .= ' <center style="background-color:' . $this->backsideBackgroundColor . ';">' . PHP_EOL; |
|
| 165 | + $html .= ' <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;">' . PHP_EOL; |
|
| 166 | + $html .= ' <tr>' . PHP_EOL; |
|
| 167 | + $html .= ' <td align="center" valign="top" id="bodyCell">' . PHP_EOL; |
|
| 168 | 168 | |
| 169 | 169 | // render child elements collection |
| 170 | 170 | $html .= $this->headerContainer->getHtml(' '); |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | $html .= $this->footerContainer->getHtml(' '); |
| 173 | 173 | |
| 174 | 174 | // close centered table |
| 175 | - $html .= ' </td>'. PHP_EOL; |
|
| 176 | - $html .= ' </tr>'. PHP_EOL; |
|
| 177 | - $html .= ' </table>'. PHP_EOL; |
|
| 175 | + $html .= ' </td>' . PHP_EOL; |
|
| 176 | + $html .= ' </tr>' . PHP_EOL; |
|
| 177 | + $html .= ' </table>' . PHP_EOL; |
|
| 178 | 178 | $html .= $this->getHtmlComment('// CENTER THE EMAIL', ' '); |
| 179 | - $html .= ' </center>'. PHP_EOL; |
|
| 179 | + $html .= ' </center>' . PHP_EOL; |
|
| 180 | 180 | |
| 181 | 181 | // close body and html tags and returns html |
| 182 | 182 | $html .= '</body>' . PHP_EOL; |