Skip to content

Fix PHP 8.4 deprecation warnings by adding explicit nullable types - #58

Open
sneakyvv wants to merge 1 commit into
klaviyo:master-1.x.xfrom
sneakyvv:master-1.x.x
Open

Fix PHP 8.4 deprecation warnings by adding explicit nullable types#58
sneakyvv wants to merge 1 commit into
klaviyo:master-1.x.xfrom
sneakyvv:master-1.x.x

Conversation

@sneakyvv

Copy link
Copy Markdown

PHP 8.4 deprecates implicitly marking parameters as nullable when they have a default value of null. This change adds explicit ?string and ?Context type declarations to parameters that accept null values, ensuring compatibility with PHP 8.4's stricter type system.

Affected methods:

  • PromotionsExporter::exportToCSV() - and
  • PromotionsExporter::getPromotions() -
  • ConfigurationFactory::create() -
  • ConfigurationFactoryInterface::create() -
  • KlaviyoGateway::trackEvents() -
  • KlaviyoGateway::getExcludedSubscribersFromList() -
  • ClientConfigurationFactory::createByKeys() -

This addresses issue #53

PHP 8.4 deprecates implicitly nullable parameters (where a typed parameter
has a default value of null without the ? prefix). This adds explicit nullable
type declarations to all affected parameters across the codebase, fixes
trim() calls on potentially null values, and adds the missing return type
to jsonSerialize().

Fixes klaviyo#53
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.

1 participant