Decora un valor, aplicando un estilo

@param \PlanB\Beautifier\Style\Style $style
@param string                        $value

@return string
6401
public function decorate(Style $style, string $value): string
    {
        if (!$style->isExpand()) {
            return $value;
        }

        $lineWidth = $style->getLineWidth();
        $align = $style->getAlignValue();

        return str_pad($value, $lineWidth, ' ', $align);
    }
1205932
public function parseStyle($style) {
        $groups = $this->formatParser->parseStyle($style);

        foreach ($groups as $group) {
            $type = $group[1];
            $value = $group[2];

            if (array_contains(['color', 'clr', 'fg'], $type)) {
                foreach (explode(',', $value) as $color) {
                    $this->setColor($color);
                }
            }

            if (array_contains(['background', 'bg'], $type)) {
                foreach (explode(',', $value) as $background) {
                    $this->setBackground($background);
                }
            }

            if (array_contains(['format', 'fmt'], $type)) {
                foreach (explode(',', $value) as $format) {
                    $this->addFormat($format);
                }
            }
        }

        return $this;
    }
393716
public function setSeriesMarkerStyle( $series, $value )
    {
        return $this->setNestedOptVal( $this->options, 'seriesStorage', $this->getSeriesTitle( $series ), 'markerOptions', 'style', $value );
    }
198092
public function name(interfaces\Style $style) : ?string
    {
        foreach ($this->items as $key => $value) {
            if ($value === $style) {
                return $key;
            }
        }

        return null;
    }
926288
public function addButton($value="Okay", $style="btn-primary") {
		$btn=new HtmlButton($this->identifier."-".$value);
		$btn->setStyle($style);
		$btn->setValue($value);
		$this->buttons []=$btn;
		return $btn;
	}
694035
public void setStyle(String style) {
		if (this.style == UNDEFINED)
			this.style = NORMAL;
		this.style |= getStyleValue(style);
	}
382777
public function inline($style, array $attr = null)
    {
        $attr = $this->escaper->attr(
            $this->fixInlineAttr($attr)
        );
        return "<style {$attr}>{$style}</style>";
    }
626475
public function style($style)
    {
        if (is_array($style)) {
            $style = implode('', array_map(function ($key, $val) {
                return "$key:$val";
            }, array_keys($style), array_values($style)));
        }

        if (is_string($style)) {
            $this->attributes['style'] = $style;
        }
    }
687259
public function style($style)
    {
        if (is_string($style)) {
            $this->attributes['style'] = $style;

            return $this;
        }

        if (is_array($style)) {

            $html = [];

            foreach ($style as $name => $value) {
                $html[] = "$name:$value";
            }

            $this->attributes['style'] = implode(';', $html);
        }

        return $this;
    }
405545
protected function explode_style($style)
    {
        $pos = 0;

        // first remove comments
        while (($pos = strpos($style, '/*', $pos)) !== false) {
            $end = strpos($style, '*/', $pos+2);

            if ($end === false) {
                $style = substr($style, 0, $pos);
            }
            else {
                $style = substr_replace($style, '', $pos, $end - $pos + 2);
            }
        }

        $style  = trim($style);
        $strlen = strlen($style);
        $result = array();

        // explode value
        for ($p=$i=0; $i < $strlen; $i++) {
            if (($style[$i] == "\"" || $style[$i] == "'") && $style[$i-1] != "\\") {
                if ($q == $style[$i]) {
                    $q = false;
                }
                else if (!$q) {
                    $q = $style[$i];
                }
            }

            if (!$q && $style[$i] == ' ' && !preg_match('/[,\(]/', $style[$i-1])) {
                $result[] = substr($style, $p, $i - $p);
                $p = $i + 1;
            }
        }

        $result[] = (string) substr($style, $p);

        return $result;
    }
921724
protected function add($style, $key, $value)
    {
        $this->style[$style]->add($key, $value);

        // If we are adding a color, make sure it gets added
        // as a background color too
        if ($style == 'color') {
            $this->style['background']->add($key, $value);
        }
    }
281775
public function setStyleValue($key, $value) {
		if($key == '_borderSize') {
			$this->setBorderSize($value);
		} elseif($key == '_borderColor') {
			$this->setBorderColor($value);
		} else {
			$this->$key = $value;
		}
	}
983473
public static function convert(Style $style)
    {
        $options = array();

        if ($style->isBold()) {
            $options[] = 'bold';
        }

        if ($style->isBlinking()) {
            $options[] = 'blink';
        }

        if ($style->isUnderlined()) {
            $options[] = 'underscore';
        }

        if ($style->isInverse()) {
            $options[] = 'reverse';
        }

        if ($style->isHidden()) {
            $options[] = 'conceal';
        }

        return new OutputFormatterStyle($style->getForegroundColor(), $style->getBackgroundColor(), $options);
    }
951691
public function one($style = PDO::FETCH_ASSOC)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetch($style);
        } else {
            return false;
        }
    }
1202542
function merge(Style $style) {
    //treat the !important attribute
    //if old rule has !important attribute, override with new rule only if
    //the new rule is also !important
    foreach($style->_props as $prop => $val ) {
      if (isset($style->_important_props[$prop])) {
        $this->_important_props[$prop] = true;
        //see __set and __get, on all assignments clear cache!
        $this->_prop_cache[$prop] = null;
        $this->_props[$prop] = $val;
      } else if ( !isset($this->_important_props[$prop]) ) {
        //see __set and __get, on all assignments clear cache!
        $this->_prop_cache[$prop] = null;
        $this->_props[$prop] = $val;
      }
    }

    if ( isset($style->_props["font_size"]) )
      $this->__font_size_calculated = false;
  }
634833
public function set(string $name, interfaces\Style $style) : Map
    {
        $this->items[strtolower($name)] = $style;

        return $this;
    }
631330
public static function factory(StyleType $type): Style
    {
        return self::evaluate($type)->isInstanceOf(Style::class)->getValue();
    }