-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use polymorphism for highlighting #21
Conversation
Don't review yet, I'm going to simplify it further. |
825a12a
to
adb19f2
Compare
This constant is defined since php 5.3, and we require 7.2.
adb19f2
to
f219f3a
Compare
Okay now you can review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to me the pr looks good, i have suggested two "bigger changes", it is up to you decide if they are worth or not (imo yes :-), especially the one on the interface )
@@ -1187,7 +1127,7 @@ public function format(string $string, bool $highlight = true) : string | |||
foreach ($tokens as $i => $token) { | |||
// Get highlighted token if doing syntax highlighting | |||
if ($highlight) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Definitely worth it, will look into it! |
02cc0a3
to
a89bbdd
Compare
Please approve again @goetas |
No description provided.