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

[Solved] Server start-up issue

Discussion in 'Facepalm' started by Daniel23, Oct 30, 2017.

  1. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    im getting this error and dont know how to fix i checked pmmp already

    PHP:
    class BaseCommand extends Command implements PluginIdentifiableCommand{

      private 
    $plugin;

      public function 
    __construct(Main $plugin$name$description$usageMessage$aliases){

      
    parent::__construct($name$description$usageMessage$aliases);
      
    $this->plugin $plugin;
      }

      public function 
    execute(CommandSender $senderstring $commandLabel, array $args){
      if (
    $this->testPermission($sender)) {
      
    $result $this->onExecute($sender$args);
      if (
    is_string($result)) {
      
    $sender->sendMessage($result);
      }
      return 
    true;
      }
      return 
    false;
      }
      public function 
    onExecute(CommandSender $sender, array $args){
      }
      public function 
    getPlugin(){
      return 
    $this->plugin;
      }
      }
     
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    you need to add :plugin
    ->
    public function getPlugin(): Plugin{
    return $this->plugin;
    }
    too lazy for code tags.
     
  3. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
    ???


    PHP:
    class BaseCommand extends Command implements PluginIdentifiableCommand{

      
    /**
         * @return Plugin
         */
        
    public function getPlugin($plugin) : Plugin;

      private 
    $plugin;

      public function 
    __construct(Main $plugin$name$description$usageMessage$aliases){

      
    parent::__construct($name$description$usageMessage$aliases);
      
    $this->plugin $plugin;
      }

      public function 
    execute(CommandSender $senderstring $commandLabel, array $args){
      if (
    $this->testPermission($sender)) {
      
    $result $this->onExecute($sender$args);
      if (
    is_string($result)) {
      
    $sender->sendMessage($result);
      }
      return 
    true;
      }
      return 
    false;
      }
      public function 
    onExecute(CommandSender $sender, array $args){
      }
      public function 
    getPlugin(){
      return 
    $this->plugin;
      }
      }
     
  4. NickTehUnicorn

    NickTehUnicorn Zombie

    Messages:
    200
    GitHub:
    unickorn
    Change that to:
    PHP:
    public function getPlugin() : Plugin{
     
  5. Daniel23

    Daniel23 Witch

    Messages:
    65
    GitHub:
    daniel23
     
  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.