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: ensure class_exists is not called with null #2405

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

carlos-granados
Copy link
Contributor

In the keyType() function in Model.php we were calling class_exists() to find out if a class existed. However, in some cases the value that we were checking could be null. Since PHP 8.1 a deprecation warning is thrown. In this PR we check that the value that we are passing is not null before calling class_exists(), thus removing the deprecation

Fixes #2372

@carlos-granados carlos-granados requested a review from a team as a code owner March 10, 2023 11:39
@bshaffer bshaffer changed the title Fixes deprecation thrown when calling class_exists with null in PHP 8.1 fix: calling class_exists with null in Google\Model Mar 16, 2023
@bshaffer bshaffer changed the title fix: calling class_exists with null in Google\Model fix: ensure class_exists is not called with null Mar 16, 2023
@bshaffer bshaffer enabled auto-merge (squash) March 16, 2023 22:55
@bshaffer bshaffer merged commit 5ed4edc into googleapis:main Mar 17, 2023
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.

class_exists() seems to be called on a null value, which causes a deprecation warning in PHP >=8.1
2 participants