src/Flag.php
public static function buildMask($flag1, $_ = null)
    {
        if (!static::is($flag1)) {
            throw new \InvalidArgumentException("The first parameter must be a flag.");
        }

        $mask = $flag1;
        $args = array_slice(func_get_args(), 1);
        foreach ($args as $flag) {
            if (!static::is($flag)) {
                throw new \InvalidArgumentException("All parameters must be flags.");
            }

            $mask = $mask | $flag;
        }

        return $mask;
    }
public static function buildMask($flag1, $_ = null)
    {
        if (!static::is($flag1)) {
            throw new \InvalidArgumentException("The first parameter must be a flag.");
        }

        $mask = $flag1;
        $args = array_slice(func_get_args(), 1);
        foreach ($args as $flag) {
            if (!static::is($flag)) {
                throw new \InvalidArgumentException("All parameters must be flags.");
            }

            $mask = $mask | $flag;
        }

        return $mask;
    }
public static function buildMask ( $ flag1 , $ _ = null ) { if ( ! static :: is ( $ flag1 ) ) { throw new \ InvalidArgumentException ( "The first parameter must be a flag." ) ; } $ mask = $ flag1 ; $ args = array_slice ( func_get_args ( ) , 1 ) ; foreach ( $ args as $ flag ) { if ( ! static :: is ( $ flag ) ) { throw new \ InvalidArgumentException ( "All parameters must be flags." ) ; } $ mask = $ mask | $ flag ; } return $ mask ; }
Builds a flag mask with the given flags.

@param int $flag1 The first flag.
@param int $_     More flags.

@return int The mask containing all the flags given.
@throws \InvalidArgumentException
Builds a flag mask with the given flags .