diff options
author | Michal Čihař <michal@cihar.com> | 2017-01-03 13:13:50 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-01-03 13:13:50 +0100 |
commit | bda11c8a47be03b2691c20f1249cb2ad633d691a (patch) | |
tree | 7fef58c20bd9235a5335a2947177dcb7ea564047 | |
parent | 7eebd40cef49caaaf5163febe5e2082f00cf76d0 (diff) | |
download | sql-parser-bda11c8a47be03b2691c20f1249cb2ad633d691a.zip sql-parser-bda11c8a47be03b2691c20f1249cb2ad633d691a.tar.gz sql-parser-bda11c8a47be03b2691c20f1249cb2ad633d691a.tar.bz2 |
Make the code a bit more readable
Do not misuse ternary erorr silence operator to check if variable is
set.
Signed-off-by: Michal Čihař <michal@cihar.com>
-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 51f8633..ff41065 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -71,7 +71,11 @@ class Formatter $options ); - $options['formats'] = self::mergeFormats($this->getDefaultFormats(), @$options['formats'] ?: array()); + if (isset($options['formats'])) { + $options['formats'] = self::mergeFormats($this->getDefaultFormats(), $options['formats']); + } else { + $options['formats'] = $this->getDefaultFormats(); + } if (is_null($options['line_ending'])) { $options['line_ending'] = $options['type'] === 'html' ? '<br/>' : "\n"; |