8000 PHP8.4 fix: Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() by Jimbolino · Pull Request #1236 · phpmd/phpmd · GitHub
[go: up one dir, main page]

Skip to content

PHP8.4 fix: Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() #1236

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

Open
wants to merge 15 commits into
base: 3.x
Choose a base branch
from

Conversation

Jimbolino
Copy link

fix: Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in src/Rule/UnusedFormalParameter.php on line 146

Type: bugfix
Breaking change: no

https://www.php.net/manual/en/reflectionmethod.construct.php#:~:text=The%20alternative%20signature%20is%20deprecated%20as%20of%20PHP%208.4.0

https://www.php.net/manual/en/reflectionmethod.createfrommethodname.php

@Jimbolino
Copy link
Author

ah shoot, i misread the doc. This only works for 8.3 and up

Copy link
codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.81%. Comparing base (3a8f6ed) to head (cd601db).

Additional details and impacted files
@@            Coverage Diff            @@
##                3.x    #1236   +/-   ##
=========================================
  Coverage     91.81%   91.81%           
- Complexity     1285     1286    +1     
=========================================
  Files           107      107           
  Lines          3518     3519    +1     
=========================================
+ Hits           3230     3231    +1     
  Misses          288      288           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

fix: Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in src/Rule/UnusedFormalParameter.php on line 146
@AJenbo
Copy link
Member
AJenbo commented May 2, 2025

It looks like what we actually need is to conditionally ignore this function being unknown in < 8.3.

https://github.com/phpstan/phpstan-src/blob/2.1.x/build/ignore-by-php-version.neon.php

@kylekatarnls
Copy link
Member

Crap @phpstan-ignore won't do the trick the way we use it as it does not raise the same problems depending on the version (depending if the method exists or not) 😞

@evs-xsarus evs-xsarus mentioned this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0