Skip to content

Commit

Permalink
Feat/deprecated constants (#35)
Browse files Browse the repository at this point in the history
* feat: Add renaming for deprecated CartEvents constant

* feat: Add MailSendSubscriberConfig constant deprecations for Shopware 6.7
  • Loading branch information
aragon999 authored May 27, 2024
1 parent b146877 commit e061e02
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/shopware-6.7.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/v6.7/renaming.php');
};
1 change: 1 addition & 0 deletions config/v6.6/renaming.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
19 changes: 19 additions & 0 deletions config/v6.7/renaming.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->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'),
],
);
};
1 change: 1 addition & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
$rectorConfig->sets([
ShopwareSetList::SHOPWARE_6_5_0,
ShopwareSetList::SHOPWARE_6_6_0,
ShopwareSetList::SHOPWARE_6_7_0,
]);
};
5 changes: 5 additions & 0 deletions src/Set/ShopwareSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

0 comments on commit e061e02

Please sign in to comment.