47 private \Closure $getter,
48 private \Closure $setter
50 $flagsToCases = $this->map->getRawToValueMap();
51 foreach($flagsToCases as $possibleFlag => $option){
52 if(($this->maxValue & $possibleFlag) !== 0){
53 foreach($flagsToCases as $otherFlag => $otherOption){
54 if(($possibleFlag & $otherFlag) === $otherFlag && $otherOption !== $option){
55 $printableOption = $this->map->printableValue($option);
56 $printableOtherOption = $this->map->printableValue($otherOption);
57 throw new \InvalidArgumentException(
"Flag for option $printableOption overlaps with flag for option $printableOtherOption in property $this->name");
64 $this->maxValue |= $possibleFlag;
71 $flags = $in->readBoundedInt($this->name, 0, $this->maxValue);
74 foreach($this->map->getRawToValueMap() as $possibleFlag => $option){
75 if(($flags & $possibleFlag) === $possibleFlag){
80 ($this->setter)($block, $value);