0

enter image description hereI am trying to install our live website into the localhost

But I have encountered this error while running command

php -dmemory_limit=-1 bin/magento setup:di:compile

Parse error: syntax error, unexpected 'return' (T_RETURN), expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp\htdocs\testmastersdirect\mastersdi rect.masters-sp.com\shop\app\code\Masters\Categorymapping\Observer\Mapping.php on line 10 enter image description here

3
  • Post your app\code\Masters\Categorymapping\Observer\Mapping.php class
    – Sohel Rana
    Aug 21, 2021 at 13:44
  • <?php namespace Masters\Categorymapping\Observer; use Magento\Framework\Event\ObserverInterface; class Mapping implements ObserverInterface { return; }
    – user99886
    Aug 21, 2021 at 14:18
  • XAMPP is not supported. Please use docker to setup your Magento 2. youtube.com/watch?v=HYKpPNtKgLQ Aug 21, 2021 at 14:20

2 Answers 2

0

You missed function.

<?php 
namespace Masters\Categorymapping\Observer; 

use Magento\Framework\Event\ObserverInterface; 

class Mapping implements ObserverInterface {

    public function execute()
    {
        return;
    }
} 
0

did you replaced default code to another code..recheck the code..if you commented properly to the deault code using ctrl+/

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.