File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
app/code/Magento/SalesInventory/Observer Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,12 @@ public function execute(EventObserver $observer)
100
100
*/
101
101
private function getOrderRepository ()
102
102
{
103
- if ($ this ->orderRepository instanceof OrderRepository ) {
104
- return $ this ->orderRepository ;
105
- } else {
106
- return \ Magento \ Framework \ App \ObjectManager:: getInstance ()-> get (OrderRepository::class);
103
+ if (! $ this ->orderRepository ) {
104
+ $ this ->orderRepository = \ Magento \ Framework \ App \ObjectManager:: getInstance ()
105
+ -> get (OrderRepository::class);
106
+
107
107
}
108
+ return $ this ->orderRepository ;
108
109
}
109
110
110
111
/**
@@ -115,10 +116,9 @@ private function getOrderRepository()
115
116
*/
116
117
private function getReturnProcessor ()
117
118
{
118
- if ($ this ->returnProcessor instanceof ReturnProcessor) {
119
- return $ this ->returnProcessor ;
120
- } else {
121
- return \Magento \Framework \App \ObjectManager::getInstance ()->get (ReturnProcessor::class);
119
+ if (!$ this ->returnProcessor ) {
120
+ $ this ->returnProcessor = \Magento \Framework \App \ObjectManager::getInstance ()->get (ReturnProcessor::class);
122
121
}
122
+ return $ this ->returnProcessor ;
123
123
}
124
124
}
You can’t perform that action at this time.
0 commit comments