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

Too few Arguments

Discussion in 'Facepalm' started by iCirgio, Jan 11, 2018.

  1. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    Code
    PHP:
    Code
    public function __construct(Loader $pluginBlock $block){
    $plugin->getServer()->getLogger()->notice('ORTask listener called');
    $this->plugin $plugin;
    $this->block $block;
    Error
    PHP:
    11.01 15:28:15 [ServerServer thread/CRITICAL ArgumentCountError"Too few arguments to function Core\Tasks\ORTask::__construct(), 1 passed in /plugins/Immensecore/src/Core/Loader.php on line 71 and exactly 2 expected" (EXCEPTIONin "Immensecore/src/Core/Tasks/ORTask" at line 14
    Any help will be greatly appreciated!
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You are looking at the wrong place. ORTask.php#14 is the place you define the function. Loader.php#71 is the place you call the constructor function.
    If you don't need the arguments, change ORTask.php#14 to remove the unneeded arguments. If you don't pass enough arguments, change Loader.php#71 to add the required arguments.
     
  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.