-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Conversation
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; | ||
} |
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.
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;
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.
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.
… passed in as well
a9050a4
to
749fba5
Compare
👍 Status: Reviewed |
👍 |
1 similar comment
👍 |
Thank you @Seldaek. |
…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
…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