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 warning in PHP 8.2 #109

Open
rodrigoprimo opened this issue Nov 29, 2022 · 7 comments
Open

Deprecation warning in PHP 8.2 #109

rodrigoprimo opened this issue Nov 29, 2022 · 7 comments

Comments

@rodrigoprimo
Copy link

When running this package with PHP 8.2 RC6 I'm seeing the following deprecation warning:

Creation of dynamic property Gregwar\Captcha\CaptchaBuilder::$background is deprecated vendor-prefixed/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php:430

https://github.com/Gregwar/Captcha/blob/master/src/Gregwar/Captcha/CaptchaBuilder.php#L430

AnnoyingTechnology added a commit to AnnoyingTechnology/Captcha that referenced this issue Mar 7, 2023
@sscotti
Copy link

sscotti commented Mar 24, 2023

Seeing this error also. Is there a composer package where it is fixed. Looks like the latest is 1.1.9

@Gregwar
Copy link
Owner

Gregwar commented Mar 24, 2023

Hello,
I fixed this and tagged v1.2.0, can you confirm me it's alright ?

@Gregwar
Copy link
Owner

Gregwar commented Mar 24, 2023

(Actually, this variable was not even used)

@sscotti
Copy link

sscotti commented Mar 24, 2023

I'll have to check again. I reverted my PHP version to ">=8.0.19", instead for now.
With PHP 8.2.x I was having some issues, both with PHP composer packages and some of my stuff.

I have "gregwar/captcha": "1.1.9", for yours now, but not sure I actually have that after my update. Is there a comment somewhere that says what the actual version besides in composer ?

This was the culprit: $value = mt_rand((int)$min, (int)$max); 609. (added the (int)

#[\AllowDynamicProperties] supresses the deprecation warning for errors related to the dynamic properties in some classes

I'll have to rebuild with 8.2.x to make sure it is fixed.

Is there some global way to take care of that dynamic property warning besides the #[\AllowDynamicProperties] until I can stamp out all of those.

@sscotti
Copy link

sscotti commented Mar 24, 2023

This type of thing works OK as a temporary fix for a package that doesn't have a fix yet, not yours.

    "exclude-from-classmap": [
    	"vendor/aranyasen/hl7/src/HL7/Segments/PID.php"
    	],
    "files": [
    	"vendoroverrides/aranyasen/hl7/src/HL7/Segments/PID.php",
    	"vendoroverrides/aranyasen/hl7/src/HL7/Segments/IPC.php",
    	"vendoroverrides/aranyasen/hl7/src/HL7/Segments/TXA.php"
    	]

@parsgit
Copy link

parsgit commented Apr 5, 2023

php: 8.2
Error : Implicit conversion from float 25.5 to int loses precision (CaptchaBuilder.php :365)

This error has been there for php 8.2 for a long time and it has not been fixed

@btry
Copy link

btry commented May 2, 2023

Hi @parsgit I just created a fix for this error (see #110)

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

No branches or pull requests

5 participants