protected function applyStyles($row, $col, array $styles) : bool
    {
        $buffer = $this->getBuffer();

        if (!isset($buffer[$row])) {
            return false;
        }

        if (!isset($buffer[$row][$col])) {
            return false;
        }

        $current_styles = $this->buffer[$row][$col]['styles'];

        $results = [];
        foreach ($styles as $param => $value) {

            if (!isset($this->getDefaultStyles()[$param])) {
                // Apenas estilos válidos são permitidos
                throw new \InvalidArgumentException("Invalid style {$param}");
            } else {

                $border_styles = [
                    'border-top-color',
                    'border-right-color',
                    'border-bottom-color',
                    'border-left-color',
                    'border-top-style',
                    'border-right-style',
                    'border-bottom-style',
                    'border-left-style',
                ];
                // As bordas são aplicadas de forma mais complexa
                if (in_array($param, $border_styles) == true) {
                    $results[$param] = $this->applyBorderStyle($row, $col, $param, $value);
                }

                if ($value == 'none' && isset($current_styles[$param])) {
                    unset($current_styles[$param]);
                }

                if ($value != 'none') {
                    $current_styles[$param]    = $value;
                }
            }
        }

        $this->buffer[$row][$col]['styles'] = $current_styles;

        $results = array_unique($results);
        return (count($results) == 0 || current($results) === true) ? true : false;
    }