Skip to content

Commit

Permalink
feat: add type hints for parameters and return types in payment classes
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Feb 22, 2025
1 parent 7229e6e commit 3ea6820
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Concerns/WithPaymentProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function updatePaymentProfile(Customer $customer, array $data = []): Paym
/**
* Deletes a customer payment profile from the payment gateway.
*/
public function deletePaymentProfile($customer, PaymentProfile $profile)
public function deletePaymentProfile(Customer $customer, PaymentProfile $profile)
{
throw new \LogicException('Method deletePaymentProfile must be implemented on your custom payment class.');
}
Expand Down
4 changes: 3 additions & 1 deletion src/Payments/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Igniter\Flame\Exception\ApplicationException;
use Igniter\PayRegister\Classes\BasePaymentGateway;
use Igniter\PayRegister\Concerns\WithPaymentRefund;
use Igniter\PayRegister\Models\PaymentProfile;
use Igniter\User\Models\Customer;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Response;
use Mollie\Api\MollieApiClient;
Expand Down Expand Up @@ -209,7 +211,7 @@ public function processRefundForm($data, $order, $paymentLog)
/**
* {@inheritdoc}
*/
public function updatePaymentProfile($customer, $data)
public function updatePaymentProfile(Customer $customer, array $data = []): PaymentProfile
{
$profile = $this->model->findPaymentProfile($customer);
$profileData = $profile ? (array)$profile->profile_data : [];
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/Square.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function processPaymentForm($data, $host, $order)
/**
* {@inheritdoc}
*/
public function supportsPaymentProfiles()
public function supportsPaymentProfiles(): bool
{
return true;
}
Expand Down

0 comments on commit 3ea6820

Please sign in to comment.