Skip to content

Remove deprecation notice on nullable properties in method signatures  #277

@LaurentBrieu

Description

@LaurentBrieu

Environment

  • Checkout SDK version: 3.2.7
  • Operating System and version: MacOS 14.2.1

Description

Update methods signatures to avoid deprecation notices when using PHP 8.4 :

Checkout\Payments\PaymentsClient::capturePayment(): Implicitly marking parameter $captureRequest as nullable is deprecated, the explicit nullable type must be used instead
Checkout\Payments\PaymentsClient::refundPayment(): Implicitly marking parameter $refundRequest as nullable is deprecated, the explicit nullable type must be used instead
Checkout\Payments\PaymentsClient::voidPayment(): Implicitly marking parameter $voidRequest as nullable is deprecated, the explicit nullable type must be used instead
Checkout\Payments\PaymentsClient::incrementPaymentAuthorization(): Implicitly marking parameter $authorizationRequest as nullable is deprecated, the explicit nullable type must be used instead

Proposed Solution

Generally speaking, across the whole project, it will be cool to set the expected types in method signatures, so that we don't have that kind of deprecations in the future.

Regarding the ones i've mentionned above, here's a quick fix.

public function capturePayment($paymentId, CaptureRequest $captureRequest = null, ?string $idempotencyKey = null)
public function refundPayment($paymentId, RefundRequest $refundRequest = null, ?string $idempotencyKey = null)
public function voidPayment($paymentId, VoidRequest $voidRequest = null, ?string $idempotencyKey = null)
public function incrementPaymentAuthorization($paymentId, AuthorizationRequest $authorizationRequest = null, ?string $idempotencyKey = null)
  • I may be able to implement this feature

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions