Skip to content

Commit 56560e0

Browse files
committed
Fixed static test failures in app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/NewConditionHtml.php
1 parent 2a7e1f9 commit 56560e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/NewConditionHtml.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class NewConditionHtml extends Quote implements HttpPostActionInterface
2222
*/
2323
public function execute()
2424
{
25-
$id = $this->getRequest()->getParam('id');
2625
$formName = $this->getRequest()->getParam('form_namespace');
27-
$typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
28-
$type = $typeArr[0];
26+
$id = $this->getRequest()->getParam('id');
27+
$typeArray = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
28+
$type = $typeArray[0];
2929

30-
if (class_exists($type) && !in_array(ConditionInterface::class, class_implements($type))) {
30+
if ($type && class_exists($type) && !in_array(ConditionInterface::class, class_implements($type))) {
3131
$html = '';
3232
$this->getResponse()->setBody($html);
3333
return;
@@ -44,8 +44,8 @@ public function execute()
4444
)->setPrefix(
4545
'conditions'
4646
);
47-
if (!empty($typeArr[1])) {
48-
$model->setAttribute($typeArr[1]);
47+
if (!empty($typeArray[1])) {
48+
$model->setAttribute($typeArray[1]);
4949
}
5050

5151
if ($model instanceof AbstractCondition) {

0 commit comments

Comments
 (0)