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
    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
    Mar 10, 2021 at 5:56
  • This error use to appear while executing di:compile
    – php dev
    Mar 10, 2021 at 5:57
  • Yes, Please run the di:compile command and check which line number showing this error.
    – Amit Saini
    Mar 10, 2021 at 5:58
  • Can you please show your namespace entry?
    – Amit Saini
    Mar 10, 2021 at 6:00
  • It seems to be working.
    – php dev
    Mar 10, 2021 at 6:04

Your Answer

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

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