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 notices when using with PHP 8.4 #1056

Open
mikkamp opened this issue Dec 5, 2024 · 0 comments
Open

Deprecation notices when using with PHP 8.4 #1056

mikkamp opened this issue Dec 5, 2024 · 0 comments
Labels
bug Something isn't working triage Need triage

Comments

@mikkamp
Copy link

mikkamp commented Dec 5, 2024

Your client library and Google Ads API versions:

  • Client library version: dev-legacy-v25.0.0
  • Google Ads API version: V18
    Your environment:
    PHP 7. 4 up to PHP 8.4

Description of the bug:
When using the library on PHP 8.4 there are several deprecation notices which are logged. They all seem to be coming from the same function parseName which must make the $template parameter type nullable.

There might be other occurrences of PHP 8.4 incompatibilities in the library, but these are the ones we encountered from the parts that we use.

Steps to reproduce:
Use one of the services from the library with PHP 8.4 ensuring that deprecation notices are being logged.

Expected behavior:
No deprecation notices when running on PHP 8.4

Request/Response Logs:
These are the notices we are currently encountering:

GoogleAdsServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/GoogleAdsServiceClient.php:1789

CustomerServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/CustomerServiceClient.php:163

ConversionActionServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/ConversionActionServiceClient.php:157

CampaignServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/CampaignServiceClient.php:287

ProductLinkInvitationServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/ProductLinkInvitationServiceClient.php:164

LabelServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/LabelServiceClient.php:141

CampaignBudgetServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/CampaignBudgetServiceClient.php:141

AssetServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/AssetServiceClient.php:161

AssetGroupServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/AssetGroupServiceClient.php:159

AssetGroupAssetServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/AssetGroupAssetServiceClient.php:181

ExtensionFeedItemServiceClient::parseName(): Implicitly marking parameter $template as nullable is deprecated, the explicit nullable type must be used instead
google-listings-and-ads/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V16/Services/Client/ExtensionFeedItemServiceClient.php:211

Anything else we should know about your project / environment:
The error logs from above are from V16 of the API, however this is still the same with the files for the latest V18 as well.

We include the library within a WordPress extension so we need to remain compatible with PHP 7.4 up to PHP 8.4, which is why we are currently using the legacy package: https://packagist.org/packages/googleads/google-ads-php#dev-legacy-v25.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Need triage
Projects
None yet
Development

No branches or pull requests

1 participant