Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form][PhpUnitBridge] Remove usage of noopReflectionProperty::setAccessible()#61207

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.4fromNickSdot:chore-setAccessible
Jul 24, 2025

Conversation

@NickSdot
Copy link
Contributor

@NickSdotNickSdot commentedJul 22, 2025
edited
Loading

QA
Branch?6.4
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. Symfony 7.x requires PHP 8.2+.

https://www.php.net/manual/en/reflectionproperty.setaccessible.php

Notes:

  • Component/ErrorHandler/Internal/TentativeTypes.php is auto-generated, didn't touch it.
  • targeted 7.3 because support for 7.2 ends in a few days.
  • now targets 6.4

@carsonbotcarsonbot added this to the7.3 milestoneJul 22, 2025
@OskarStarkOskarStark changed the titlechore: removed usage of noopReflectionProperty::setAccessible()Remove usage of noopReflectionProperty::setAccessible()Jul 22, 2025
@carsonbotcarsonbot changed the titleRemove usage of noopReflectionProperty::setAccessible()[Form][PhpUnitBridge] Remove usage of noopReflectionProperty::setAccessible()Jul 22, 2025
@NickSdot
Copy link
ContributorAuthor

  • fabbot failures are unrelated.
  • windows failure should be unrelated?

@alexandre-daubois
Copy link
Member

alexandre-daubois commentedJul 23, 2025
edited
Loading

Refactors like this one generally target the feature branch (7.4 at this time). Only bug fixes are pushed to 7.3 (and below), so givensetAccessible() is no-op, I'd target 7.4.

And indeed, you can safely ignore fabbot recommendations and Windows failures, which are not related to your pull request.

@NickSdot
Copy link
ContributorAuthor

Refactors like this one generally target the feature branch (7.4 at this time). Only bug fixes are pushed to 7.3 (and below), so givensetAccessible() is no-op, I'd target 7.4.

And indeed, you can safely ignore fabbot recommendations and Windows failures, which are not related to your pull request.

Hey Alexandre, thanks for the input! Before I change the target branch, here my rational why I believe it should be in 7.3. ThisRFC (vote pending) seeks to deprecate the usage in PHP 8.5. If the vote goes through, what I believe based on the internals list discussion, it would unneccessarily spam depcrecation warnings. I agree, it's not a bug, but I think it's a worthy "fix" to have in all supported versions. Wdyt?

@alexandre-daubois
Copy link
Member

alexandre-daubois commentedJul 23, 2025
edited
Loading

Ah yes, I missed this one. Makes sense then 👍 If these lines are also present in earlier versions, it might be a good idea to even target 6.4, so it is also compatible with upcoming 8.5 and doesn't trigger deprecations on release.

@NickSdotNickSdot changed the base branch from7.3 to6.4July 23, 2025 14:56
@NickSdot
Copy link
ContributorAuthor

NickSdot commentedJul 23, 2025
edited
Loading

Done. 6.4 had a few more. Updated and target branch changed!

Edit: I am a bit confused about the test suite here. 😅 Again not related? If there is anything I must do, please let me know.

@nicolas-grekasnicolas-grekas modified the milestones:7.3,6.4Jul 24, 2025
@nicolas-grekas
Copy link
Member

Thank you@NickSdot.

NickSdot reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commit4af9890 intosymfony:6.4Jul 24, 2025
9 of 12 checks passed
@NickSdotNickSdot deleted the chore-setAccessible branchJuly 24, 2025 08:26
privatefunctionaddCoversForClassToAnnotationCache(Test$test,array$covers):void
{
$r =new \ReflectionProperty(TestUtil::class,'annotationCache');
$r->setAccessible(true);
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to revert the changes made to the PHPUnit bridge as it supports PHP 7.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Why does/would the PhpUnit bridge in Symfony 6.4, which requires PHP 8.1, need to support PHP 7?

Choose a reason for hiding this comment

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

We have to indeed, my bad for missing that!
The bridge on 7.4 is the one that's bumped to PHP >= 8.1

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

So back to where we been yesterday? I target 7.4 for the full changes, and 6.4 for everything but bridge?

Copy link
Member

Choose a reason for hiding this comment

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

I added these calls back in0270060 and removed them again when merging branches up in72ccba7.

NickSdot reacted with hooray emojinicolas-grekas reacted with heart emoji
nicolas-grekas added a commit that referenced this pull requestAug 4, 2025
… PHP < 8.1 (W0rma)This PR was merged into the 6.4 branch.Discussion----------[PhpUnitBridge] Call Reflection*::setAccessible() only for PHP < 8.1| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Issues        || License       | MITFollow-up of#61207There are plans to deprecate `Reflection*::setAccessible()` in PHP 8.5:https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecationsThus, it might be beneficial to only call it if PHP < 8.1 is used.Commits-------9e89dd3 Reflection*::setAccessible() has no effect as of PHP 8.1
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@xabbuhxabbuhxabbuh left review comments

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

6 participants

@NickSdot@alexandre-daubois@nicolas-grekas@xabbuh@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp