Skip to content

Commit

Permalink
Fix errors CI: undefined \Magento\Framework\Controller\ResultFactory:…
Browse files Browse the repository at this point in the history
…<constant> (#96)

Co-authored-by: Rodion Kachkin <[email protected]>
  • Loading branch information
kylerqws and Rodion Kachkin committed May 16, 2024
1 parent fac18bb commit 925b44c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
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

0 comments on commit 925b44c

Please sign in to comment.