Fix PHP 8.4 deprecation: use explicit nullable types#43
Open
bnzo wants to merge 1 commit intoFintecture:masterfrom
Open
Fix PHP 8.4 deprecation: use explicit nullable types#43bnzo wants to merge 1 commit intoFintecture:masterfrom
bnzo wants to merge 1 commit intoFintecture:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #42
Summary
PHP 8.4 deprecated implicitly marking typed parameters as nullable via a
nulldefault value (e.g.Type $param = null). This triggersE_DEPRECATEDwarnings 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$httpClientApi/ApiWrapper.php—$headersparam inget(),post(),patch(),delete()Api/Auth/Token.php—$codeingenerate()Api/Ais/Connect.php—$scopeingenerate()Api/Customers/Customers.php—$customerIdinget()Api/Pis/Initiate.php—$stateingenerate()Api/Pis/Payment.php—$sessionId,$withBeneficiary,$withVirtualBeneficiaryinget()Api/Pis/Refund.php—$stateingenerate()Api/Pis/RequestToPay.php—$redirectUri,$stateingenerate()Api/Pis/Settlement.php—$settlementIdinget()Api/Resources/Provider.php—$idinget()Config/Endpoint.php—$environmentingetApiUrl()Config/Telemetry.php—$additionalMetricsinlogAction()andgetMetrics()Util/Header.php—$customCredentialsingenerate()Util/PemManager.php—$encryptionManagerin constructorTest plan
E_DEPRECATEDwarnings on PHP 8.4+