Skip to content

Fix PHP 8.4 deprecation: use explicit nullable types#43

Open
bnzo wants to merge 1 commit intoFintecture:masterfrom
bnzo:fix/explicit-nullable-types
Open

Fix PHP 8.4 deprecation: use explicit nullable types#43
bnzo wants to merge 1 commit intoFintecture:masterfrom
bnzo:fix/explicit-nullable-types

Conversation

@bnzo
Copy link
Copy Markdown

@bnzo bnzo commented Apr 2, 2026

Fixes #42

Summary

PHP 8.4 deprecated implicitly marking typed parameters as nullable via a null default value (e.g. Type $param = null). This triggers E_DEPRECATED warnings at runtime.

This PR updates all 20 occurrences across 15 files to use the explicit nullable type syntax (?Type $param = null), which is supported since PHP 7.1 and is fully backwards compatible.

Files changed

  • Client.php — constructor $httpClient
  • Api/ApiWrapper.php$headers param in get(), post(), patch(), delete()
  • Api/Auth/Token.php$code in generate()
  • Api/Ais/Connect.php$scope in generate()
  • Api/Customers/Customers.php$customerId in get()
  • Api/Pis/Initiate.php$state in generate()
  • Api/Pis/Payment.php$sessionId, $withBeneficiary, $withVirtualBeneficiary in get()
  • Api/Pis/Refund.php$state in generate()
  • Api/Pis/RequestToPay.php$redirectUri, $state in generate()
  • Api/Pis/Settlement.php$settlementId in get()
  • Api/Resources/Provider.php$id in get()
  • Config/Endpoint.php$environment in getApiUrl()
  • Config/Telemetry.php$additionalMetrics in logAction() and getMetrics()
  • Util/Header.php$customCredentials in generate()
  • Util/PemManager.php$encryptionManager in constructor

Test plan

  • No behavioral changes — only type declaration syntax updated
  • All existing tests should pass without modification
  • Eliminates all E_DEPRECATED warnings on PHP 8.4+

PHP 8.4 deprecated implicitly nullable parameters (e.g. `Type $param = null`).
This updates all occurrences to use the explicit `?Type $param = null` syntax
across the codebase.

Affected files:
- Client.php
- Api/ApiWrapper.php (get, post, patch, delete)
- Api/Auth/Token.php
- Api/Ais/Connect.php
- Api/Customers/Customers.php
- Api/Pis/Initiate.php, Payment.php, Refund.php, RequestToPay.php, Settlement.php
- Api/Resources/Provider.php
- Config/Endpoint.php, Telemetry.php
- Util/Header.php, PemManager.php
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.

PHP 8.4 deprecation : Implicitly nullable parameter types

1 participant