File tree Expand file tree Collapse file tree 9 files changed +18
-49
lines changed
Expand file tree Collapse file tree 9 files changed +18
-49
lines changed Original file line number Diff line number Diff line change 44namespace MageOS \AsyncEventsAdminUi \Block \Form \AsyncEvent ;
55
66use Magento \Backend \Block \Widget \Context ;
7+ use Magento \Framework \App \RequestInterface ;
78use Magento \Framework \UrlInterface ;
89
910/**
1011 * Generic (form) button for Asynchronous Event Subscriber entity.
1112 */
1213class 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 /**
Original file line number Diff line number Diff line change 1515 */
1616class 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 /**
Original file line number Diff line number Diff line change 77
88class 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 /**
Original file line number Diff line number Diff line change 1616 */
1717class 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 /**
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1717 */
1818class 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 /**
Original file line number Diff line number Diff line change 77
88class 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 ()
Original file line number Diff line number Diff line change 88
99class 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 ()
Original file line number Diff line number Diff line change 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 },
You can’t perform that action at this time.
0 commit comments