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 PHP8 notice for object to int conversion #100

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

iquito
Copy link
Contributor

@iquito iquito commented Dec 25, 2020

PHP8 emits the notice "Notice: Object of class GdImage could not be converted to int" when comparing the result of imagecreatetruecolor with an int. imagecreatetruecolor returns false on any errors, so a strict comparison to false is more sensible and works in both PHP7 and PHP8.

This fixes #99.

PHP8 emits the notice "Notice: Object of class GdImage could not be converted to int". imagecreatetruecolor returns false on any errors, so a strict comparison to false is more sensible and works in both PHP7 and PHP8.
@sonarcloud
Copy link

sonarcloud bot commented Dec 25, 2020

SonarCloud Quality Gate failed.

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 34 Code Smells

No Coverage information No Coverage information
26.9% 26.9% Duplication

@ffflabs
Copy link
Collaborator

ffflabs commented Apr 25, 2021

nice catch. Thanks for your contribution

@ffflabs ffflabs merged commit e2120f5 into HuasoFoundries:master Apr 25, 2021
ffflabs added a commit that referenced this pull request Apr 26, 2021
@ffflabs
Copy link
Collaborator

ffflabs commented Apr 26, 2021

@all-contributors please add @iquito for code

@allcontributors
Copy link
Contributor

@ffflabs

I've put up a pull request to add @iquito! 🎉

@ffflabs
Copy link
Collaborator

ffflabs commented Apr 26, 2021

@all-contributors please add @iquito for code

@allcontributors
Copy link
Contributor

@ffflabs

I've put up a pull request to add @iquito! 🎉

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.

Check for invalid GD image resource not compatible with PHP 8.
2 participants