Skip to content

Commit 9350f2f

Browse files
committed
sugar syntax
1 parent c64cd7b commit 9350f2f

39 files changed

+68
-115
lines changed

Block/Adminhtml/Config/Form/Field/Select/OptionSourceSelect.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@
1313

1414
class OptionSourceSelect extends Select
1515
{
16-
/**
17-
* @var OptionSourceInterface
18-
*/
19-
private OptionSourceInterface $optionSource;
20-
2116
public function __construct(
2217
Context $context,
23-
OptionSourceInterface $optionSource,
18+
private OptionSourceInterface $optionSource,
2419
array $data = []
2520
) {
26-
$this->optionSource = $optionSource;
2721
parent::__construct($context, $data);
2822
}
2923

Block/Adminhtml/Customer/Edit/EraseButton.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,12 @@
1717

1818
class EraseButton extends GenericButton implements ButtonProviderInterface
1919
{
20-
private EraseEntityCheckerInterface $eraseCustomerChecker;
21-
22-
private Config $config;
23-
2420
public function __construct(
2521
Context $context,
2622
Registry $registry,
27-
EraseEntityCheckerInterface $eraseCustomerChecker,
28-
Config $config
23+
private EraseEntityCheckerInterface $eraseCustomerChecker,
24+
private Config $config
2925
) {
30-
$this->eraseCustomerChecker = $eraseCustomerChecker;
31-
$this->config = $config;
3226
parent::__construct($context, $registry);
3327
}
3428

Block/Adminhtml/Customer/Edit/ExportButton.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616

1717
class ExportButton extends GenericButton implements ButtonProviderInterface
1818
{
19-
private Config $config;
20-
2119
public function __construct(
2220
Context $context,
2321
Registry $registry,
24-
Config $config
22+
private Config $config
2523
) {
26-
$this->config = $config;
2724
parent::__construct($context, $registry);
2825
}
2926

Block/Adminhtml/Order/Edit/EraseButton.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616

1717
class EraseButton extends AbstractBlock
1818
{
19-
private EraseEntityCheckerInterface $eraseEntityChecker;
20-
2119
public function __construct(
2220
Context $context,
23-
EraseEntityCheckerInterface $eraseEntityChecker,
21+
private EraseEntityCheckerInterface $eraseEntityChecker,
2422
array $data = []
2523
) {
26-
$this->eraseEntityChecker = $eraseEntityChecker;
2724
parent::__construct($context, $data);
2825
}
2926

@@ -37,7 +34,7 @@ protected function _construct(): void
3734

3835
/** @var View $orderView */
3936
$orderView = $this->getLayout()->getBlock('sales_order_edit');
40-
$orderId = (int) $orderView->getOrderId();
37+
$orderId = (int)$orderView->getOrderId();
4138

4239
if ($this->_authorization->isAllowed('Opengento_Gdpr::order_erase') &&
4340
$this->eraseEntityChecker->canCreate($orderId, 'order')

Block/Adminhtml/Order/Edit/ExportButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function _construct(): void
2424

2525
/** @var View $orderView */
2626
$orderView = $this->getLayout()->getBlock('sales_order_edit');
27-
$orderId = (int) $orderView->getOrderId();
27+
$orderId = (int)$orderView->getOrderId();
2828

2929
if ($this->_authorization->isAllowed('Opengento_Gdpr::order_export')) {
3030
$orderView->addButton(

Controller/Privacy/Erase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function isAllowed(): bool
4141

4242
protected function executeAction(): Page|Redirect
4343
{
44-
if ($this->eraseCustomerChecker->exists((int) $this->customerSession->getCustomerId(), 'customer')) {
44+
if ($this->eraseCustomerChecker->exists((int)$this->customerSession->getCustomerId(), 'customer')) {
4545
$this->messageManager->addErrorMessage(new Phrase('Your account is already being removed.'));
4646
/** @var Redirect $resultRedirect */
4747
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

Cron/EraseEntityScheduler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ private function scheduleEntitiesErasure(): void
8383

8484
private function resolveErasureMaxAge(): int
8585
{
86-
return (int) $this->scopeConfig->getValue(self::CONFIG_PATH_ERASURE_MAX_AGE, ScopeInterface::SCOPE_STORE);
86+
return (int)$this->scopeConfig->getValue(self::CONFIG_PATH_ERASURE_MAX_AGE, ScopeInterface::SCOPE_STORE);
8787
}
8888
}

Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function isErasureEnabled(): bool
5151
*/
5252
public function getAllowedStatesToErase(): array
5353
{
54-
return explode(',', (string) $this->scopeConfig->getValue(
54+
return explode(',', (string)$this->scopeConfig->getValue(
5555
self::CONFIG_PATH_ERASURE_ALLOWED_STATES,
5656
ScopeInterface::SCOPE_STORE
5757
));

Model/Customer/Anonymize/Processor/CustomerDataProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function anonymizeCustomer(CustomerInterface $customer): void
106106
$secureData = $this->customerRegistry->retrieveSecureData($customer->getId());
107107
$dateTime = (new DateTime())->setTimestamp(PHP_INT_MAX);
108108
$secureData->setData('lock_expires', $dateTime->format(DateTimeFormat::DATETIME_PHP_FORMAT));
109-
$secureData->setPasswordHash(sha1(uniqid((string) mt_rand(), true)));
109+
$secureData->setPasswordHash(sha1(uniqid((string)mt_rand(), true)));
110110

111111
$customer = $this->anonymizer->anonymize($customer);
112112
if ($customer instanceof DataObject) {

Model/Customer/Anonymize/Processor/OrderDataProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function execute(int $customerId): bool
5858
foreach ($orderList->getItems() as $order) {
5959
$lastActive = new DateTime($order->getUpdatedAt());
6060
$this->salesInformation->isAlive($lastActive)
61-
? $this->salesInformation->scheduleEraseEntity((int) $order->getEntityId(), 'order', $lastActive)
61+
? $this->salesInformation->scheduleEraseEntity((int)$order->getEntityId(), 'order', $lastActive)
6262
: $this->anonymize($order);
6363
}
6464

0 commit comments

Comments
 (0)