Skip to content

Commit 8c0ceed

Browse files
author
Oleksii Korshenko
authored
Merge pull request #656 from magento-fearless-kiwis/MAGETWO-62013
[Fiwi] Fix of Backward incompatible changes - 2.1.3
2 parents 924ea3f + ff3d7ec commit 8c0ceed

26 files changed

+130
-67
lines changed

app/code/Magento/Backend/App/Config.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212

1313
use Magento\Config\App\Config\Type\System;
1414
use Magento\Framework\App\Config\ScopeConfigInterface;
15+
use Magento\Framework\App\ObjectManager;
1516

1617
/**
1718
* Backend config accessor.
1819
*/
1920
class Config implements ConfigInterface
2021
{
22+
/**
23+
* @var \Magento\Framework\App\Config\ScopePool
24+
*
25+
* @deprecated
26+
*/
27+
protected $_scopePool;
28+
2129
/**
2230
* @var \Magento\Framework\App\Config
2331
*/
@@ -29,12 +37,17 @@ class Config implements ConfigInterface
2937
private $data;
3038

3139
/**
32-
* @param \Magento\Framework\App\Config $appConfig
33-
* @return void
40+
* @param \Magento\Framework\App\Config\ScopePool $scopePool
41+
* @param \Magento\Framework\App\Config|null $appConfig
3442
*/
35-
public function __construct(\Magento\Framework\App\Config $appConfig)
36-
{
37-
$this->appConfig = $appConfig;
43+
public function __construct(
44+
\Magento\Framework\App\Config\ScopePool $scopePool,
45+
\Magento\Framework\App\Config $appConfig = null
46+
) {
47+
$this->_scopePool = $scopePool;
48+
$this->appConfig = $appConfig ?: ObjectManager::getInstance()->get(
49+
\Magento\Framework\App\Config::class
50+
);
3851
}
3952

4053
/**

app/code/Magento/Backend/Test/Unit/App/ConfigTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ protected function setUp()
3434
'',
3535
false
3636
);
37-
$this->model = new \Magento\Backend\App\Config($this->appConfig);
37+
$this->model = new \Magento\Backend\App\Config(
38+
$this->getMock(\Magento\Framework\App\Config\ScopePool::class, [], [], '', false, false),
39+
$this->appConfig
40+
);
3841
}
3942

4043
public function testGetValue()

app/code/Magento/Sales/Api/Data/CreditmemoCommentCreationInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
/**
1111
* Interface CreditmemoCommentCreationInterface
12-
*
13-
* @api
1412
*/
1513
interface CreditmemoCommentCreationInterface extends ExtensibleDataInterface, CommentInterface
1614
{

app/code/Magento/Sales/Api/Data/CreditmemoCreationArgumentsInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
/**
99
* Interface CreditmemoCreationArgumentsInterface
10-
*
11-
* @api
1210
*/
1311
interface CreditmemoCreationArgumentsInterface
1412
{

app/code/Magento/Sales/Api/Data/CreditmemoItemCreationInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
/**
1111
* Interface CreditmemoItemCreationInterface
12-
* @api
1312
*/
1413
interface CreditmemoItemCreationInterface extends LineItemInterface, ExtensibleDataInterface
1514
{

app/code/Magento/Sales/Api/Exception/CouldNotRefundExceptionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Sales\Api\Exception;
77

88
/**
9-
* @api
9+
* Interface CouldNotRefundExceptionInterface
1010
*/
1111
interface CouldNotRefundExceptionInterface
1212
{

app/code/Magento/Sales/Api/RefundInvoiceInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
/**
99
* Interface RefundInvoiceInterface
10-
*
11-
* @api
1210
*/
1311
interface RefundInvoiceInterface
1412
{

app/code/Magento/Sales/Api/RefundOrderInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
/**
99
* Interface RefundOrderInterface
10-
*
11-
* @api
1210
*/
1311
interface RefundOrderInterface
1412
{

app/code/Magento/Sales/Model/InvoiceOrder.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
use Magento\Sales\Api\InvoiceOrderInterface;
1313
use Magento\Sales\Api\OrderRepositoryInterface;
1414
use Magento\Sales\Model\Order\Config as OrderConfig;
15+
use Magento\Sales\Model\Order\Invoice\InvoiceValidatorInterface;
1516
use Magento\Sales\Model\Order\Invoice\NotifierInterface;
1617
use Magento\Sales\Model\Order\InvoiceDocumentFactory;
1718
use Magento\Sales\Model\Order\InvoiceRepository;
1819
use Magento\Sales\Model\Order\OrderStateResolverInterface;
20+
use Magento\Sales\Model\Order\OrderValidatorInterface;
1921
use Magento\Sales\Model\Order\PaymentAdapterInterface;
2022
use Magento\Sales\Model\Order\Validation\InvoiceOrderInterface as InvoiceOrderValidator;
2123
use Psr\Log\LoggerInterface;
24+
use Magento\Framework\App\ObjectManager;
2225

2326
/**
2427
* Class InvoiceOrder
@@ -81,26 +84,31 @@ class InvoiceOrder implements InvoiceOrderInterface
8184
* @param ResourceConnection $resourceConnection
8285
* @param OrderRepositoryInterface $orderRepository
8386
* @param InvoiceDocumentFactory $invoiceDocumentFactory
87+
* @param InvoiceValidatorInterface $invoiceValidator
88+
* @param OrderValidatorInterface $orderValidator
8489
* @param PaymentAdapterInterface $paymentAdapter
8590
* @param OrderStateResolverInterface $orderStateResolver
8691
* @param OrderConfig $config
8792
* @param InvoiceRepository $invoiceRepository
88-
* @param InvoiceOrderValidator $invoiceOrderValidator
8993
* @param NotifierInterface $notifierInterface
9094
* @param LoggerInterface $logger
95+
* @param InvoiceOrderValidator|null $invoiceOrderValidator
9196
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
97+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
9298
*/
9399
public function __construct(
94100
ResourceConnection $resourceConnection,
95101
OrderRepositoryInterface $orderRepository,
96102
InvoiceDocumentFactory $invoiceDocumentFactory,
103+
InvoiceValidatorInterface $invoiceValidator,
104+
OrderValidatorInterface $orderValidator,
97105
PaymentAdapterInterface $paymentAdapter,
98106
OrderStateResolverInterface $orderStateResolver,
99107
OrderConfig $config,
100108
InvoiceRepository $invoiceRepository,
101-
InvoiceOrderValidator $invoiceOrderValidator,
102109
NotifierInterface $notifierInterface,
103-
LoggerInterface $logger
110+
LoggerInterface $logger,
111+
InvoiceOrderValidator $invoiceOrderValidator = null
104112
) {
105113
$this->resourceConnection = $resourceConnection;
106114
$this->orderRepository = $orderRepository;
@@ -109,9 +117,11 @@ public function __construct(
109117
$this->orderStateResolver = $orderStateResolver;
110118
$this->config = $config;
111119
$this->invoiceRepository = $invoiceRepository;
112-
$this->invoiceOrderValidator = $invoiceOrderValidator;
113120
$this->notifierInterface = $notifierInterface;
114121
$this->logger = $logger;
122+
$this->invoiceOrderValidator = $invoiceOrderValidator ?: ObjectManager::getInstance()->get(
123+
InvoiceOrderValidator::class
124+
);
115125
}
116126

117127
/**

app/code/Magento/Sales/Model/Order/Creditmemo/Notifier.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
/**
99
* CreditMemo notifier.
10-
*
11-
* @api
1210
*/
1311
class Notifier implements \Magento\Sales\Model\Order\Creditmemo\NotifierInterface
1412
{

0 commit comments

Comments
 (0)