Skip to content

Always show all deprecations except legacy ones when not weak #25997

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

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Jan 31, 2018

When using any mode but the weak mode, you want your build to fail on some or
all deprecations, but it is still nice to be able to see what you could
fix without having to change modes.

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

@greg0ire greg0ire force-pushed the always_display_deprecation_except_legacy branch from c16a35a to abc2e37 Compare January 31, 2018 19:27
@greg0ire greg0ire changed the title Always show all deprecations except legacy one Always show all deprecations except legacy ones Jan 31, 2018
@greg0ire greg0ire force-pushed the always_display_deprecation_except_legacy branch from abc2e37 to e5928c2 Compare January 31, 2018 19:41
@greg0ire greg0ire changed the title Always show all deprecations except legacy ones Always show all deprecations except legacy ones when not weak Jan 31, 2018
@@ -165,13 +165,13 @@ public static function register($mode = 0)

exit(1);
}
if ('legacy' !== $group && !$isWeak) {
Copy link
Member

Choose a reason for hiding this comment

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

the $isWeak variable is not used anymore, isn't it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, good riddance!

Copy link
Member

Choose a reason for hiding this comment

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

but now $isVendor is always false and $inVendors is never called :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I spotted and pushed again yeah :P should have checked the tests before pushing 😅

@greg0ire greg0ire force-pushed the always_display_deprecation_except_legacy branch 2 times, most recently from 993980b to 4af68d9 Compare January 31, 2018 19:52
@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Jan 31, 2018
@@ -111,7 +111,7 @@ public static function register($mode = 0)
$trace = debug_backtrace(true);
$group = 'other';
$isVendor = false;
$isWeak = DeprecationErrorHandler::MODE_WEAK === $mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $isVendor = $inVendors($file));
$isVendor = $inVendors($file);
Copy link
Member

Choose a reason for hiding this comment

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

$isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && ... (same below, so that we don't compute $isVendor when not needed, isn't it?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah plus I have 2 $isVendor assignments now 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The condition on line 147 can go

@greg0ire greg0ire force-pushed the always_display_deprecation_except_legacy branch from 4af68d9 to d7b0236 Compare January 31, 2018 20:11
-----

* all deprecations but those from tests marked with `@group legacy` are always
displayed, regardless of the mode.
Copy link
Member

Choose a reason for hiding this comment

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

needs an update :)

When using any mode but the weak mode, you want your build to fail on
some or all deprecations, but it is still nice to be able to see what
you could fix without having to change modes.
@greg0ire greg0ire force-pushed the always_display_deprecation_except_legacy branch from d7b0236 to 9e37873 Compare January 31, 2018 20:33
@fabpot
Copy link
Member

fabpot commented Feb 7, 2018

Thank you @greg0ire.

@fabpot fabpot merged commit 9e37873 into symfony:master Feb 7, 2018
fabpot added a commit that referenced this pull request Feb 7, 2018
…ot weak (greg0ire)

This PR was merged into the 4.1-dev branch.

Discussion
----------

Always show all deprecations except legacy ones when not weak

When using any mode but the weak mode, you want your build to fail on some or
all deprecations, but it is still nice to be able to see what you could
fix without having to change modes.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

9e37873 Always show all deprecations except legacy ones
@greg0ire greg0ire deleted the always_display_deprecation_except_legacy branch February 7, 2018 07:17
nicolas-grekas added a commit that referenced this pull request Feb 11, 2018
* 3.4:
  [Bridge/PhpUnit] Fix tests by backporting #25997 to 3.4
nicolas-grekas added a commit that referenced this pull request Feb 11, 2018
* 4.0:
  [Bridge/PhpUnit] Fix tests by backporting #25997 to 3.4
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Feb 11, 2018

FYI, this PR has been backported to 3.4 in 9a9c0f6. There is now way to make tests pass otherwise, since this changes the behavior.

@fabpot fabpot mentioned this pull request May 7, 2018
greg0ire added a commit to greg0ire/symfony that referenced this pull request Jul 23, 2018
The behavior has changed since symfony#25997
greg0ire added a commit to greg0ire/symfony that referenced this pull request Jul 23, 2018
The behavior has changed since symfony#25997
greg0ire added a commit to greg0ire/symfony that referenced this pull request Jul 23, 2018
The behavior has changed since symfony#25997
greg0ire added a commit to greg0ire/symfony that referenced this pull request Jul 23, 2018
The behavior has changed since symfony#25997
nicolas-grekas added a commit that referenced this pull request Jul 25, 2018
This PR was squashed before being merged into the 4.1 branch (closes #28046).

Discussion
----------

[PhpUnitBridge] Describe weak_vendors properly

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The `weak_vendors` mode now displays deprecations, this behavior has changed since #25997

Commits
-------

336008c [PhpUnitBridge] Describe weak_vendors properly
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.

4 participants