Advanced beautifier

@return string
512641
private function prefix()
    {
        $result = $this->lineBreak() . $this->directive . ':';
        if ($this->level === 0) {
            return $result;
        }
        return ucwords($result) . ' ';
    }
1275989
public function getModifiers()
    {
        $modifiers = 0;

        if ($this->isFinal()) {
            $modifiers += \ReflectionClass::IS_FINAL;
        }

        if (PHP_VERSION_ID < 70000 && $this->isTrait()) {
            $modifiers += \ReflectionClass::IS_EXPLICIT_ABSTRACT;
        }

        if ($this->classLikeNode instanceof Class_ && $this->classLikeNode->isAbstract()) {
            $modifiers += \ReflectionClass::IS_EXPLICIT_ABSTRACT;
        }

        if ($this->isInterface()) {
            $abstractMethods = $this->getMethods();
        } else {
            $abstractMethods = $this->getMethods(\ReflectionMethod::IS_ABSTRACT);
        }
        if (!empty($abstractMethods)) {
            $modifiers += \ReflectionClass::IS_IMPLICIT_ABSTRACT;
        }

        return $modifiers;
    }
618865
public function getCreatorAliases()
    {
        $paths = [];
        foreach ($this->getCreator() as $key => $value) {
            if (in_array($key, ['hook', 'libraries', 'stylesheets', 'mediaFiles', 'icon', 'src'])) {
                $paths[$key] = preg_replace('/^(.\/)(.*)/', $this->getTypeIdentifier() . "/$2", $this->getCreatorKey($key));
            }
        }
        return $paths;
    }
1286682
public function forTemplate()
	{
		$this->Fields()->bootstrapify();
		$this->Actions()->bootstrapify();
		Requirements::css(FOUNDATIONFORMS_DIR . '/css/foundationforms.css');

		return parent::forTemplate();
	}
369026
private function classes(): string
    {
        $classes = '';

        if ($this->bg_color !== null) {
            $classes .= ' btn-' . $this->bg_color;
        }

        if ($this->text_color !== null) {
            $classes .= ' text-' . $this->text_color;
        }

        if ($this->outline_style !== null) {
            $classes .= ' btn-outline-' . $this->outline_style;
        }

        if ($this->large === true) {
            $classes .= ' btn-lg';
        }

        if ($this->small === true) {
            $classes .= ' btn-sm';
        }

        if ($this->block === true) {
            $classes .= ' btn-block';
        }

        if ($this->active === true) {
            $classes .= ' active';
        }

        if (count($this->custom_classes) > 0) {
            $classes .= ' ' . implode(' ', $this->custom_classes);
        }

        return $classes;
    }
816392
public function chroma() {
        $steps = array('C' => 0, 'D' => 2, 'E' => 4, 'F' => 5, 'G' => 7, 'A' => 9, 'B' => 11);
        $chroma = $steps[$this->step];
        $chroma += $this->alter;
        $chroma = $this->_truemod($chroma, 12);
        return $chroma;
    }
1249040
public function generateCSS()
    {
        $result = '';

        $cssRaw       = '';
        $this->styles = array_unique($this->styles, SORT_REGULAR);
        foreach ($this->styles as $style) {
            if ($style[1]) {
                $cssRaw.=$style[0];
            } else {
                $result.='<link href="'.$style[0].'" rel="stylesheet" type="text/css" />';
            }
        }
        $result.=$cssRaw != '' ? '<style>'.$cssRaw.'</style>' : '';

        return $result;
    }
1229296
public static function output()
    {

        $aArgs = func_get_args();
        $iArgs = func_num_args();

        $c = $aArgs[0];

        if(isset($GLOBALS[self::$pref.$c])){
            switch (true) {
                case ($c == 'js'):

                    $output = Asset::dump($GLOBALS[self::$pref.$c]);

                    break;
                case ($c == 'css'):
                    $output = Asset::dump($GLOBALS[self::$pref.$c]);
                    break;
                default:
                    $output = $GLOBALS[self::$pref.$c];
                    break;
            }
        } else {
            $output = false;
        }



        return $output;
    }
689319
public function forTemplate()
    {
        if (!$this->canBeCached()) {
            HTTPCacheControlMiddleware::singleton()->disableCache();
        }

        $return = $this->renderWith($this->getTemplates());

        // Now that we're rendered, clear message
        $this->clearMessage();

        return $return;
    }
339823
public function sorter()
    {
        if (!$this->sortable) {
            return '';
        }

        $icon = 'fa-sort';
        $type = 'desc';

        if ($this->isSorted()) {
            $type = $this->sort['type'] == 'desc' ? 'asc' : 'desc';
            $icon .= "-amount-{$this->sort['type']}";
        }

        // set sort value
        $sort = ['column' => $this->name, 'type' => $type];
        if (isset($this->cast)) {
            $sort['cast'] = $this->cast;
        }

        $query = app('request')->all();
        $query = array_merge($query, [$this->grid->model()->getSortName() => $sort]);

        $url = url()->current().'?'.http_build_query($query);

        return "<a class=\"fa fa-fw $icon\" href=\"$url\"></a>";
    }
1034915
public function getLiAttr()
    {
        $params = self::$_itemParams;
        $attr   = ['class' => 'li-item'];

        if (isset($params['item']['liClass'])) {
            $attr = $this->addClass($attr, $params['item']['liClass']);
        }

        if ($params['item']['last']) {
            $attr = $this->addClass($attr, 'last');
        }

        if ($params['item']['first']) {
            $attr = $this->addClass($attr, 'first');
        }

        return $this->_setActive($attr);
    }
1294910
public function toStyle(): string
    {
        $values = [];

        if ($this->fgColor) {
            $values[] = $this->fgColor;
        }

        if ($this->bgColor) {
            $values[] = $this->bgColor;
        }

        foreach ($this->options as $option) {
            $values[] = static::$knownOptions[$option];
        }

        return \implode(';', $values);
    }
767915
public function render()
    {
        $converter          = new CssSelectorConverter();
        $this->css          = $this->getCSS();
        foreach ($this->css->getAllRuleSets() as $ruleSet) {
            $selector = $ruleSet->getSelector();
            foreach ($this->domCrawler->evaluate($converter->toXPath($selector[0])) as $node) {
                $rules = $node->getAttribute('style') ? $node->getAttribute('style') . implode(' ',$ruleSet->getRules()) : implode(' ', $ruleSet->getRules());
                $node->setAttribute('style', $rules);
            }
        }
        return preg_replace('/\s+/', ' ', str_replace("\r\n", '',$this->domCrawler->html()));
    }
461137
public function getResizer()
    {
        $options = [
            'image_quality' => $this->config('image_quality'),
            'auto_orient' => $this->config('auto_orient'),
            'color_palette' => $this->config('color_palette'),
        ];

        return new Resizer(
            $this->config('image_processor'), $options
        );
    }
871136
public function getRgba()
    {
        return sprintf('rgba(%d, %d, %d, %.2F)',
            $this->getRedValue(),
            $this->getGreenValue(),
            $this->getBlueValue(),
            $this->getAlphaValue()
        );
    }
1030016
public function clarkNotation()
	{
		if ( $this->namespaceURI )
		{
			return sprintf( '{%s}%s', $this->namespaceURI, $this->localName );
		}
		else
		{
			return $this->localName;
		}
	}
1135545
public function renderForActiveForm()
    {
        $field = $this->activeForm->field($this->property->relatedPropertiesModel, $this->property->code);

        if (!$field) {
            return '';
        }

        return $field;
    }