3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
declare (strict_types=1 );
8
7
9
8
namespace Magento \AsynchronousOperations \Model ;
10
9
11
- use Magento \Framework \App \ObjectManager ;
12
- use Magento \Framework \DataObject \IdentityGeneratorInterface ;
13
- use Magento \Framework \Exception \LocalizedException ;
14
- use Magento \AsynchronousOperations \Api \Data \ItemStatusInterfaceFactory ;
15
10
use Magento \AsynchronousOperations \Api \Data \AsyncResponseInterface ;
16
11
use Magento \AsynchronousOperations \Api \Data \AsyncResponseInterfaceFactory ;
17
12
use Magento \AsynchronousOperations \Api \Data \ItemStatusInterface ;
18
- use Magento \Framework \Bulk \BulkManagementInterface ;
19
- use Magento \Framework \Exception \BulkException ;
20
- use Psr \Log \LoggerInterface ;
13
+ use Magento \AsynchronousOperations \Api \Data \ItemStatusInterfaceFactory ;
21
14
use Magento \AsynchronousOperations \Model \ResourceModel \Operation \OperationRepository ;
22
15
use Magento \Authorization \Model \UserContextInterface ;
16
+ use Magento \Framework \Bulk \BulkManagementInterface ;
17
+ use Magento \Framework \DataObject \IdentityGeneratorInterface ;
23
18
use Magento \Framework \Encryption \Encryptor ;
19
+ use Magento \Framework \Exception \BulkException ;
20
+ use Magento \Framework \Exception \LocalizedException ;
21
+ use Psr \Log \LoggerInterface ;
24
22
25
23
/**
26
24
* Class MassSchedule used for adding multiple entities as Operations to Bulk Management with the status tracking
30
28
class MassSchedule
31
29
{
32
30
/**
33
- * @var \Magento\Framework\DataObject\ IdentityGeneratorInterface
31
+ * @var IdentityGeneratorInterface
34
32
*/
35
33
private $ identityService ;
36
34
@@ -45,7 +43,7 @@ class MassSchedule
45
43
private $ itemStatusInterfaceFactory ;
46
44
47
45
/**
48
- * @var \Magento\Framework\Bulk\ BulkManagementInterface
46
+ * @var BulkManagementInterface
49
47
*/
50
48
private $ bulkManagement ;
51
49
@@ -60,7 +58,7 @@ class MassSchedule
60
58
private $ operationRepository ;
61
59
62
60
/**
63
- * @var \Magento\Authorization\Model\ UserContextInterface
61
+ * @var UserContextInterface
64
62
*/
65
63
private $ userContext ;
66
64
@@ -79,7 +77,7 @@ class MassSchedule
79
77
* @param LoggerInterface $logger
80
78
* @param OperationRepository $operationRepository
81
79
* @param UserContextInterface $userContext
82
- * @param Encryptor|null $encryptor
80
+ * @param Encryptor $encryptor
83
81
*/
84
82
public function __construct (
85
83
IdentityGeneratorInterface $ identityService ,
@@ -88,17 +86,17 @@ public function __construct(
88
86
BulkManagementInterface $ bulkManagement ,
89
87
LoggerInterface $ logger ,
90
88
OperationRepository $ operationRepository ,
91
- UserContextInterface $ userContext = null ,
92
- Encryptor $ encryptor = null
89
+ UserContextInterface $ userContext ,
90
+ Encryptor $ encryptor
93
91
) {
94
92
$ this ->identityService = $ identityService ;
95
93
$ this ->itemStatusInterfaceFactory = $ itemStatusInterfaceFactory ;
96
94
$ this ->asyncResponseFactory = $ asyncResponseFactory ;
97
95
$ this ->bulkManagement = $ bulkManagement ;
98
96
$ this ->logger = $ logger ;
99
97
$ this ->operationRepository = $ operationRepository ;
100
- $ this ->userContext = $ userContext ?: ObjectManager:: getInstance ()-> get (UserContextInterface::class) ;
101
- $ this ->encryptor = $ encryptor ?: ObjectManager:: getInstance ()-> get (Encryptor::class) ;
98
+ $ this ->userContext = $ userContext ;
99
+ $ this ->encryptor = $ encryptor ;
102
100
}
103
101
104
102
/**
0 commit comments