You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In https://github.com/googleapis/google-api-php-client/blob/main/src/Model.php#L296class_exists() is called on a dynamic property. Looking at the code, the method expects the property to either not exist, or contain a valid class name as a value. However, it seems it is possible the property exists, but with a null value. PHP 8.1 and up now displays the following deprecation notice when class_exists() is called with a null value as the first parameter:
Deprecated: class_exists(): Passing null to parameter #1 ($class) of type string is deprecated
Example code
This piece of pseudo code is based on the code that triggers the warning for me:
I'm not too familiar with the inner workings of the Google API client, so I'm not sure whether my assumption is correct (model property can exist, but with a null value, which is not accounted for in the code) or that properties with null values should not exist in the first place. Therefore I can't provide a good suggestion on how the issue could be resolved.
The text was updated successfully, but these errors were encountered:
Environment details
Description
In https://github.com/googleapis/google-api-php-client/blob/main/src/Model.php#L296
class_exists()
is called on a dynamic property. Looking at the code, the method expects the property to either not exist, or contain a valid class name as a value. However, it seems it is possible the property exists, but with anull
value. PHP 8.1 and up now displays the following deprecation notice whenclass_exists()
is called with anull
value as the first parameter:Example code
This piece of pseudo code is based on the code that triggers the warning for me:
The last line triggers the deprecation warning.
I'm not too familiar with the inner workings of the Google API client, so I'm not sure whether my assumption is correct (model property can exist, but with a null value, which is not accounted for in the code) or that properties with null values should not exist in the first place. Therefore I can't provide a good suggestion on how the issue could be resolved.
The text was updated successfully, but these errors were encountered: