public static function isBoolean($value, $message = null)
    {
        if (!is_bool($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected boolean, but got %s',
                Helper::typeToString($value)
            ));
        }
    }