doctrine/sql-formatter

Implement NullHighlighter

greg0ire opened this issue · 1 comments

i believe that all this if ($highlight) conditions can be replaced by having the highlighter passed as parameter here instead of the constructor and having a NoHighlightHighlighter implementation when no highlight is needed.

Originally posted by @goetas in #21

I think I'm going to name it NullHighlighter because it is easier on the eyes and also because null object is the name of that pattern AFAIK.

I'm not quite sure about the usage though. Passing it as a parameter seems unnecessary, I doubt people will need to turn it on and off in the same execution.