Skip to content

Commit caaf7df

Browse files
author
Oleksii Korshenko
authored
MAGETWO-71316: Update the return type in the tax rate ajax controllers to be correct #10420
2 parents 43749c2 + ff640b4 commit caaf7df

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

app/code/Magento/Tax/Controller/Adminhtml/Rate/AjaxLoad.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Tax\Controller\Adminhtml\Rate;
89

910
use Magento\Framework\Exception\NoSuchEntityException;
@@ -14,7 +15,8 @@ class AjaxLoad extends \Magento\Tax\Controller\Adminhtml\Rate
1415
/**
1516
* Json needed for the Ajax Edit Form
1617
*
17-
* @return void
18+
* @return \Magento\Framework\Controller\Result\Json
19+
* @throws \InvalidArgumentException
1820
*/
1921
public function execute()
2022
{
@@ -23,13 +25,13 @@ public function execute()
2325
/* @var \Magento\Tax\Api\Data\TaxRateInterface */
2426
$taxRateDataObject = $this->_taxRateRepository->get($rateId);
2527
/* @var array */
26-
$resultArray= $this->_taxRateConverter->createArrayFromServiceObject($taxRateDataObject, true);
28+
$resultArray = $this->_taxRateConverter->createArrayFromServiceObject($taxRateDataObject, true);
2729

2830
$responseContent = [
2931
'success' => true,
3032
'error_message' => '',
31-
'result'=>$resultArray,
32-
];
33+
'result' => $resultArray,
34+
];
3335
} catch (NoSuchEntityException $e) {
3436
$responseContent = [
3537
'success' => false,

app/code/Magento/Tax/Controller/Adminhtml/Rate/AjaxSave.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AjaxSave extends \Magento\Tax\Controller\Adminhtml\Rate
1414
* Save Tax Rate via AJAX
1515
*
1616
* @return \Magento\Framework\Controller\Result\Json
17+
* @throws \InvalidArgumentException
1718
*/
1819
public function execute()
1920
{

app/code/Magento/Tax/Controller/Adminhtml/Rule/AjaxLoadRates.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function __construct(
4848
* Get rates page via AJAX
4949
*
5050
* @return Json
51+
* @throws \InvalidArgumentException
5152
*/
5253
public function execute()
5354
{

app/code/Magento/Tax/Controller/Adminhtml/Tax/AjaxDelete.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AjaxDelete extends \Magento\Tax\Controller\Adminhtml\Tax
1414
* Delete Tax Class via AJAX
1515
*
1616
* @return \Magento\Framework\Controller\Result\Json
17+
* @throws \InvalidArgumentException
1718
*/
1819
public function execute()
1920
{
@@ -29,6 +30,7 @@ public function execute()
2930
'error_message' => __('We can\'t delete this tax class right now.')
3031
];
3132
}
33+
3234
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
3335
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
3436
$resultJson->setData($responseContent);

app/code/Magento/Tax/Controller/Adminhtml/Tax/AjaxSave.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AjaxSave extends \Magento\Tax\Controller\Adminhtml\Tax
1414
* Save Tax Class via AJAX
1515
*
1616
* @return \Magento\Framework\Controller\Result\Json
17+
* @throws \InvalidArgumentException
1718
*/
1819
public function execute()
1920
{
@@ -47,6 +48,7 @@ public function execute()
4748
'class_name' => '',
4849
];
4950
}
51+
5052
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
5153
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
5254
$resultJson->setData($responseContent);

0 commit comments

Comments
 (0)