Skip to content
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

Merged
merged 3 commits into from Mar 13, 2022

Conversation

Warxcell
Copy link
Contributor

// 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not self:: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

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 :)

return static::FORMAT_JS;
}
if (stripos($contentType, 'text/html') === false) {
return null;
Copy link
Owner

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.

Comment on lines 39 to 40
public const FORMAT_HTML = 'html';
public const FORMAT_JS = 'js';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@Seldaek Seldaek added this to the 2.x milestone Oct 1, 2021
@Seldaek Seldaek added the Feature label Oct 1, 2021
@Seldaek Seldaek merged commit 1c8f39a into Seldaek:main Mar 13, 2022
@Seldaek
Copy link
Owner

Seldaek commented Mar 13, 2022

Thanks

@lyrixx lyrixx mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants