Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 41 | class EMailTemplate implements IEMailTemplate { |
||
| 42 | /** @var Defaults */ |
||
| 43 | protected $themingDefaults; |
||
| 44 | /** @var IURLGenerator */ |
||
| 45 | protected $urlGenerator; |
||
| 46 | /** @var IL10N */ |
||
| 47 | protected $l10n; |
||
| 48 | |||
| 49 | /** @var string */ |
||
| 50 | protected $htmlBody = ''; |
||
| 51 | /** @var string */ |
||
| 52 | protected $plainBody = ''; |
||
| 53 | /** @var bool indicated if the footer is added */ |
||
| 54 | protected $headerAdded = false; |
||
| 55 | /** @var bool indicated if the body is already opened */ |
||
| 56 | protected $bodyOpened = false; |
||
| 57 | /** @var bool indicated if the footer is added */ |
||
| 58 | protected $footerAdded = false; |
||
| 59 | |||
| 60 | protected $head = <<<EOF |
||
| 61 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||
| 62 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="-webkit-font-smoothing:antialiased;background:#f3f3f3!important"> |
||
| 63 | <head> |
||
| 64 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||
| 65 | <meta name="viewport" content="width=device-width"> |
||
| 66 | <title></title> |
||
| 67 | <style type="text/css">@media only screen{html{min-height:100%;background:#F5F5F5}}@media only screen and (max-width:610px){table.body img{width:auto;height:auto}table.body center{min-width:0!important}table.body .container{width:95%!important}table.body .columns{height:auto!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:30px!important;padding-right:30px!important}th.small-12{display:inline-block!important;width:100%!important}table.menu{width:100%!important}table.menu td,table.menu th{width:auto!important;display:inline-block!important}table.menu.vertical td,table.menu.vertical th{display:block!important}table.menu[align=center]{width:auto!important}}</style> |
||
| 68 | </head> |
||
| 69 | <body style="-moz-box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;Margin:0;background:#f3f3f3!important;box-sizing:border-box;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;min-width:100%;padding:0;text-align:left;width:100%!important"> |
||
| 70 | <span class="preheader" style="color:#F5F5F5;display:none!important;font-size:1px;line-height:1px;max-height:0;max-width:0;mso-hide:all!important;opacity:0;overflow:hidden;visibility:hidden"> |
||
| 71 | </span> |
||
| 72 | <table class="body" style="-webkit-font-smoothing:antialiased;Margin:0;background:#f3f3f3!important;border-collapse:collapse;border-spacing:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;width:100%"> |
||
| 73 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 74 | <td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 75 | <center data-parsed="" style="min-width:580px;width:100%"> |
||
| 76 | EOF; |
||
| 77 | |||
| 78 | protected $tail = <<<EOF |
||
| 79 | </center> |
||
| 80 | </td> |
||
| 81 | </tr> |
||
| 82 | </table> |
||
| 83 | <!-- prevent Gmail on iOS font size manipulation --> |
||
| 84 | <div style="display:none;white-space:nowrap;font:15px courier;line-height:0"> </div> |
||
| 85 | </body> |
||
| 86 | </html> |
||
| 87 | EOF; |
||
| 88 | |||
| 89 | protected $header = <<<EOF |
||
| 90 | <table align="center" class="wrapper header float-center" style="Margin:0 auto;background:#8a8a8a;background-color:%s;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 91 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 92 | <td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:20px;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 93 | <table align="center" class="container" style="Margin:0 auto;background:0 0;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:580px"> |
||
| 94 | <tbody> |
||
| 95 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 96 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 97 | <table class="row collapse" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%%"> |
||
| 98 | <tbody> |
||
| 99 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 100 | <center data-parsed="" style="min-width:580px;width:100%%"> |
||
| 101 | <img class="logo float-center" src="%s" alt="%s" align="center" style="-ms-interpolation-mode:bicubic;Margin:0 auto;clear:both;display:block;float:none;margin:0 auto;max-height:100%%;max-width:100px;outline:0;text-align:center;text-decoration:none;width:auto"> |
||
| 102 | </center> |
||
| 103 | </tr> |
||
| 104 | </tbody> |
||
| 105 | </table> |
||
| 106 | </td> |
||
| 107 | </tr> |
||
| 108 | </tbody> |
||
| 109 | </table> |
||
| 110 | </td> |
||
| 111 | </tr> |
||
| 112 | </table> |
||
| 113 | <table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 114 | <tbody> |
||
| 115 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 116 | <td height="80px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:80px;font-weight:400;hyphens:auto;line-height:80px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 117 | </tr> |
||
| 118 | </tbody> |
||
| 119 | </table> |
||
| 120 | EOF; |
||
| 121 | |||
| 122 | protected $heading = <<<EOF |
||
| 123 | <table align="center" class="container main-heading float-center" style="Margin:0 auto;background:0 0!important;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:580px"> |
||
| 124 | <tbody> |
||
| 125 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 126 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 127 | <h1 class="text-center" style="Margin:0;Margin-bottom:10px;color:inherit;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:24px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center;word-wrap:normal">%s</h1> |
||
| 128 | </td> |
||
| 129 | </tr> |
||
| 130 | </tbody> |
||
| 131 | </table> |
||
| 132 | <table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 133 | <tbody> |
||
| 134 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 135 | <td height="40px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:40px;font-weight:400;hyphens:auto;line-height:40px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 136 | </tr> |
||
| 137 | </tbody> |
||
| 138 | </table> |
||
| 139 | EOF; |
||
| 140 | |||
| 141 | protected $bodyBegin = <<<EOF |
||
| 142 | <table align="center" class="wrapper content float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%"> |
||
| 143 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 144 | <td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 145 | <table align="center" class="container has-shadow" style="Margin:0 auto;background:#fefefe;border-collapse:collapse;border-spacing:0;box-shadow:0 1px 2px 0 rgba(0,0,0,.2),0 1px 3px 0 rgba(0,0,0,.1);margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:580px"> |
||
| 146 | <tbody> |
||
| 147 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 148 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 149 | <table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%"> |
||
| 150 | <tbody> |
||
| 151 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 152 | <td height="60px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:60px;font-weight:400;hyphens:auto;line-height:60px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 153 | </tr> |
||
| 154 | </tbody> |
||
| 155 | </table> |
||
| 156 | EOF; |
||
| 157 | |||
| 158 | protected $bodyText = <<<EOF |
||
| 159 | <table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%%"> |
||
| 160 | <tbody> |
||
| 161 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 162 | <th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px"> |
||
| 163 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 164 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 165 | <th style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left"> |
||
| 166 | <p class="text-left" style="Margin:0;Margin-bottom:10px;color:#777;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:left">%s</p> |
||
| 167 | </th> |
||
| 168 | <th class="expander" style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th> |
||
| 169 | </tr> |
||
| 170 | </table> |
||
| 171 | </th> |
||
| 172 | </tr> |
||
| 173 | </tbody> |
||
| 174 | </table> |
||
| 175 | EOF; |
||
| 176 | |||
| 177 | protected $buttonGroup = <<<EOF |
||
| 178 | <table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 179 | <tbody> |
||
| 180 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 181 | <td height="50px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:50px;font-weight:400;hyphens:auto;line-height:50px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 182 | </tr> |
||
| 183 | </tbody> |
||
| 184 | </table> |
||
| 185 | <table align="center" class="row btn-group" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%%"> |
||
| 186 | <tbody> |
||
| 187 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 188 | <th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px"> |
||
| 189 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 190 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 191 | <th style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left"> |
||
| 192 | <center data-parsed="" style="min-width:490px;width:100%%"> |
||
| 193 | <table class="button btn default primary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;margin-right:15px;max-height:40px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto"> |
||
| 194 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 195 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 196 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 197 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 198 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:%s;border:0 solid %s;border-collapse:collapse!important;color:#fefefe;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 199 | <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:#fefefe;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">%s</a> |
||
| 200 | </td> |
||
| 201 | </tr> |
||
| 202 | </table> |
||
| 203 | </td> |
||
| 204 | </tr> |
||
| 205 | </table> |
||
| 206 | <table class="button btn default secondary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;max-height:40px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto"> |
||
| 207 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 208 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 209 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 210 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 211 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:#777;border:0 solid #777;border-collapse:collapse!important;color:#fefefe;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 212 | <a href="%s" style="Margin:0;background-color:#fff;border:0 solid #777;border-radius:2px;color:#6C6C6C!important;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;outline:1px solid #CBCBCB;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">%s</a> |
||
| 213 | </td> |
||
| 214 | </tr> |
||
| 215 | </table> |
||
| 216 | </td> |
||
| 217 | </tr> |
||
| 218 | </table> |
||
| 219 | </center> |
||
| 220 | </th> |
||
| 221 | <th class="expander" style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th> |
||
| 222 | </tr> |
||
| 223 | </table> |
||
| 224 | </th> |
||
| 225 | </tr> |
||
| 226 | </tbody> |
||
| 227 | </table> |
||
| 228 | EOF; |
||
| 229 | |||
| 230 | protected $button = <<<EOF |
||
| 231 | <table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 232 | <tbody> |
||
| 233 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 234 | <td height="50px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:50px;font-weight:400;hyphens:auto;line-height:50px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 235 | </tr> |
||
| 236 | </tbody> |
||
| 237 | </table> |
||
| 238 | <table align="center" class="row btn-group" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%%"> |
||
| 239 | <tbody> |
||
| 240 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 241 | <th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px"> |
||
| 242 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 243 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 244 | <th style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left"> |
||
| 245 | <center data-parsed="" style="min-width:490px;width:100%%"> |
||
| 246 | <table class="button btn default primary float-center" style="Margin:0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0;max-height:40px;padding:0;text-align:center;vertical-align:top;width:auto"> |
||
| 247 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 248 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 249 | <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%"> |
||
| 250 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 251 | <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:%s;border:0 solid %s;border-collapse:collapse!important;color:#fefefe;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 252 | <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:#fefefe;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">%s</a> |
||
| 253 | </td> |
||
| 254 | </tr> |
||
| 255 | </table> |
||
| 256 | </td> |
||
| 257 | </tr> |
||
| 258 | </table> |
||
| 259 | </center> |
||
| 260 | </th> |
||
| 261 | <th class="expander" style="Margin:0;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th> |
||
| 262 | </tr> |
||
| 263 | </table> |
||
| 264 | </th> |
||
| 265 | </tr> |
||
| 266 | </tbody> |
||
| 267 | </table> |
||
| 268 | EOF; |
||
| 269 | |||
| 270 | protected $bodyEnd = <<<EOF |
||
| 271 | |||
| 272 | </td> |
||
| 273 | </tr> |
||
| 274 | </tbody> |
||
| 275 | </table> |
||
| 276 | </td> |
||
| 277 | </tr> |
||
| 278 | </table> |
||
| 279 | EOF; |
||
| 280 | |||
| 281 | protected $footer = <<<EOF |
||
| 282 | <table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 283 | <tbody> |
||
| 284 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 285 | <td height="60px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:60px;font-weight:400;hyphens:auto;line-height:60px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 286 | </tr> |
||
| 287 | </tbody> |
||
| 288 | </table> |
||
| 289 | <table align="center" class="wrapper footer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 290 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 291 | <td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> |
||
| 292 | <center data-parsed="" style="min-width:580px;width:100%%"> |
||
| 293 | <table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%%"> |
||
| 294 | <tbody> |
||
| 295 | <tr style="padding:0;text-align:left;vertical-align:top"> |
||
| 296 | <td height="15px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:15px;font-weight:400;hyphens:auto;line-height:15px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td> |
||
| 297 | </tr> |
||
| 298 | </tbody> |
||
| 299 | </table> |
||
| 300 | <p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">%s</p> |
||
| 301 | </center> |
||
| 302 | </td> |
||
| 303 | </tr> |
||
| 304 | </table> |
||
| 305 | EOF; |
||
| 306 | |||
| 307 | /** |
||
| 308 | * @param Defaults $themingDefaults |
||
| 309 | * @param IURLGenerator $urlGenerator |
||
| 310 | * @param IL10N $l10n |
||
| 311 | */ |
||
| 312 | public function __construct(Defaults $themingDefaults, |
||
| 320 | |||
| 321 | /** |
||
| 322 | * Adds a header to the email |
||
| 323 | */ |
||
| 324 | public function addHeader() { |
||
| 333 | |||
| 334 | /** |
||
| 335 | * Adds a heading to the email |
||
| 336 | * |
||
| 337 | * @param string $title |
||
| 338 | * @param string $plainTitle|bool Title that is used in the plain text email |
||
|
|
|||
| 339 | * if empty the $title is used, if false none will be used |
||
| 340 | */ |
||
| 341 | public function addHeading($title, $plainTitle = '') { |
||
| 354 | |||
| 355 | /** |
||
| 356 | * Adds a paragraph to the body of the email |
||
| 357 | * |
||
| 358 | * @param string $text |
||
| 359 | * @param string|bool $plainText Text that is used in the plain text email |
||
| 360 | * if empty the $text is used, if false none will be used |
||
| 361 | */ |
||
| 362 | public function addBodyText($text, $plainText = '') { |
||
| 380 | |||
| 381 | /** |
||
| 382 | * Adds a button group of two buttons to the body of the email |
||
| 383 | * |
||
| 384 | * @param string $textLeft Text of left button |
||
| 385 | * @param string $urlLeft URL of left button |
||
| 386 | * @param string $textRight Text of right button |
||
| 387 | * @param string $urlRight URL of right button |
||
| 388 | * @param string $plainTextLeft Text of left button that is used in the plain text version - if unset the $textLeft is used |
||
| 389 | * @param string $plainTextRight Text of right button that is used in the plain text version - if unset the $textRight is used |
||
| 390 | */ |
||
| 391 | public function addBodyButtonGroup($textLeft, |
||
| 420 | |||
| 421 | /** |
||
| 422 | * Adds a button to the body of the email |
||
| 423 | * |
||
| 424 | * @param string $text Text of button |
||
| 425 | * @param string $url URL of button |
||
| 426 | * @param string $plainText Text of button in plain text version |
||
| 427 | * if empty the $text is used, if false none will be used |
||
| 428 | * |
||
| 429 | * @since 12.0.0 |
||
| 430 | */ |
||
| 431 | public function addBodyButton($text, $url, $plainText = '') { |
||
| 455 | |||
| 456 | /** |
||
| 457 | * Adds a logo and a text to the footer. <br> in the text will be replaced by new lines in the plain text email |
||
| 458 | * |
||
| 459 | * @param string $text If the text is empty the default "Name - Slogan<br>This is an automatically generated email" will be used |
||
| 460 | */ |
||
| 461 | public function addFooter($text = '') { |
||
| 481 | |||
| 482 | /** |
||
| 483 | * Returns the rendered HTML email as string |
||
| 484 | * |
||
| 485 | * @return string |
||
| 486 | */ |
||
| 487 | View Code Duplication | public function renderHTML() { |
|
| 497 | |||
| 498 | /** |
||
| 499 | * Returns the rendered plain text email as string |
||
| 500 | * |
||
| 501 | * @return string |
||
| 502 | */ |
||
| 503 | View Code Duplication | public function renderText() { |
|
| 513 | } |
||
| 514 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$irelandis not defined by the methodfinale(...).The most likely cause is that the parameter was changed, but the annotation was not.