mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
EducationSettingsPacket: safeguard against purity issue reported by PHPStan
while annoying, PHPStan is right to complain about this, because putBool() is impure, meaning that these fields could have been mutated in the call. We know they didn't, but PHPStan doesn't, and we can't mark the method as pure because .. well .. it isn't.
This commit is contained in:
parent
ceeef7c729
commit
817fec9e3d
@ -133,9 +133,10 @@ class EducationSettingsPacket extends DataPacket{
|
||||
$this->putBool($this->disableLegacyTitleBar);
|
||||
$this->putString($this->postProcessFilter);
|
||||
$this->putString($this->screenshotBorderResourcePath);
|
||||
if($this->agentCapabilities !== null){
|
||||
$agentCapabilities = $this->agentCapabilities;
|
||||
if($agentCapabilities !== null){
|
||||
$this->putBool(true);
|
||||
$this->agentCapabilities->write($this);
|
||||
$agentCapabilities->write($this);
|
||||
}else{
|
||||
$this->putBool(false);
|
||||
}
|
||||
@ -144,9 +145,10 @@ class EducationSettingsPacket extends DataPacket{
|
||||
$this->putString($this->codeBuilderOverrideUri);
|
||||
}
|
||||
$this->putBool($this->hasQuiz);
|
||||
if($this->linkSettings !== null){
|
||||
$linkSettings = $this->linkSettings;
|
||||
if($linkSettings !== null){
|
||||
$this->putBool(true);
|
||||
$this->linkSettings->write($this);
|
||||
$linkSettings->write($this);
|
||||
}else{
|
||||
$this->putBool(false);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user