Error: Open Ss Codes PHP: public function mainForm($player){ $form = new SimpleForm(function (Player $s, array $data){ $player = $s->getPlayer(); $result = $data[0]; switch($result){ // codes}});// codes}
You shouldnt type hint the second argument as it might be null, which leads to another error Also, SimpleForm returns the index of the button that is clicked, which is a int CustomForm is the one that returns an array
If you want a form that only has buttons simply change to PHP: $form = new SimpleForm(function (Player $player, $data){ //no need to getPlayer() from a Player object, it is already a player! if($data !== null){ // $data is int or null switch($data){ } }});