Skip to content

Commit f8c78c8

Browse files
committed
NEXT-21203 - Remove DAL deprecations
1 parent eeec558 commit f8c78c8

File tree

180 files changed

+670
-2591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+670
-2591
lines changed

ecs.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer;
1414
use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer;
1515
use PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer;
16+
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
1617
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
1718
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
1819
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
@@ -100,6 +101,13 @@
100101
$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, ['allow_unused_params' => true, 'allow_mixed' => true]);
101102
$ecsConfig->ruleWithConfiguration(PhpUnitDedicateAssertFixer::class, ['target' => 'newest']);
102103
$ecsConfig->ruleWithConfiguration(SingleQuoteFixer::class, ['strings_containing_single_quote_chars' => true]);
104+
// workaround for https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/5495
105+
$ecsConfig->ruleWithConfiguration(BinaryOperatorSpacesFixer::class, [
106+
'operators' => [
107+
'|' => null,
108+
'&' => null,
109+
],
110+
]);
103111

104112
$parameters = $ecsConfig->parameters();
105113
$parameters->set(Option::CACHE_DIRECTORY, $_SERVER['SHOPWARE_TOOL_CACHE_ECS'] ?? 'var/cache/cs_fixer');

phpstan-baseline.neon

Lines changed: 0 additions & 715 deletions
Large diffs are not rendered by default.

src/Administration/Notification/NotificationDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function defineFields(): FieldCollection
6666
(new StringField('status', 'status'))->addFlags(new Required()),
6767
(new StringField('message', 'message'))->addFlags(new Required()),
6868
new BoolField('admin_only', 'adminOnly'),
69-
(new ListField('required_privileges', 'requiredPrivileges'))->setStrict(true),
69+
new ListField('required_privileges', 'requiredPrivileges'),
7070

7171
new FkField('created_by_integration_id', 'createdByIntegrationId', IntegrationDefinition::class),
7272
new FkField('created_by_user_id', 'createdByUserId', UserDefinition::class),

src/Core/Checkout/Customer/CustomerDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function defineFields(): FieldCollection
103103
(new PasswordField('password', 'password'))->removeFlag(ApiAware::class),
104104
(new EmailField('email', 'email'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING, false)),
105105
(new StringField('title', 'title'))->addFlags(new ApiAware()),
106-
(new ListField('vat_ids', 'vatIds', StringField::class))->setStrict(true)->addFlags(new ApiAware()),
106+
(new ListField('vat_ids', 'vatIds', StringField::class))->addFlags(new ApiAware()),
107107
(new StringField('affiliate_code', 'affiliateCode'))->addFlags(new ApiAware()),
108108
(new StringField('campaign_code', 'campaignCode'))->addFlags(new ApiAware()),
109109
(new BoolField('active', 'active'))->addFlags(new ApiAware()),

src/Core/Checkout/Customer/DataAbstractionLayer/CustomerIndexer.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexer;
1212
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexingMessage;
1313
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\ManyToManyIdFieldUpdater;
14-
use Shopware\Core\Framework\Feature;
1514
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
1615
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1716

@@ -54,20 +53,8 @@ public function getName(): string
5453
return 'customer.indexer';
5554
}
5655

57-
/**
58-
* @param array<string, string>|null $offset
59-
*
60-
* @deprecated tag:v6.5.0 The parameter $offset will be native typed
61-
*/
62-
public function iterate(/*?array */$offset): ?EntityIndexingMessage
56+
public function iterate(?array $offset): ?EntityIndexingMessage
6357
{
64-
if ($offset !== null && !\is_array($offset)) {
65-
Feature::triggerDeprecationOrThrow(
66-
'v6.5.0.0',
67-
'Parameter `$offset` of method "iterate()" in class "CustomerIndexer" will be natively typed to `?array` in v6.5.0.0.'
68-
);
69-
}
70-
7158
$iterator = $this->iteratorFactory->createIterator($this->repository->getDefinition(), $offset);
7259

7360
$ids = $iterator->fetch();

src/Core/Checkout/Order/Aggregate/OrderCustomer/OrderCustomerDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function defineFields(): FieldCollection
6767
(new StringField('last_name', 'lastName'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
6868
(new StringField('company', 'company'))->addFlags(new ApiAware(), new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING)),
6969
(new StringField('title', 'title'))->addFlags(new ApiAware()),
70-
(new ListField('vat_ids', 'vatIds', StringField::class))->setStrict(true)->addFlags(new ApiAware()),
70+
(new ListField('vat_ids', 'vatIds', StringField::class))->addFlags(new ApiAware()),
7171
(new StringField('customer_number', 'customerNumber'))->addFlags(new ApiAware(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
7272
(new CustomFields())->addFlags(new ApiAware()),
7373
new OneToOneAssociationField('order', 'order_id', 'id', OrderDefinition::class, false),

src/Core/Checkout/Order/Aggregate/OrderDelivery/OrderDeliveryDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function defineFields(): FieldCollection
8080
(new StateMachineStateField('state_id', 'stateId', OrderDeliveryStates::STATE_MACHINE))->addFlags(new ApiAware(), new Required()),
8181
(new ManyToOneAssociationField('stateMachineState', 'state_id', StateMachineStateDefinition::class, 'id', true))->addFlags(new ApiAware()),
8282

83-
(new ListField('tracking_codes', 'trackingCodes', StringField::class))->setStrict(true)->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
83+
(new ListField('tracking_codes', 'trackingCodes', StringField::class))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
8484
(new DateTimeField('shipping_date_earliest', 'shippingDateEarliest'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING)),
8585
(new DateTimeField('shipping_date_latest', 'shippingDateLatest'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING)),
8686
(new CalculatedPriceField('shipping_costs', 'shippingCosts'))->addFlags(new ApiAware()),

src/Core/Checkout/Order/OrderDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function defineFields(): FieldCollection
105105

106106
(new StateMachineStateField('state_id', 'stateId', OrderStates::STATE_MACHINE))->addFlags(new Required()),
107107
(new ManyToOneAssociationField('stateMachineState', 'state_id', StateMachineStateDefinition::class, 'id', true))->addFlags(new ApiAware()),
108-
(new ListField('rule_ids', 'ruleIds', StringField::class))->setStrict(true),
108+
new ListField('rule_ids', 'ruleIds', StringField::class),
109109
(new CustomFields())->addFlags(new ApiAware()),
110110
(new CreatedByField())->addFlags(new ApiAware()),
111111
(new UpdatedByField())->addFlags(new ApiAware()),

src/Core/Checkout/Order/SalesChannel/OrderRoute.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,14 @@
3434
*/
3535
class OrderRoute extends AbstractOrderRoute
3636
{
37-
private EntityRepository $orderRepository;
38-
39-
private EntityRepository $promotionRepository;
40-
41-
private RateLimiter $rateLimiter;
42-
4337
/**
4438
* @internal
4539
*/
4640
public function __construct(
47-
EntityRepository $orderRepository,
48-
EntityRepository $promotionRepository,
49-
RateLimiter $rateLimiter
41+
private EntityRepository $orderRepository,
42+
private EntityRepository $promotionRepository,
43+
private RateLimiter $rateLimiter
5044
) {
51-
$this->orderRepository = $orderRepository;
52-
$this->promotionRepository = $promotionRepository;
53-
$this->rateLimiter = $rateLimiter;
5445
}
5546

5647
public function getDecorated(): AbstractOrderRoute
@@ -98,7 +89,7 @@ public function load(Request $request, SalesChannelContext $context, Criteria $c
9889
// Handle guest authentication if deeplink is set
9990
if (!$context->getCustomer() && $deepLinkFilter !== null) {
10091
try {
101-
$cacheKey = strtolower($deepLinkFilter->getValue()) . '-' . $request->getClientIp();
92+
$cacheKey = strtolower((string) $deepLinkFilter->getValue()) . '-' . $request->getClientIp();
10293

10394
$this->rateLimiter->ensureAccepted(RateLimiter::GUEST_LOGIN, $cacheKey);
10495
} catch (RateLimitExceededException $exception) {

src/Core/Checkout/Payment/DataAbstractionLayer/PaymentMethodIndexer.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenContainerEvent;
1010
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexer;
1111
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexingMessage;
12-
use Shopware\Core\Framework\Feature;
1312
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
1413
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1514

@@ -46,20 +45,8 @@ public function getName(): string
4645
return 'payment_method.indexer';
4746
}
4847

49-
/**
50-
* @param array|null $offset
51-
*
52-
* @deprecated tag:v6.5.0 The parameter $offset will be native typed
53-
*/
54-
public function iterate(/*?array*/ $offset): ?EntityIndexingMessage
48+
public function iterate(?array $offset): ?EntityIndexingMessage
5549
{
56-
if ($offset !== null && !\is_array($offset)) {
57-
Feature::triggerDeprecationOrThrow(
58-
'v6.5.0.0',
59-
'Parameter `$offset` of method "iterate()" in class "PaymentMethodIndexer" will be natively typed to `?array` in v6.5.0.0.'
60-
);
61-
}
62-
6350
$iterator = $this->iteratorFactory->createIterator($this->paymentMethodRepository->getDefinition(), $offset);
6451

6552
$ids = $iterator->fetch();

0 commit comments

Comments
 (0)