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 Commented Aug 21, 2021 at 13:44
  • <?php namespace Masters\Categorymapping\Observer; use Magento\Framework\Event\ObserverInterface; class Mapping implements ObserverInterface { return; } Commented Aug 21, 2021 at 14:18
  • XAMPP is not supported. Please use docker to setup your Magento 2. youtube.com/watch?v=HYKpPNtKgLQ Commented Aug 21, 2021 at 14:20

2 Answers 2

1

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 you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.