Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DebugBundle] Added 'theme' option to change the color of dump() when rendered inside templates#29528

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@dem3trio
Copy link
Contributor

QA
Branch?master for features
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

Added a html_dumper_theme option config to use the new HtmlDumper light theme when using dump() inside templates

#SymfonyConHackday2018

@nicolas-grekasnicolas-grekas added this to thenext milestoneDec 8, 2018
@dem3triodem3trio changed the title[HackDay][DebugBundle] Added html_dumper_theme option to change the color of dump() when ren…[HackDay][DebugBundle] Added 'theme' option to change the color of dump() when ren…Dec 8, 2018
@nicolas-grekasnicolas-grekas changed the title[HackDay][DebugBundle] Added 'theme' option to change the color of dump() when ren…[DebugBundle] Added 'theme' option to change the color of dump() when rendered inside templatesDec 13, 2018
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM with some minor comments.

->end()
;

if (class_exists(HtmlDumper::class) &&method_exists(HtmlDumper::class,'setTheme')) {

Choose a reason for hiding this comment

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

can be simplified:
if (method_exists(HtmlDumper::class, 'setTheme')) {

->addMethodCall('setMinDepth',array($config['min_depth']))
->addMethodCall('setMaxString',array($config['max_string_length']));

if (class_exists(HtmlDumper::class) &&method_exists(HtmlDumper::class,'setTheme')) {

Choose a reason for hiding this comment

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

if ('dark' !== $config['theme'] && method_exists(HtmlDumper::class, 'setTheme')) {

Copy link
ContributorAuthor

@dem3triodem3trioDec 24, 2018
edited
Loading

Choose a reason for hiding this comment

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

The'dark' !== $config['theme'] will not launch an undefinex index notice with var dumper 4.1?

In that case, the Configuration class will not initialize the $config['theme'] index because 'setTheme' doesn't exists.

it wouldn't be better to set something like this?:

if (isset($config['theme'] && 'dark' !== $config['theme'] && method_exists(HtmlDumper::class, 'setTheme')) {

Or maybe leave it just as:
if (method_exists(HtmlDumper::class, 'setTheme')) {
as it appears in the Configuration class.

Choose a reason for hiding this comment

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

Correct.if (method_exists(HtmlDumper::class, 'setTheme') && 'dark' !== $config['theme']) { then!

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

with a minor comment

->children()
->enumNode('theme')
->info('Changes the color of the dump() output when rendered directly on the templating. "dark" (default) or "light"')
->example('"dark"')
Copy link
Member

Choose a reason for hiding this comment

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

The otherexample calls we have do not wrap strings, should probably be->example('dark').

@fabpot
Copy link
Member

Something went bad when merging, can you re-push your work here? Sorry about that.

@dem3triodem3trioforce-pushed theadd_html_dumper_theme_config_option branch fromc0bb3a7 tofeb6f34CompareJanuary 1, 2019 23:15
@dem3trio
Copy link
ContributorAuthor

I've made agit push --force it's that enough? If you need anything else, tell me.

@fabpot
Copy link
Member

It's not enough. You need to executegit rebase origin/master as this will remove the merge commits.

@dem3triodem3trioforce-pushed theadd_html_dumper_theme_config_option branch fromfeb6f34 toa0db35aCompareJanuary 2, 2019 22:33
@dem3trio
Copy link
ContributorAuthor

created new origin "sf" (symfony/symfony)
git pull sf master
git push origin master
git checkout add_html_dumper_theme_config_option
git rebase origin/master
andgit push --force

I hope i've done well this time

@fabpotfabpotforce-pushed theadd_html_dumper_theme_config_option branch froma0db35a to91e8057CompareJanuary 3, 2019 03:26
@fabpot
Copy link
Member

Thank you@dem3trio.

@fabpotfabpot merged commit91e8057 intosymfony:masterJan 3, 2019
fabpot added a commit that referenced this pull requestJan 3, 2019
… of dump() when rendered inside templates (dem3trio)This PR was squashed before being merged into the 4.3-dev branch (closes#29528).Discussion----------[DebugBundle] Added 'theme' option to change the color of dump() when rendered inside templates| Q             | A| ------------- | ---| Branch?       | master for features| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| License       | MITAdded a html_dumper_theme option config to use the new HtmlDumper light theme when using dump() inside templates#SymfonyConHackday2018Commits-------91e8057 [DebugBundle] Added 'theme' option to change the color of dump() when rendered inside templates
@ro0NLro0NL mentioned this pull requestJan 3, 2019
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@fabpotfabpotfabpot approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@dem3trio@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp