public function html($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return htmlentities($value, $options['flags'], $options['encoding']);
        }

        if ($mode === self::FROM && $options['decode']) {
            return html_entity_decode($value, $options['flags'], $options['encoding']);
        }

        return $value;
    }