File tree Expand file tree Collapse file tree 3 files changed +18
-15
lines changed
app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Sales \Block \Adminhtml \Order \View \Tab ;
7
7
8
+ use Magento \Framework \App \ObjectManager ;
8
9
use Magento \Framework \AuthorizationInterface ;
9
10
use Magento \Framework \View \Element \Context ;
10
11
@@ -26,18 +27,18 @@ class Creditmemos extends \Magento\Framework\View\Element\Text\ListText implemen
26
27
* Creditmemos constructor.
27
28
*
28
29
* @param Context $context
29
- * @param AuthorizationInterface $authorization
30
30
* @param array $data
31
+ * @param AuthorizationInterface|null $authorization
31
32
*/
32
33
public function __construct (
33
34
Context $ context ,
34
- AuthorizationInterface $ authorization ,
35
- array $ data = []
35
+ array $ data = [] ,
36
+ ? AuthorizationInterface $ authorization = null
36
37
) {
37
- $ this ->authorization = $ authorization ;
38
+ $ this ->authorization = $ authorization ?? ObjectManager:: getInstance ()-> get (AuthorizationInterface::class) ;
38
39
parent ::__construct ($ context , $ data );
39
40
}
40
-
41
+
41
42
/**
42
43
* {@inheritdoc}
43
44
*/
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Sales \Block \Adminhtml \Order \View \Tab ;
7
7
8
+ use Magento \Framework \App \ObjectManager ;
8
9
use Magento \Framework \AuthorizationInterface ;
9
10
use Magento \Framework \View \Element \Context ;
10
11
@@ -26,18 +27,18 @@ class Invoices extends \Magento\Framework\View\Element\Text\ListText implements
26
27
* Invoices constructor.
27
28
*
28
29
* @param Context $context
29
- * @param AuthorizationInterface $authorization
30
30
* @param array $data
31
+ * @param AuthorizationInterface|null $authorization
31
32
*/
32
33
public function __construct (
33
34
Context $ context ,
34
- AuthorizationInterface $ authorization ,
35
- array $ data = []
35
+ array $ data = [] ,
36
+ ? AuthorizationInterface $ authorization = null
36
37
) {
37
- $ this ->authorization = $ authorization ;
38
+ $ this ->authorization = $ authorization ?? ObjectManager:: getInstance ()-> get (AuthorizationInterface::class) ;
38
39
parent ::__construct ($ context , $ data );
39
40
}
40
-
41
+
41
42
/**
42
43
* {@inheritdoc}
43
44
*/
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Sales \Block \Adminhtml \Order \View \Tab ;
7
7
8
+ use Magento \Framework \App \ObjectManager ;
8
9
use Magento \Framework \AuthorizationInterface ;
9
10
10
11
/**
@@ -27,23 +28,23 @@ class Shipments extends \Magento\Framework\View\Element\Text\ListText implements
27
28
* @var AuthorizationInterface
28
29
*/
29
30
private $ authorization ;
30
-
31
+
31
32
/**
32
33
* Collection factory
33
34
*
34
35
* @param \Magento\Framework\View\Element\Context $context
35
36
* @param \Magento\Framework\Registry $coreRegistry
36
- * @param AuthorizationInterface $authorization
37
37
* @param array $data
38
+ * @param AuthorizationInterface|null $authorization
38
39
*/
39
40
public function __construct (
40
41
\Magento \Framework \View \Element \Context $ context ,
41
42
\Magento \Framework \Registry $ coreRegistry ,
42
- AuthorizationInterface $ authorization ,
43
- array $ data = []
43
+ array $ data = [] ,
44
+ ? AuthorizationInterface $ authorization = null
44
45
) {
45
46
$ this ->_coreRegistry = $ coreRegistry ;
46
- $ this ->authorization = $ authorization ;
47
+ $ this ->authorization = $ authorization ?? ObjectManager:: getInstance ()-> get (AuthorizationInterface::class) ;
47
48
parent ::__construct ($ context , $ data );
48
49
}
49
50
You can’t perform that action at this time.
0 commit comments