Ensures the dump output uses the correct styles for Snap.

Can be overwritten by setting the config key.

@since  1.0.0

@return array
336219
private static function get_styles()
    {
        $style = Config::get('debug.dump_set_style', 'snap');

        if (\is_array($style)) {
            return $style;
        }

        if (\array_key_exists($style, self::$schemes)) {
            return self::$schemes[ $style ];
        }

        return self::$schemes['snap'];
    }
803670
public function dump()
    {
        $attributes = array();

        if ($this->id) {
            $attributes['$id'] = $this->id;
        }

        foreach ($this->attributes as $key => $value) {
            $schema = $this->schema($key);

            if (! empty($schema['transient'])) {
                continue;
            }

            $attributes[$key] = $value;
        }

        return $attributes;
    }
1033921
protected function getDefaultFormats()
    {
        return [
            [
                'type' => Token::TYPE_KEYWORD,
                'flags' => Token::FLAG_KEYWORD_RESERVED,
                'html' => 'class="sql-reserved"',
                'cli' => "\x1b[35m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_KEYWORD,
                'flags' => 0,
                'html' => 'class="sql-keyword"',
                'cli' => "\x1b[95m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_COMMENT,
                'flags' => 0,
                'html' => 'class="sql-comment"',
                'cli' => "\x1b[37m",
                'function' => '',
            ],
            [
                'type' => Token::TYPE_BOOL,
                'flags' => 0,
                'html' => 'class="sql-atom"',
                'cli' => "\x1b[36m",
                'function' => 'strtoupper',
            ],
            [
                'type' => Token::TYPE_NUMBER,
                'flags' => 0,
                'html' => 'class="sql-number"',
                'cli' => "\x1b[92m",
                'function' => 'strtolower',
            ],
            [
                'type' => Token::TYPE_STRING,
                'flags' => 0,
                'html' => 'class="sql-string"',
                'cli' => "\x1b[91m",
                'function' => '',
            ],
            [
                'type' => Token::TYPE_SYMBOL,
                'flags' => 0,
                'html' => 'class="sql-variable"',
                'cli' => "\x1b[36m",
                'function' => '',
            ],
        ];
    }
1094987
public function export_for_pix() {
        $title = isset($this->attributes['title']) ? $this->attributes['title'] : '';
        if (empty($title)) {
            $title = isset($this->attributes['alt']) ? $this->attributes['alt'] : '';
        }
        return [
            'key' => $this->pix,
            'component' => $this->component,
            'title' => $title
        ];
    }
943814
public function get_precompiled_css_content() {
        $configs = [$this] + $this->parent_configs;
        $css = '';

        foreach ($configs as $config) {
            if (isset($config->precompiledcsscallback)) {
                $function = $config->precompiledcsscallback;
                if (function_exists($function)) {
                    $css .= $function($this);
                }
            }
        }
        return $css;
    }
583760
public function getDefaultOptions()
    {
        return array(
            'isPublic' => true,
            'encodeOutput' => function_exists('gzdeflate'),
            'encodeMethod' => null, // determine later
            'encodeLevel' => 9,

            'minifiers' => array(
                Minify::TYPE_JS => array('JSMin\\JSMin', 'minify'),
                Minify::TYPE_CSS => array('Minify_CSSmin', 'minify'),
                Minify::TYPE_HTML => array('Minify_HTML', 'minify'),
            ),
            'minifierOptions' => array(), // no minifier options

            'contentTypeCharset' => 'utf-8',
            'maxAge' => 1800, // 30 minutes
            'rewriteCssUris' => true,
            'bubbleCssImports' => false,
            'quiet' => false, // serve() will send headers and output
            'debug' => false,
            'concatOnly' => false,

            // if you override these, the response codes MUST be directly after
            // the first space.
            'badRequestHeader' => 'HTTP/1.0 400 Bad Request',
            'errorHeader' => 'HTTP/1.0 500 Internal Server Error',

            // callback function to see/modify content of all sources
            'postprocessor' => null,
            // file to require to load preprocessor
            'postprocessorRequire' => null,

            /**
             * If this string is not empty AND the serve() option 'bubbleCssImports' is
             * NOT set, then serve() will check CSS files for @import declarations that
             * appear too late in the combined stylesheet. If found, serve() will prepend
             * the output with this warning.
             */
            'importWarning' => "/* See https://github.com/mrclay/minify/blob/master/docs/CommonProblems.wiki.md#imports-can-appear-in-invalid-locations-in-combined-css-files */\n"
        );
    }
829055
private function prepareConfigs()
    {
        $this->library = Config::get('imageupload.library', 'gd');
        $this->quality = Config::get('imageupload.quality', 90);
        $this->uploadpath = Config::get('imageupload.path', public_path('uploads/images'));
        $this->newfilename = Config::get('imageupload.newfilename', 'original');
        $this->dimensions = Config::get('imageupload.dimensions');
        $this->suffix = Config::get('imageupload.suffix', true);
        $this->exif = Config::get('imageupload.exif', false);
        $this->output = Config::get('imageupload.output', 'array');

        $this->intervention->configure(['driver' => $this->library]);

        return $this;
    }
76668
protected function dump()
    {
        $this->write('-- '.date('c').' - '.$this->config->dsn, false);

        if ($this->config->disableAutoCommit === true) {
            $this->write('SET AUTOCOMMIT = 0');
        }

        if ($this->config->disableForeignKeyChecks === true) {
            $this->write('SET FOREIGN_KEY_CHECKS = 0');
        }

        if ($this->config->disableUniqueKeyChecks === true) {
            $this->write('SET UNIQUE_CHECKS = 0');
        }

        if ($this->config->createDatabase) {
            if ($this->config->createDatabase === true) {
                $database = $this->database;
            } else {
                $database = (string) $this->config->createDatabase;
            }

            $this->write(
                'CREATE DATABASE IF NOT EXISTS `'.$database.'` '.
                'DEFAULT CHARACTER SET = '.$this->escape($this->config->encoding)
            );
            $this->write('USE `'.$database.'`');
        }

        $this->dumpTables();
        $this->dumpViews();
        $this->dumpTriggers();
        $this->dumpEvents();

        if ($this->config->disableForeignKeyChecks === true) {
            $this->write('SET FOREIGN_KEY_CHECKS = 1');
        }

        if ($this->config->disableUniqueKeyChecks === true) {
            $this->write('SET UNIQUE_CHECKS = 1');
        }

        if ($this->config->disableAutoCommit === true) {
            $this->write('COMMIT');
            $this->write('SET AUTOCOMMIT = 1');
        }

        $this->write("\n-- Completed on: ".date('c'), false);
    }
156034
public function getConfig()
    {
        // Create default keys for the config
        $config = array_merge([
            'width'   => null,
            'height'  => null,
            'options' => null,
        ], $this->config);

        // Add crops
        if ($crop = $this->getAttributeValue('crop_box')) {
            if (!is_array($config['options'])) {
                $config['options'] = [];
            }
            $config['options']['trim_perc'] = [
                round($crop->x1, 4),
                round($crop->y1, 4),
                round($crop->x2, 4),
                round($crop->y2, 4),
            ];
        }

        // Return config
        return $config;
    }
769345
public function getSupportedFormats()
    {
        $formats = array();

        foreach (gd_info() as $name => $status) {
            if (strpos($name, 'Support') !== false && $status) {
                $formats[] = strtolower(strtok($name, ' '));
            }
        }

        return array_unique($formats);
    }
459060
private function getConfiguration()
    {
        return array_merge(
            [
                'fileMimeTypeField' => false,
                'fileNameField'     => false,
                'filePathField'     => false,
                'fileSizeField'     => false,
            ],
            $this->classMetadata->getExtension(UploadableDriver::EXTENSION_NAME),
            [
                'uploadable'        => true,
                'allowOverwrite'    => $this->allowOverwrite,
                'appendNumber'      => $this->appendNumber,
                'path'              => $this->path,
                'pathMethod'        => $this->pathMethod,
                'callback'          => $this->callback,
                'filenameGenerator' => $this->filenameGenerator,
                'maxSize'           => (float) $this->maxSize,
                'allowedTypes'      => $this->allowedTypes,
                'disallowedTypes'   => $this->disallowedTypes,
            ]
        );
    }
1299116
public function actionConfigInfo()
    {
        $this->outputInfo("dev config file: " . Yii::getAlias($this->configFile));
        
        $config = $this->readConfig();
        
        if (!$config) {
            return $this->outputError("Unable to open config file.");
        }
        
        foreach ($config as $key => $value) {
            $this->output("{$key} => ".VarDumper::dumpAsString($value));
        }
    }
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);
    }
872404
public function getStyles()
    {
        $styles = $this->config()->get('styles');
        $i18nStyles = array();
        if ($styles) {
            foreach ($styles as $key => $label) {
                $i18nStyles[$key] = _t('PlaceableObject_Preset.STYLE'.strtoupper($key), $label);
            }
        }
        return $i18nStyles;
    }
917761
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('n', $this->name, '')
                    ->setArray('t', $this->titles->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setString('a', $this->author, '')
                    ->setString('v', $this->version, '')
                    ->setString('f', $this->fileName, '')
                    ->setString('i', $this->directoryName, '')
                    ->setArray('e', $this->dependencies, function (Dependency $dependency): array {
                        return $dependency->writeData();
                    }, [])
                    ->setString('h', $this->thumbnailHash, '')
                    ->setString('s', $this->checksum, '')
                    ->setInteger('o', $this->order, 0)
                    ->setArray('c', array_values(array_unique($this->combinationHashes)), 'strval', []);
        return $dataBuilder->getData();
    }
1094161
protected function dump() {
    $str = '';
    foreach (array_values($this->loadedObjects) as $curObject) {
      $str .= $curObject->dump();
    }
    return $str;
  }
747305
protected function getKeysToWrite()
    {
        $keys = array_get($this->config, 'keys', ['*']);

        if (in_array('*', $keys)) {
            return $this->getWritableDefaultKeys();
        }

        return $keys;
    }