-
Notifications
You must be signed in to change notification settings - Fork 1
Precautions
Muqsit Rayyan edited this page Jul 10, 2020
·
3 revisions
At the current stage, there are some cases where PreProcessor will convert your very valid syntax to an invalid syntax.
- Avoid using
Preprocessor::export($output_folder, $overwrite = true)
($overwrite
isfalse
by default). - Read the output logged by PreProcessor to be aware of what changed.
- $player->getUniqueId()->toString();
+ /* $player->getUniqueId() */->toString();
PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)
- $player->sendMessage("{$player->getName()} says Hello!");
+ $player->sendMessage("{{/* $player->getName() */}} says Hello!");
PHP Notice: Undefined property: Player::$getName
The string gets resolved to {{/* () */}} says Hello!
- $x = $player->getUniqueId();
+ $x = /* $player->getUniqueId() */;
PHP Parse error: syntax error, unexpected ';'
function getId(Player $player) : UUID{
- return $player->getUniqueId();
+ return /*$player->getUniqueId()*/;
}
PHP Fatal error: A function with return type must return a value
- Only comment out methods that do not return a value (i.e
: void
). - Do not assign variables in the method's argument list that you are commenting out.
- Be sure the code you're commenting out will not alter the behaviour of the program. For example, do not do this if you are commenting out
Logger::debug()
:
Logger::debug("Player joined with UUID: {$player->assignUUIDAndReturnIt()}");