Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function setDefaultCard(string $cardId): Customer
* @throws \Potelo\MultiPayment\Exceptions\GatewayException
* @throws \Potelo\MultiPayment\Exceptions\GatewayNotAvailableException
*/
public function getCreditCard(string $creditCardId, GatewayContract|string $gateway = null): CreditCard
public function getCreditCard(string $creditCardId, GatewayContract|string|null $gateway = null): CreditCard
{
$gateway = ConfigurationHelper::resolveGateway($gateway);
$creditCard = new CreditCard();
Expand All @@ -207,7 +207,7 @@ public function getCreditCard(string $creditCardId, GatewayContract|string $gate
* @throws \Potelo\MultiPayment\Exceptions\GatewayException
* @throws \Potelo\MultiPayment\Exceptions\GatewayNotAvailableException
*/
public function deleteCreditCard(string $creditCardId, GatewayContract|string $gateway = null): void
public function deleteCreditCard(string $creditCardId, GatewayContract|string|null $gateway = null): void
{
$gateway = ConfigurationHelper::resolveGateway($gateway);
$creditCard = new CreditCard();
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function validateAutomaticPixAttribute(): void
/**
* @inheritDoc
*/
public function save(GatewayContract|string $gateway = null, bool $validate = true): void
public function save(GatewayContract|string|null $gateway = null, bool $validate = true): void
{
if ($validate) {
$this->validate();
Expand Down
8 changes: 4 additions & 4 deletions src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function create(array $data, $gateway = null): void
* @return void
* @throws GatewayException|GatewayNotAvailableException|ModelAttributeValidationException|\Potelo\MultiPayment\Exceptions\ConfigurationException
*/
public function save(GatewayContract|string $gateway = null, bool $validate = true): void
public function save(GatewayContract|string|null $gateway = null, bool $validate = true): void
{
$class = $this->getClassName();
if (property_exists($this, 'id') && !empty($this->id)) {
Expand Down Expand Up @@ -161,7 +161,7 @@ protected static function getClassName(): string
* @throws \Potelo\MultiPayment\Exceptions\ConfigurationException
* @throws \Potelo\MultiPayment\Exceptions\GatewayException
*/
public function get(GatewayContract|string $gateway = null): static
public function get(GatewayContract|string|null $gateway = null): static
{
$method = 'get' . static::getClassName();
$gateway = ConfigurationHelper::resolveGateway($gateway);
Expand All @@ -179,7 +179,7 @@ public function get(GatewayContract|string $gateway = null): static
* @throws \Potelo\MultiPayment\Exceptions\ConfigurationException
* @throws \Potelo\MultiPayment\Exceptions\GatewayException
*/
public function delete(GatewayContract|string $gateway = null): void
public function delete(GatewayContract|string|null $gateway = null): void
{
$method = 'delete' . static::getClassName();
$gateway = ConfigurationHelper::resolveGateway($gateway);
Expand All @@ -192,7 +192,7 @@ public function delete(GatewayContract|string $gateway = null): void
/**
* Refresh the model instance with the latest data from the gateway.
*/
public function refresh(GatewayContract|string $gateway = null): static
public function refresh(GatewayContract|string|null $gateway = null): static
{
$gateway = ConfigurationHelper::resolveGateway($gateway);
return $this->get($gateway);
Expand Down
Loading