Skip to content
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

Fix issue with TransportException #11974

Merged
merged 1 commit into from
May 21, 2024

Conversation

sam-bee
Copy link
Contributor

@sam-bee sam-bee commented May 13, 2024

To enable to the TransportException code to be accessed in PHP < 8.1 make reflection property accessible

Without this change, I get this error in PHP versions below 8.1:

$ composer why-not [package name] [version]

In Application.php line 449:
                                                                                 
  Cannot access non-public member Composer\Downloader\TransportException::$code  
                                                                                 

prohibits [-r|--recursive] [-t|--tree] [--locked] [--] <package> <version>

This issue seems to have been introduced in Composer 2.7.5.

This bug will not be present with PHP 8.1 +, according to setAccessible docs.

@Seldaek Seldaek added this to the 2.7 milestone May 21, 2024
@Seldaek Seldaek added the Bug label May 21, 2024
@Seldaek
Copy link
Member

Seldaek commented May 21, 2024

Oh oops yes sorry about that.

@Seldaek Seldaek merged commit d4b071b into composer:main May 21, 2024
18 of 20 checks passed
@Seldaek
Copy link
Member

Seldaek commented May 21, 2024

And thanks for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants