-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow easier extend of BrowserConsoleHandler.php #1593
Conversation
b700251
to
3d55ecf
Compare
// This handler only works with HTML and javascript outputs | ||
// text/javascript is obsolete in favour of application/javascript, but still used | ||
if (stripos($contentType, 'application/javascript') !== false || stripos($contentType, 'text/javascript') !== false) { | ||
return static::FORMAT_JS; |
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.
why not self::
?
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.
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.
Yeah on the other hand you used self:: below at line 166. I don't particularly think it matters as nobody should change/override these constants, but it'd be good to at least be consistent about it :)
3d55ecf
to
a3ac34a
Compare
return static::FORMAT_JS; | ||
} | ||
if (stripos($contentType, 'text/html') === false) { | ||
return null; |
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 do question the value of doing this change to null
.. why not keep 'unknown'
, so it always returns a string? Right now getResponseFormat's return value is broken for example as you didn't update it.
I don't really see the value in deprecating this, except causing more fragmentation in implementations, and added work.
public const FORMAT_HTML = 'html'; | ||
public const FORMAT_JS = 'js'; |
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.
public const FORMAT_HTML = 'html'; | |
public const FORMAT_JS = 'js'; | |
protected const FORMAT_HTML = 'html'; | |
protected const FORMAT_JS = 'js'; |
I don't think there's value in this being public
Thanks |
This will allow to get rid of reimplementation of wheel here https://github.com/symfony/symfony/pull/43065/files#diff-b1c0588c5bb7078514aaa70581e920b852b49d9614f687950b6be6495afa7693R29-R42