1

Code

use Magento\CustomerBalance\Helper\Data;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Registry;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

/**
 * Refund to customer balance functionality block
 *
 * @api
 * @since 100.0.2
 */
class Controls extends Template
{
    /**
     * Core registry
     *
     * @var Registry
     */
    protected $_coreRegistry = null;

    /**
     * @param Context $context
     * @param Registry $registry
     * @param array $data
     * @param Data|null $customerBalanceHelper
     */
    public function __construct(
        Context $context,
        Registry $registry,
        array $data = [],
        Data $customerBalanceHelper = null
    ) {
        $data['customerBalanceHelper'] =  $customerBalanceHelper ?? ObjectManager::getInstance()->get(Data::class);
        $this->_coreRegistry = $registry;
        parent::__construct($context, $data);
    }
1
  • any thoughts on this ?
    – php dev
    Commented Mar 10, 2021 at 5:53

1 Answer 1

0

Try to replace below line:

parent::__construct($context, $data);

With this one:

parent::__construct($context, $registry, $data);
5
  • Thanks for the answer, let me check
    – php dev
    Commented Mar 10, 2021 at 5:56
  • This error use to appear while executing di:compile
    – php dev
    Commented Mar 10, 2021 at 5:57
  • Yes, Please run the di:compile command and check which line number showing this error.
    – Amit Saini
    Commented Mar 10, 2021 at 5:58
  • Can you please show your namespace entry?
    – Amit Saini
    Commented Mar 10, 2021 at 6:00
  • It seems to be working.
    – php dev
    Commented Mar 10, 2021 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.