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

Deprecation Error - Callables of the Form #321

Open
faithfulman18 opened this issue Sep 13, 2024 · 2 comments
Open

Deprecation Error - Callables of the Form #321

faithfulman18 opened this issue Sep 13, 2024 · 2 comments
Assignees
Labels

Comments

@faithfulman18
Copy link
Contributor

Describe the bug
Hello, when running that latest .phar 4.1.13 file against our WSDL, using PHP 8.2 , we are seeing this error:

Deprecated: Callables of the form ["WsdlToPhp\WsdlHandler\Wsdl", "parent::getElementsByName"] are deprecated in vendor/wsdltophp/wsdlhandler/src/Wsdl.php on line 83

To Reproduce
Steps to reproduce the behavior:

  • During the package generation
    Running this command:

php.exe ./wsdltophp.phar generate:package --urlorpath="http://internal-vendor-website.com?singleWsdl" --destination="C:\WSDL\Package" --composer-name="company/package" --namespace="PackageName" --composer-settings="config.disable-tls:true" --force

Expected behavior
Getting the following error on some WSDLs multiple times

Deprecated: Callables of the form ["WsdlToPhp\WsdlHandler\Wsdl", "parent::getElementsByName"] are deprecated in vendor/wsdltophp/wsdlhandler/src/Wsdl.php on line 83

@faithfulman18 faithfulman18 changed the title Deprication Error - Callables of the Form Deprecation Error - Callables of the Form Sep 13, 2024
@mikaelcom
Copy link
Member

I did not look at all how it is advised to replace this type of calls. If you have any clue/tips, feel free to share it, thx

@faithfulman18
Copy link
Contributor Author

This is not the exact same error message but it appears related. Some callable syntax was marked as deprecated in PHP 8.2.

“Deprecated: Use of "self" in callables is deprecated in ... on line ...”

Possible Solution:

“The easiest way to avoid the deprecation notice is to convert all self, parent, and static keywords in the callable construction to their corresponding class names. This can be easily done with the ::class magic method, which resolves to the fully-qualified class name.”

Links:
https://php.watch/versions/8.2/partially-supported-callable-deprecation
https://www.php.net/manual/en/migration82.deprecated.php

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

No branches or pull requests

2 participants