and more typehints

This commit is contained in:
Dylan K. Taylor
2017-07-14 10:56:51 +01:00
parent b9355387da
commit c3b8be3f60
119 changed files with 598 additions and 541 deletions

View File

@ -48,7 +48,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
}
}
public function isOnline(){
public function isOnline() : bool{
return $this->getPlayer() !== null;
}
@ -60,11 +60,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
return $this->server;
}
public function isOp(){
public function isOp() : bool{
return $this->server->isOp(strtolower($this->getName()));
}
public function setOp($value){
public function setOp(bool $value){
if($value === $this->isOp()){
return;
}
@ -76,11 +76,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
}
}
public function isBanned(){
public function isBanned() : bool{
return $this->server->getNameBans()->isBanned(strtolower($this->getName()));
}
public function setBanned($value){
public function setBanned(bool $value){
if($value === true){
$this->server->getNameBans()->addBan($this->getName(), null, null, null);
}else{
@ -88,11 +88,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
}
}
public function isWhitelisted(){
public function isWhitelisted() : bool{
return $this->server->isWhitelisted(strtolower($this->getName()));
}
public function setWhitelisted($value){
public function setWhitelisted(bool $value){
if($value === true){
$this->server->addWhitelist(strtolower($this->getName()));
}else{
@ -112,7 +112,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
return $this->namedtag instanceof CompoundTag ? $this->namedtag["lastPlayed"] : null;
}
public function hasPlayedBefore(){
public function hasPlayedBefore() : bool{
return $this->namedtag instanceof CompoundTag;
}