src/FlaggedEnum.php
public function withFlags(int $flags): self
    {
        if (!static::accepts($flags)) {
            throw new InvalidValueException($flags, static::class);
        }

        return static::get($this->value | $flags);
    }
public function withFlags(int $flags): self
    {
        if (!static::accepts($flags)) {
            throw new InvalidValueException($flags, static::class);
        }

        return static::get($this->value | $flags);
    }
public function withFlags ( int $ flags ) : self { if ( ! static :: accepts ( $ flags ) ) { throw new InvalidValueException ( $ flags , static :: class ) ; } return static :: get ( $ this -> value | $ flags ) ; }
Computes a new value with given flags, and returns the corresponding instance.

@param int $flags The bit flag or bit flags

@throws InvalidValueException When $flags is not acceptable for this enumeration type

@return static The enum instance for computed value
Computes a new value with given flags and returns the corresponding instance .