From e061e02a2cd7ed21e81449d7fb7ae5199136ce64 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 27 May 2024 18:25:33 +0200 Subject: [PATCH] Feat/deprecated constants (#35) * feat: Add renaming for deprecated CartEvents constant * feat: Add MailSendSubscriberConfig constant deprecations for Shopware 6.7 --- config/shopware-6.7.0.php | 9 +++++++++ config/v6.6/renaming.php | 1 + config/v6.7/renaming.php | 19 +++++++++++++++++++ rector.php | 1 + src/Set/ShopwareSetList.php | 5 +++++ 5 files changed, 35 insertions(+) create mode 100644 config/shopware-6.7.0.php create mode 100644 config/v6.7/renaming.php diff --git a/config/shopware-6.7.0.php b/config/shopware-6.7.0.php new file mode 100644 index 0000000..f2ae465 --- /dev/null +++ b/config/shopware-6.7.0.php @@ -0,0 +1,9 @@ +import(__DIR__ . '/v6.7/renaming.php'); +}; diff --git a/config/v6.6/renaming.php b/config/v6.6/renaming.php index 58f648c..c00f503 100644 --- a/config/v6.6/renaming.php +++ b/config/v6.6/renaming.php @@ -39,6 +39,7 @@ $rectorConfig->ruleWithConfiguration( RenameClassConstFetchRector::class, [ + new RenameClassAndConstFetch('Shopware\\Core\\Checkout\\Cart', 'CHECKOUT_ORDER_PLACED', 'Shopware\\Core\\Framework\\Event\\BusinessEvents', 'CHECKOUT_ORDER_PLACED'), new RenameClassAndConstFetch('Shopware\\Elasticsearch\\Product\\ElasticsearchProductDefinition', 'KEYWORD_FIELD', 'Shopware\\Elasticsearch\\Framework\\AbstractElasticsearchDefinition', 'KEYWORD_FIELD'), new RenameClassAndConstFetch('Shopware\\Elasticsearch\\Product\\ElasticsearchProductDefinition', 'BOOLEAN_FIELD', 'Shopware\\Elasticsearch\\Framework\\AbstractElasticsearchDefinition', 'BOOLEAN_FIELD'), new RenameClassAndConstFetch('Shopware\\Elasticsearch\\Product\\ElasticsearchProductDefinition', 'FLOAT_FIELD', 'Shopware\\Elasticsearch\\Framework\\AbstractElasticsearchDefinition', 'FLOAT_FIELD'), diff --git a/config/v6.7/renaming.php b/config/v6.7/renaming.php new file mode 100644 index 0000000..9c6f7b0 --- /dev/null +++ b/config/v6.7/renaming.php @@ -0,0 +1,19 @@ +import(__DIR__ . '/../config.php'); + + $rectorConfig->ruleWithConfiguration( + RenameClassConstFetchRector::class, + [ + new RenameClassAndConstFetch('Shopware\\Core\\Content\\MailTemplate\\Subscriber\\MailSendSubscriberConfig', 'MAIL_CONFIG_EXTENSION', 'Shopware\\Core\\Content\\Flow\\Dispatching\\Action\\SendMailAction', 'MAIL_CONFIG_EXTENSION'), + new RenameClassAndConstFetch('Shopware\\Core\\Content\\MailTemplate\\Subscriber\\MailSendSubscriberConfig', 'ACTION_NAME', 'Shopware\\Core\\Content\\Flow\\Dispatching\\Action\\SendMailAction', 'ACTION_NAME'), + ], + ); +}; diff --git a/rector.php b/rector.php index b6328ae..e84a777 100644 --- a/rector.php +++ b/rector.php @@ -15,5 +15,6 @@ $rectorConfig->sets([ ShopwareSetList::SHOPWARE_6_5_0, ShopwareSetList::SHOPWARE_6_6_0, + ShopwareSetList::SHOPWARE_6_7_0, ]); }; diff --git a/src/Set/ShopwareSetList.php b/src/Set/ShopwareSetList.php index 1124804..3a3b012 100644 --- a/src/Set/ShopwareSetList.php +++ b/src/Set/ShopwareSetList.php @@ -15,4 +15,9 @@ final class ShopwareSetList * @var string */ public const SHOPWARE_6_6_0 = __DIR__ . '/../../config/shopware-6.6.0.php'; + + /** + * @var string + */ + public const SHOPWARE_6_7_0 = __DIR__ . '/../../config/shopware-6.7.0.php'; }