59 $this->comparison = 0;
76 return $this->
getSafe($this->required);
94 return $this->
getSafe($this->main);
126 return round(100 / $this->
getMaximum() * $this->
getSafe($a_int), 0, PHP_ROUND_HALF_UP);
trait ComponentHelper
Provides common functionality for component implementations.
getMainValueAsPercent()
Get main value as percent.
__construct($maximum, $main, $required=null, $comparison=null)
getRequiredAsPercent()
Get required value as percent.
getSafe($a_int)
Get integer value "1" if a value is negative or "maximum" if value is more then maximum.
checkIntArg($which, $value)
Throw an InvalidArgumentException if $value is no int.
getAsPercentage($a_int)
get an integer value as percent value