Skip to content

Fix ReflectionMethod::__construct() deprecations #7

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
merged 3 commits into from
Mar 22, 2025

Conversation

nicodemuz
Copy link
Contributor

Fixes the following issues:

  1. /symfony/vendor/angelov/phpunit-php-vcr/src/Subscribers/AttributeResolverTrait.php:28 Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead

  2. /symfony/vendor/angelov/phpunit-php-vcr/src/Subscribers/AttributeResolverTrait.php:51 Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead

Deprecations reported when executing phpunit in php 8.4.

Fixes the following issues:

1) /symfony/vendor/angelov/phpunit-php-vcr/src/Subscribers/AttributeResolverTrait.php:28
Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead

2) /symfony/vendor/angelov/phpunit-php-vcr/src/Subscribers/AttributeResolverTrait.php:51
Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead
@nicodemuz
Copy link
Contributor Author

ReflectionMethod::createFromMethodName seems to be introduced in php 8.3, so merging this PR may require bumping the php dependencies to 8.3.

@angelov
Copy link
Owner

angelov commented Mar 14, 2025

Thank you for the contribution @nicodemuz!

I think we can avoid the version bumping by checking the PHP version during execution (PHP_VERSION_ID < 80300 or something like that)? So we can be executing the old way when PHP < 8.3, and the new way otherwise.

@nicodemuz
Copy link
Contributor Author

@angelov updated my branch

@nicodemuz
Copy link
Contributor Author

@angelov fixed the checks

@angelov
Copy link
Owner

angelov commented Mar 22, 2025

Thank you @nicodemuz!

@angelov angelov merged commit 9cd4ec1 into angelov:main Mar 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants