Skip to content

Commit 7dafc4b

Browse files
committed
Set minimium PHP version to 8.1
The parent module only supports PHP 8.1+ too, so there is no point in supporting PHP 7.4 any more.
1 parent 0b7c70d commit 7dafc4b

File tree

9 files changed

+18
-49
lines changed

9 files changed

+18
-49
lines changed

Block/Form/AsyncEvent/GenericButton.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@
44
namespace MageOS\AsyncEventsAdminUi\Block\Form\AsyncEvent;
55

66
use Magento\Backend\Block\Widget\Context;
7+
use Magento\Framework\App\RequestInterface;
78
use Magento\Framework\UrlInterface;
89

910
/**
1011
* Generic (form) button for Asynchronous Event Subscriber entity.
1112
*/
1213
class GenericButton
1314
{
14-
private Context $context;
1515
private UrlInterface $urlBuilder;
16+
private RequestInterface $request;
1617

1718
public function __construct(
1819
Context $context
1920
) {
20-
$this->context = $context;
2121
$this->urlBuilder = $context->getUrlBuilder();
22+
$this->request = $context->getRequest();
2223
}
2324

2425
public function getSubscriptionId(): int
2526
{
26-
return (int)$this->context->getRequest()->getParam('subscription_id');
27+
return (int)$this->request->getParam('subscription_id');
2728
}
2829

2930
/**

Command/AsyncEvent/SaveCommand.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,11 @@
1515
*/
1616
class SaveCommand
1717
{
18-
private LoggerInterface $logger;
19-
private AsyncEventResource $resource;
20-
private EncryptorInterface $encryptor;
21-
2218
public function __construct(
23-
LoggerInterface $logger,
24-
AsyncEventResource $resource,
25-
EncryptorInterface $encryptor
19+
private readonly LoggerInterface $logger,
20+
private readonly AsyncEventResource $resource,
21+
private readonly EncryptorInterface $encryptor
2622
) {
27-
$this->logger = $logger;
28-
$this->resource = $resource;
29-
$this->encryptor = $encryptor;
3023
}
3124

3225
/**

Model/Config.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77

88
class Config
99
{
10-
private DataInterface $dataStorage;
11-
1210
public function __construct(
13-
DataInterface $dataStorage
11+
private readonly DataInterface $dataStorage
1412
) {
15-
$this->dataStorage = $dataStorage;
1613
}
1714

1815
/**

Query/AsyncEvent/GetListQuery.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@
1616
*/
1717
class GetListQuery
1818
{
19-
private CollectionProcessorInterface $collectionProcessor;
20-
private AsyncEventCollectionFactory $entityCollectionFactory;
21-
private SearchCriteriaBuilder $searchCriteriaBuilder;
22-
private SearchResultsInterfaceFactory $searchResultFactory;
23-
2419
public function __construct(
25-
CollectionProcessorInterface $collectionProcessor,
26-
AsyncEventCollectionFactory $entityCollectionFactory,
27-
SearchCriteriaBuilder $searchCriteriaBuilder,
28-
SearchResultsInterfaceFactory $searchResultFactory
20+
private readonly CollectionProcessorInterface $collectionProcessor,
21+
private readonly AsyncEventCollectionFactory $entityCollectionFactory,
22+
private readonly SearchCriteriaBuilder $searchCriteriaBuilder,
23+
private readonly SearchResultsInterfaceFactory $searchResultFactory
2924
) {
30-
$this->collectionProcessor = $collectionProcessor;
31-
$this->entityCollectionFactory = $entityCollectionFactory;
32-
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
33-
$this->searchResultFactory = $searchResultFactory;
3425
}
3526

3627
/**

Ui/Component/Listing/Column/AsyncEventBlockActions.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ class AsyncEventBlockActions extends Column
2323
*/
2424
private const EDIT_URL_PATH = 'async_events/events/edit';
2525

26-
private UrlInterface $urlBuilder;
27-
2826
public function __construct(
2927
ContextInterface $context,
3028
UiComponentFactory $uiComponentFactory,
31-
UrlInterface $urlBuilder,
29+
private readonly UrlInterface $urlBuilder,
3230
array $components = [],
3331
array $data = []
3432
) {
@@ -38,7 +36,6 @@ public function __construct(
3836
$components,
3937
$data
4038
);
41-
$this->urlBuilder = $urlBuilder;
4239
}
4340

4441
public function prepareDataSource(array $dataSource): array

Ui/DataProvider/AsyncEventDataProvider.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
*/
1818
class AsyncEventDataProvider extends DataProvider
1919
{
20-
private GetListQuery $getListQuery;
21-
private SearchResultFactory $searchResultFactory;
2220
private array $loadedData = [];
2321

2422
public function __construct(
@@ -29,8 +27,8 @@ public function __construct(
2927
SearchCriteriaBuilder $searchCriteriaBuilder,
3028
RequestInterface $request,
3129
FilterBuilder $filterBuilder,
32-
GetListQuery $getListQuery,
33-
SearchResultFactory $searchResultFactory,
30+
private readonly GetListQuery $getListQuery,
31+
private readonly SearchResultFactory $searchResultFactory,
3432
array $meta = [],
3533
array $data = []
3634
) {
@@ -45,8 +43,6 @@ public function __construct(
4543
$meta,
4644
$data
4745
);
48-
$this->getListQuery = $getListQuery;
49-
$this->searchResultFactory = $searchResultFactory;
5046
}
5147

5248
/**

Ui/Source/EventNames.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77

88
class EventNames implements \Magento\Framework\Option\ArrayInterface
99
{
10-
private Config $config;
11-
1210
public function __construct(
13-
Config $config
11+
private readonly Config $config
1412
) {
15-
$this->config = $config;
1613
}
1714

1815
public function toOptionArray()

Ui/Source/Stores.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88

99
class Stores implements \Magento\Framework\Option\ArrayInterface
1010
{
11-
private StoreManagerInterface $storeManager;
12-
1311
public function __construct(
14-
StoreManagerInterface $storeManager
12+
private readonly StoreManagerInterface $storeManager
1513
) {
16-
$this->storeManager = $storeManager;
1714
}
1815

1916
public function toOptionArray()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Add event subscriptions for the Mage-OS Async Events module via an admin form instead of using REST requests.",
44
"type": "magento2-module",
55
"require": {
6-
"php": ">=7.4",
6+
"php": ">=8.1",
77
"magento/framework": "*",
88
"mage-os/mageos-async-events": "*"
99
},

0 commit comments

Comments
 (0)