diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-09-13 16:02:44 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-09-13 16:02:44 +0200 |
commit | c7f2d0c0a2621c20d3a8b527de9ca392e53c2def (patch) | |
tree | f6808daf5296ae7a42d0c87c8cf7275dadb798ae /src | |
parent | aa5d75cb393c25a99fa5d462f69ab5422a548711 (diff) | |
download | sql-parser-c7f2d0c0a2621c20d3a8b527de9ca392e53c2def.zip sql-parser-c7f2d0c0a2621c20d3a8b527de9ca392e53c2def.tar.gz sql-parser-c7f2d0c0a2621c20d3a8b527de9ca392e53c2def.tar.bz2 |
fix default options in Formater constructor
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils/Formatter.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index 56691eb..f82ef13 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -73,7 +73,7 @@ class Formatter * * @var string */ - 'line_ending' => $this->options['type'] == 'html' ? '<br/>' : "\n", + 'line_ending' => NULL, /** * The string used for indentation. @@ -172,6 +172,10 @@ class Formatter $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']; } |