Skip to content

Commit

Permalink
fix redirect factory
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyraul committed Jul 31, 2024
1 parent e7b6ab0 commit 7bc72d8
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 20 deletions.
3 changes: 1 addition & 2 deletions src/Jeeves/Generators/Crud/Controllers/Mass.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function genAdminMassController(
$readonlyProp = $this->hasReadOnlyProp($phpVersion);

$namespace = new PhpNamespace($rootNamespace . '\Controller\Adminhtml\\' . $entity);
$namespace->addUse('Magento\Framework\Controller\ResultFactory');

$class = $namespace->addClass($className)
->setExtends($rootNamespace . '\Controller\Adminhtml\\' . $entity);
Expand Down Expand Up @@ -89,7 +88,7 @@ public function genAdminMassController(
. ');' . PHP_EOL

. '/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */' . PHP_EOL
. '$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);' . PHP_EOL
. '$resultRedirect = $this->resultRedirectFactory->create();' . PHP_EOL
. 'return $resultRedirect->setPath(\'*/*/\');' . PHP_EOL);

$execute->setReturnType('\Magento\Framework\Controller\ResultInterface');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Card;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\CartItem;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Columns;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Card;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\CartItem;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Columns;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Card;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\CartItem;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Mygento\SampleModule\Controller\Adminhtml\Columns;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\Registry;
use Magento\Ui\Component\MassAction\Filter;
Expand Down Expand Up @@ -38,7 +37,7 @@ public function execute(): ResultInterface
__('A total of %1 record(s) have been deleted.', $collectionSize)->render()
);
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->resultRedirectFactory->create();

return $resultRedirect->setPath('*/*/');
}
Expand Down

0 comments on commit 7bc72d8

Please sign in to comment.