Skip to content

Commit b7badf0

Browse files
author
Dmytro Poperechnyy
committed
MAGETWO-34995: Refactor controllers from the list (Part2)
- Comments from code review fixed;
1 parent 650303b commit b7badf0

File tree

1 file changed

+3
-9
lines changed
  • app/code/Magento/Review/Controller/Adminhtml/Product

1 file changed

+3
-9
lines changed

app/code/Magento/Review/Controller/Adminhtml/Product/Delete.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,20 @@
88

99
class Delete extends \Magento\Review\Controller\Adminhtml\Product
1010
{
11-
/**
12-
* @var int
13-
*/
14-
protected $reviewId;
15-
1611
/**
1712
* @return void
1813
*/
1914
public function execute()
2015
{
21-
$this->reviewId = $this->getRequest()->getParam('id', false);
22-
$this->_reviewFactory->create()->setId($this->reviewId)->aggregate()->delete();
16+
$reviewId = $this->getRequest()->getParam('id', false);
17+
$this->_reviewFactory->create()->setId($reviewId)->aggregate()->delete();
2318

2419
$this->messageManager->addSuccess(__('The review has been deleted.'));
2520
if ($this->getRequest()->getParam('ret') == 'pending') {
2621
$this->getResponse()->setRedirect($this->getUrl('review/*/pending'));
2722
} else {
2823
$this->getResponse()->setRedirect($this->getUrl('review/*/'));
2924
}
30-
return;
3125
}
3226

3327
/**
@@ -38,6 +32,6 @@ public function execute()
3832
public function getDefaultRedirect()
3933
{
4034
$resultRedirect = $this->resultRedirectFactory->create();
41-
return $resultRedirect->setPath('review/*/edit/', ['id' => $this->reviewId]);
35+
return $resultRedirect->setPath('review/*/edit/', ['id' => $this->getRequest()->getParam('id', false)]);
4236
}
4337
}

0 commit comments

Comments
 (0)