SqlParser\Utils\Formatter::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( array $options = [] )
$options array The formatting options.
    public function __construct(array $options = array())
    {
        // The specified formatting options are merged with the default values.
        $this->options = array_merge(array('type' => php_sapi_name() == 'cli' ? 'cli' : 'text', 'line_ending' => NULL, 'indentation' => '  ', 'remove_comments' => false, 'clause_newline' => true, 'parts_newline' => true, 'indent_parts' => true, 'formats' => array(array('type' => Token::TYPE_KEYWORD, 'flags' => Token::FLAG_KEYWORD_RESERVED, 'html' => 'class="sql-reserved"', 'cli' => "", 'function' => 'strtoupper'), array('type' => Token::TYPE_KEYWORD, 'flags' => 0, 'html' => 'class="sql-keyword"', 'cli' => "", 'function' => 'strtoupper'), array('type' => Token::TYPE_COMMENT, 'flags' => 0, 'html' => 'class="sql-comment"', 'cli' => "", 'function' => ''), array('type' => Token::TYPE_BOOL, 'flags' => 0, 'html' => 'class="sql-atom"', 'cli' => "", 'function' => 'strtoupper'), array('type' => Token::TYPE_NUMBER, 'flags' => 0, 'html' => 'class="sql-number"', 'cli' => "", 'function' => 'strtolower'), array('type' => Token::TYPE_STRING, 'flags' => 0, 'html' => 'class="sql-string"', 'cli' => "", 'function' => ''), array('type' => Token::TYPE_SYMBOL, 'flags' => 0, 'html' => 'class="sql-variable"', 'cli' => "", 'function' => ''))), $options);
        if (is_null($this->options['line_ending'])) {
            $this->options['line_ending'] = $this->options['type'] == 'html' ? '<br/>' : "\n";
        }
        // `parts_newline` requires `clause_newline`
        $this->options['parts_newline'] &= $this->options['clause_newline'];
    }