Skip to content

Commit f48eed5

Browse files
AC-2391: Remove legacy variable resolver from email template processor
1 parent 75c9c84 commit f48eed5

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
3131
/**
3232
* Default design area for emulation
3333
*/
34-
const DEFAULT_DESIGN_AREA = 'frontend';
34+
public const DEFAULT_DESIGN_AREA = 'frontend';
3535

3636
/**
3737
* Default path to email logo
3838
*/
39-
const DEFAULT_LOGO_FILE_ID = 'Magento_Email::logo_email.png';
39+
public const DEFAULT_LOGO_FILE_ID = 'Magento_Email::logo_email.png';
4040

4141
/**
4242
* Email logo url
4343
*/
44-
const XML_PATH_DESIGN_EMAIL_LOGO = 'design/email/logo';
44+
public const XML_PATH_DESIGN_EMAIL_LOGO = 'design/email/logo';
4545

4646
/**
4747
* Email logo alt text
4848
*/
49-
const XML_PATH_DESIGN_EMAIL_LOGO_ALT = 'design/email/logo_alt';
49+
public const XML_PATH_DESIGN_EMAIL_LOGO_ALT = 'design/email/logo_alt';
5050

5151
/**
5252
* Email logo width
5353
*/
54-
const XML_PATH_DESIGN_EMAIL_LOGO_WIDTH = 'design/email/logo_width';
54+
public const XML_PATH_DESIGN_EMAIL_LOGO_WIDTH = 'design/email/logo_width';
5555

5656
/**
5757
* Email logo height
5858
*/
59-
const XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT = 'design/email/logo_height';
59+
public const XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT = 'design/email/logo_height';
6060

6161
/**
6262
* Configuration of design package for template
@@ -144,8 +144,6 @@ abstract class AbstractTemplate extends AbstractModel implements TemplateTypesIn
144144
protected $filesystem;
145145

146146
/**
147-
* Scope config
148-
*
149147
* @var \Magento\Framework\App\Config\ScopeConfigInterface
150148
*/
151149
protected $scopeConfig;

app/code/Magento/Email/Model/Template.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ class Template extends AbstractTemplate implements \Magento\Framework\Mail\Templ
4545
* @deprecated
4646
* @see \Magento\Email\Model\Transport::XML_PATH_SENDING_SET_RETURN_PATH
4747
*/
48-
const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
48+
public const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
4949

5050
/**
5151
* Configuration path for custom Return-Path email
5252
* @deprecated
5353
* @see \Magento\Email\Model\Transport::XML_PATH_SENDING_RETURN_PATH_EMAIL
5454
*/
55-
const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
55+
public const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
5656

5757
/**
5858
* Config path to mail sending setting that shows if email communications are disabled
5959
* @deprecated
6060
* @see https://github.com/magento/magento2/issues/5988
6161
*/
62-
const XML_PATH_SYSTEM_SMTP_DISABLE = 'system/smtp/disable';
62+
public const XML_PATH_SYSTEM_SMTP_DISABLE = 'system/smtp/disable';
6363

6464
/**
6565
* BCC list
@@ -69,8 +69,6 @@ class Template extends AbstractTemplate implements \Magento\Framework\Mail\Templ
6969
protected $_bcc = [];
7070

7171
/**
72-
* Return path
73-
*
7472
* @var string
7573
*/
7674
protected $_returnPath = '';

app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class Preview extends \Magento\Newsletter\Block\Adminhtml\Template\Preview
1515
{
1616
/**
17-
* {@inheritdoc}
17+
* @var string
1818
*/
1919
protected $profilerName = "newsletter_queue_proccessing";
2020

app/code/Magento/Newsletter/Model/Template.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ class Template extends \Magento\Email\Model\AbstractTemplate
4040
/**
4141
* Mail object
4242
*
43-
* @deprecated 100.3.0 Unused property
43+
* @var \Zend_Mail
4444
*
45+
* @deprecated 100.3.0 Unused property
4546
*/
4647
protected $_mail;
4748

@@ -60,8 +61,6 @@ class Template extends \Magento\Email\Model\AbstractTemplate
6061
protected $_request;
6162

6263
/**
63-
* Filter factory
64-
*
6564
* @var \Magento\Newsletter\Model\Template\FilterFactory
6665
*/
6766
protected $_filterFactory;

lib/internal/Magento/Framework/Filter/Template.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,39 @@ class Template implements \Zend_Filter_Interface
3333
*
3434
* @deprecated Use the new Directive processors
3535
*/
36-
const CONSTRUCTION_PATTERN = '/{{([a-z]{0,10})(.*?)}}(?:(.*?)(?:{{\/(?:\\1)}}))?/si';
36+
public const CONSTRUCTION_PATTERN = '/{{([a-z]{0,10})(.*?)}}(?:(.*?)(?:{{\/(?:\\1)}}))?/si';
3737

3838
/**
3939
* Construction `depend` regular expression
4040
*
4141
* @deprecated Use the new Directive processors
4242
*/
43-
const CONSTRUCTION_DEPEND_PATTERN = '/{{depend\s*(.*?)}}(.*?){{\\/depend\s*}}/si';
43+
public const CONSTRUCTION_DEPEND_PATTERN = '/{{depend\s*(.*?)}}(.*?){{\\/depend\s*}}/si';
4444

4545
/**
4646
* Construction `if` regular expression
4747
*
4848
* @deprecated Use the new Directive processors
4949
*/
50-
const CONSTRUCTION_IF_PATTERN = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\\/if\s*}}/si';
50+
public const CONSTRUCTION_IF_PATTERN = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\\/if\s*}}/si';
5151

5252
/**
5353
* Construction `template` regular expression
5454
*
5555
* @deprecated Use the new Directive processors
5656
*/
57-
const CONSTRUCTION_TEMPLATE_PATTERN = '/{{(template)(.*?)}}/si';
57+
public const CONSTRUCTION_TEMPLATE_PATTERN = '/{{(template)(.*?)}}/si';
5858

5959
/**
6060
* Construction `for` regular expression
6161
*
6262
* @deprecated Use the new Directive processors
6363
*/
64-
const LOOP_PATTERN = '/{{for(?P<loopItem>.*? )(in)(?P<loopData>.*?)}}(?P<loopBody>.*?){{\/for}}/si';
64+
public const LOOP_PATTERN = '/{{for(?P<loopItem>.*? )(in)(?P<loopData>.*?)}}(?P<loopBody>.*?){{\/for}}/si';
6565

66-
/**#@-*/
66+
/**
67+
* @var array
68+
*/
6769
private $afterFilterCallbacks = [];
6870

6971
/**
@@ -74,8 +76,6 @@ class Template implements \Zend_Filter_Interface
7476
protected $templateVars = [];
7577

7678
/**
77-
* Template processor
78-
*
7979
* @var callable|null
8080
*/
8181
protected $templateProcessor = null;

0 commit comments

Comments
 (0)