Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors CI: undefined ResultFactory constants #96

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Controller/Adminhtml/Cheque/MassResend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Magento\Backend\App\Action\Context;
use Magento\Backend\Model\View\Result\Redirect;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\Result\RedirectFactory;
use Magento\Ui\Component\MassAction\Filter;
use Mygento\Kkm\Api\Data\TransactionAttemptInterface;
use Mygento\Kkm\Api\ResenderInterface;
Expand All @@ -24,6 +24,11 @@ class MassResend extends Action implements HttpPostActionInterface
{
public const ADMIN_RESOURCE = 'Mygento_Kkm::cheque_resend';

/**
* @var RedirectFactory
*/
private $redirectResultFactory;

/**
* @var Filter
*/
Expand All @@ -49,16 +54,9 @@ class MassResend extends Action implements HttpPostActionInterface
*/
private $resender;

/**
* @param Context $context
* @param Filter $filter
* @param CollectionFactory $collectionFactory
* @param TransactionAttempt $transactionAttemptHelper
* @param Data $configHelper
* @param ResenderInterface $resender
*/
public function __construct(
Context $context,
RedirectFactory $redirectResultFactory,
Filter $filter,
CollectionFactory $collectionFactory,
TransactionAttempt $transactionAttemptHelper,
Expand All @@ -67,6 +65,7 @@ public function __construct(
) {
parent::__construct($context);

$this->redirectResultFactory = $redirectResultFactory;
$this->filter = $filter;
$this->collectionFactory = $collectionFactory;
$this->transactionAttemptHelper = $transactionAttemptHelper;
Expand Down Expand Up @@ -128,7 +127,7 @@ public function execute()
);
}

$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect = $this->redirectResultFactory->create();
$redirectPath = $this->filter->getComponentRefererUrl() ?: 'kkm/transactionattempt/';

return $resultRedirect->setPath($redirectPath);
Expand Down
22 changes: 9 additions & 13 deletions Controller/Frontend/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Controller\ResultFactory;

class Callback extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
{
Expand All @@ -20,6 +19,11 @@ class Callback extends \Magento\Framework\App\Action\Action implements CsrfAware
*/
private $responseFactory;

/**
* @var \Magento\Framework\Controller\Result\RawFactory
*/
private $rawResultFactory;

/**
* @var \Mygento\Kkm\Model\VendorInterface
*/
Expand Down Expand Up @@ -50,19 +54,9 @@ class Callback extends \Magento\Framework\App\Action\Action implements CsrfAware
*/
private $storeManager;

/**
* Callback constructor.
* @param \Mygento\Kkm\Model\Atol\ResponseFactory $responseFactory
* @param \Mygento\Kkm\Model\VendorInterface $vendor
* @param \Mygento\Kkm\Helper\Data $kkmHelper
* @param \Mygento\Kkm\Helper\Error $errorHelper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Mygento\Kkm\Helper\Resell $resellHelper
* @param \Mygento\Kkm\Api\Processor\SendInterface $processor
* @param \Magento\Framework\App\Action\Context $context
*/
public function __construct(
\Mygento\Kkm\Model\Atol\ResponseFactory $responseFactory,
\Magento\Framework\Controller\Result\RawFactory $rawResultFactory,
\Mygento\Kkm\Model\VendorInterface $vendor,
\Mygento\Kkm\Helper\Data $kkmHelper,
\Mygento\Kkm\Helper\Error $errorHelper,
Expand All @@ -72,7 +66,9 @@ public function __construct(
\Magento\Framework\App\Action\Context $context
) {
parent::__construct($context);

$this->responseFactory = $responseFactory;
$this->rawResultFactory = $rawResultFactory;
$this->vendor = $vendor;
$this->kkmHelper = $kkmHelper;
$this->storeManager = $storeManager;
Expand All @@ -92,7 +88,7 @@ public function execute()
$entity = null;

//For testing purposes
$result = $this->resultFactory->create(ResultFactory::TYPE_RAW);
$result = $this->rawResultFactory->create();

try {
$response = $this->responseFactory->create(['jsonRaw' => $json]);
Expand Down