mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
Attribute: add missing @return $this annotations
This commit is contained in:
parent
f16a530849
commit
1e624e7bb9
@ -145,6 +145,11 @@ class Attribute{
|
||||
return $this->minValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $minValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMinValue(float $minValue){
|
||||
if($minValue > ($max = $this->getMaxValue())){
|
||||
throw new \InvalidArgumentException("Minimum $minValue is greater than the maximum $max");
|
||||
@ -161,6 +166,11 @@ class Attribute{
|
||||
return $this->maxValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $maxValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMaxValue(float $maxValue){
|
||||
if($maxValue < ($min = $this->getMinValue())){
|
||||
throw new \InvalidArgumentException("Maximum $maxValue is less than the minimum $min");
|
||||
@ -177,6 +187,11 @@ class Attribute{
|
||||
return $this->defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $defaultValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultValue(float $defaultValue){
|
||||
if($defaultValue > $this->getMaxValue() or $defaultValue < $this->getMinValue()){
|
||||
throw new \InvalidArgumentException("Default $defaultValue is outside the range " . $this->getMinValue() . " - " . $this->getMaxValue());
|
||||
|
Loading…
x
Reference in New Issue
Block a user