-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] Replace "weak-verbose" by "deprecations upper bound" mode #16937
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
924bd98
to
7432078
Compare
@@ -28,6 +27,9 @@ public static function register($mode = false) | |||
if (self::$isRegistered) { | |||
return; | |||
} | |||
if (self::MODE_WEAK !== $mode) { | |||
$mode = preg_match('/^[1-9][0-9]*$/', $mode) ? (int) $mode : 0; |
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.
this will break the regex filtering feature
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.
indeed... fixed!
7432078
to
806ccb6
Compare
I suggest adding some phpdoc on the |
806ccb6
to
33e7d8f
Compare
@stof good idea, done |
I actually like the weak-verbose mode. What's wrong with it? But as long as I just need to set a very high number to achieve the same, I'm fine with it. |
@craue that's how you can get the equivalent of weak-verbose yes |
👍 This is indeed a better solution. |
/** | ||
* Registers and configures the deprecation handler. | ||
* | ||
* @param string|int $mode Configures the reporting mode: |
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.
the default value false
does not match the document types :)
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.
default value set to 0
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.
Well, accepting false
should be kept, for easy usage with getenv
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.
ok :) updated
2037821
to
dfe59d9
Compare
* - use a number to define the upper bound of allowed deprecations, | ||
* making the test suite fail whenever more notices are trigerred. | ||
* | ||
* @param scalar $mode The reporting mode. Defaults to not allowing any deprecations. |
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.
Is scalar
supported by common IDEs or should we use int|string|bool
instead?
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.
you're right, scalar
is not a keyword of phpdoc: http://phpdoc.org/docs/latest/references/phpdoc/types.html
dfe59d9
to
58cd3ee
Compare
…s upper bound" mode (nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [PhpUnitBridge] Replace "weak-verbose" by "deprecations upper bound" mode | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16789, #14475 | License | MIT | Doc PR | - This is a "new feature" that replaces a "new feature" not yet released but merged into 2.8.1. See #16789. It is way more flexible to be able to specify the upper bound of remaining deprecation notices that you allow in your test suite. This allows lowering this number while deprecations are removed, step after step. ping @wouterj @Tobion @craue @fabpot @stof Commits ------- 58cd3ee [PhpUnitBridge] Replace "weak-verbose" by "deprecations upper bound" mode
* - use a number to define the upper bound of allowed deprecations, | ||
* making the test suite fail whenever more notices are trigerred. | ||
* | ||
* @param int|string|false $mode The reporting mode. Defaults to not allowing any deprecations. |
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.
What false
does doesn't seem to be defined at all.
It's the first release with the deprecations upper bound feature included: symfony/symfony#16937
This is a "new feature" that replaces a "new feature" not yet released but merged into 2.8.1. See #16789.
It is way more flexible to be able to specify the upper bound of remaining deprecation notices that you allow in your test suite. This allows lowering this number while deprecations are removed, step after step.
ping @wouterj @Tobion @craue @fabpot @stof