1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

CODE ERROR

Discussion in 'Development' started by iCirgio, Dec 18, 2017.

  1. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    ERROR
    PHP:
    Enabling ImmenseCore v1.0.0
    2017
    -12-18 [17:05:12] [Server thread/CRITICAL]: ParseError"syntax error, unexpected ':', expecting '{'" (EXCEPTIONin "Core/src/Immense/Core/Commands/BaseCommand" at line 10
    2017
    -12-18 [17:05:12] [Server thread/DEBUG]: #0 (): BaseClassLoader->loadClass(string Immense\Core\Commands\BaseCommand)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #1 Core/src/Immense/Core/Commands/Fly(15): spl_autoload_call(string Immense\Core\Commands\BaseCommand)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #2 vendor/pmmp/pocketmine-spl/BaseClassLoader(128): include(string /home/gs/gs/data/servers/8536136/plugins/Core/src/Immense/Core/Commands/Fly.php)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #3 (): BaseClassLoader->loadClass(string Immense\Core\Commands\Fly)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #4 Core/src/Immense/Core/Main(20): spl_autoload_call(string Immense\Core\Commands\Fly)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #5 Core/src/Immense/Core/Main(16): Immense\Core\Main->initCommands()
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #6 src/pocketmine/plugin/PluginBase(90): Immense\Core\Main->onEnable()
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #7 DevTools (1).phar/src/FolderPluginLoader/FolderPluginLoader(127): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #8 src/pocketmine/plugin/PluginManager(610): FolderPluginLoader\FolderPluginLoader->enablePlugin(Immense\Core\Main object)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #9 src/pocketmine/Server(1955): pocketmine\plugin\PluginManager->enablePlugin(Immense\Core\Main object)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #10 src/pocketmine/Server(1941): pocketmine\Server->enablePlugin(Immense\Core\Main object)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #11 src/pocketmine/Server(1735): pocketmine\Server->enablePlugins(integer 1)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(554): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/gs/gs/data/servers/8536136/, string /home/gs/gs/data/servers/8536136/plugins/)
    2017-12-18 [17:05:12] [Server thread/DEBUG]: #13 /home/gs/gs/data/servers/8536136/PocketMine-MP_1.7dev-501_66562f24_API-3.0.0-ALPHA10.phar(1): require(string phar:///home/gs/gs/data/servers/8536136/PocketMine-MP_1.7dev-501_66562f24_API-3.0.0-ALPHA10.phar/src/pocketmine/PocketMine.php)
    2017-12-18 [17:05:12] [Server thread/INFO]: Disabling ImmenseCore v1.0.0
    CODE
    PHP:
    <?php

    namespace Immense\Core\Commands;

    use 
    Immense\Core\Main;

    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\PluginIdentifiableCommand;

    abstract class 
    BaseCommand extends Command implements PluginIdentifiableCommand {

        private 
    $plugin;

        public function 
    __construct(String $namefly $plugin) {
            
    parent::__construct($name);
            
    $this->plugin $plugin;
        }

        public function 
    getPlugin() : Plugin {
            return 
    $this->plugin;
        }
    }
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Look at the error before posting
     
  3. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    I have sadly I don't see it
     
  4. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    At first glance your code seems to be syntax-correct. Although anything below PHP 7.2 would throw this error, so my bet is you have an outdated php version.
     
  5. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    but PMMP is suppose to check for version
    so this means OP is using a 3rd party build or not the latest version
    which means you have come to the wrong place
    this forum only support official builds
     
    jasonwynn10 and EdwardHamHam like this.
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Why didn't you just register the command class with the API instead of using spl_autoload_call() ?
     
  7. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    It's probably just in the stack trace. I highly doubt he actually did that. Most people that learn how to code plugins don't even touch that.
     
    jasonwynn10 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.