Skip to content

Commit bda11c8

Browse files
committed
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>
1 parent 7eebd40 commit bda11c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Utils/Formatter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ private function getMergedOptions(array $options)
7171
$options
7272
);
7373

74-
$options['formats'] = self::mergeFormats($this->getDefaultFormats(), @$options['formats'] ?: array());
74+
if (isset($options['formats'])) {
75+
$options['formats'] = self::mergeFormats($this->getDefaultFormats(), $options['formats']);
76+
} else {
77+
$options['formats'] = $this->getDefaultFormats();
78+
}
7579

7680
if (is_null($options['line_ending'])) {
7781
$options['line_ending'] = $options['type'] === 'html' ? '<br/>' : "\n";

0 commit comments

Comments
 (0)