Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Convert Output::write's type to an options arg where verbosity can be passed in as well #15772

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

Merged
merged 1 commit into from
Sep 13, 2015

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Sep 12, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15680
License MIT
Doc PR

$verbosity = self::VERBOSITY_VERY_VERBOSE;
} elseif ($options & self::VERBOSITY_DEBUG) {
$verbosity = self::VERBOSITY_DEBUG;
}
Copy link
Member

Choose a reason for hiding this comment

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

these if/elseif statements can be simplified significantly:

$typeCheck = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN;
$type = $typeCheck & $options ?: self::OUTPUT_NORMAL;
$verbosity = ~$typeCheck & $options ?: self::VERBOSITY_NORMAL;

or (less dynamic):

$type = 7 & $options ?: self::OUTPUT_NORMAL;
$verbosity = -8 & $options ?: self::VERBOSITY_NORMAL;

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup that's a good point, thanks. I implemented it with a fully explicit version for both types and verbosities though just so the code is more clear.

@wouterj
Copy link
Member

wouterj commented Sep 12, 2015

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Sep 13, 2015

👍

1 similar comment
@dunglas
Copy link
Member

dunglas commented Sep 13, 2015

👍

@fabpot
Copy link
Member

fabpot commented Sep 13, 2015

Thank you @Seldaek.

@fabpot fabpot merged commit 749fba5 into symfony:2.8 Sep 13, 2015
fabpot added a commit that referenced this pull request Sep 13, 2015
…erbosity can be passed in as well (Seldaek)

This PR was merged into the 2.8 branch.

Discussion
----------

Convert Output::write's type to an options arg where verbosity can be passed in as well

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15680
| License       | MIT
| Doc PR        |

Commits
-------

749fba5 Convert Output::write's type to an options arg where verbosity can be passed in as well
fabpot added a commit that referenced this pull request Sep 13, 2015
…ixes #15680 (Seldaek)

This PR was merged into the 2.8 branch.

Discussion
----------

Make the exception output visible even in quiet mode, fixes #15680

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15680
| License       | MIT
| Doc PR        |

This builds upon #15772 and sets the exception output in Application::renderException to use VERBOSITY_QUIET so that exceptions are always visible. IMO it's a good change but I can see that it is potentially controversial.

Commits
-------

e9ee8f5 Make the exception output visible even in quiet mode, fixes #15680
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants