Skip to content

[PhpUnitBridge] Do not override correct triggering file for return type deprecations #43241

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

wouterj
Copy link
Member

@wouterj wouterj commented Sep 28, 2021

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Return type deprecations were sometimes incorrectly marked as direct/indirect, even when they occur on a vendor package. This is due to their special message, which starts with Method "classFromVendor::method()" might add "type" [...] do the same in "affectedClass" [...] (normal messages start with the affected class).

This means that the deprecation type checked whether the method causing the deprecation was inside the vendor directory, rather than the method affected by the deprecation. Even more, if the causing method was from PHP internals, $this->triggeringFile would become false, causing realpath(false) to return the current directory - meaning these were always marked as direct.

@wouterj
Copy link
Member Author

wouterj commented Sep 28, 2021

Btw, we can also once again reword the deprecation message to fit the standard set by all other deprecation messages. I'm all ears for suggestions :)

@fabpot
Copy link
Member

fabpot commented Sep 29, 2021

Isn't it something for 5.3?

@fabpot fabpot modified the milestones: 5.4, 5.3 Sep 29, 2021
@fabpot
Copy link
Member

fabpot commented Sep 29, 2021

Thank you @wouterj.

@fabpot fabpot force-pushed the bugfix/indirect-return-type-deprecations branch from 7f416d5 to 9bcfdde Compare September 29, 2021 16:22
@fabpot fabpot merged commit d121089 into symfony:5.3 Sep 29, 2021
@wouterj wouterj deleted the bugfix/indirect-return-type-deprecations branch September 29, 2021 16:34
nicolas-grekas added a commit that referenced this pull request Sep 30, 2021
…r missing return types on 5.3 (chalasr)

This PR was merged into the 5.3 branch.

Discussion
----------

[PhpUnitBridge] Fix skipping triggering file override for missing return types on 5.3

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | -
| Tickets       | -
| License       | MIT
| Doc PR        | -

#43241 was merged in 5.3 instead of 5.4, but the deprecation notice was reworded on 5.4: #42935.

Commits
-------

c1034dc [PHPUnitBridge] Fix skipping triggering file override on 5.3
symfony-splitter pushed a commit to symfony/phpunit-bridge that referenced this pull request Sep 30, 2021
…r missing return types on 5.3 (chalasr)

This PR was merged into the 5.3 branch.

Discussion
----------

[PhpUnitBridge] Fix skipping triggering file override for missing return types on 5.3

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | -
| Tickets       | -
| License       | MIT
| Doc PR        | -

symfony/symfony#43241 was merged in 5.3 instead of 5.4, but the deprecation notice was reworded on 5.4: symfony/symfony#42935.

Commits
-------

c1034dc940 [PHPUnitBridge] Fix skipping triggering file override on 5.3
@fabpot fabpot mentioned this pull request Oct 29, 2021
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