Skip to content

Commit

Permalink
Fixed code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Jun 22, 2023
1 parent cf9f3d6 commit 0179434
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/Concerns/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ protected function getEvent(Model $payment): ?string
protected function getEventClass(StatusData $data, int|string $status): ?string
{
return match ($status) {
$data->new => NewEvent::class,
$data->success => SuccessEvent::class,
$data->refund => RefundEvent::class,
$data->new => NewEvent::class,
$data->success => SuccessEvent::class,
$data->refund => RefundEvent::class,
$data->waitRefund => WaitRefundEvent::class,
$data->failed => FailedEvent::class,
default => null
$data->failed => FailedEvent::class,
default => null
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/Data/Config/Payment/StatusData.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class StatusData extends Data
public function get(StatusEnum $status): mixed
{
return match ($status) {
StatusEnum::new => $this->new,
StatusEnum::success => $this->success,
StatusEnum::refund => $this->refund,
StatusEnum::new => $this->new,
StatusEnum::success => $this->success,
StatusEnum::refund => $this->refund,
StatusEnum::waitRefund => $this->waitRefund,
StatusEnum::failed => $this->failed,
StatusEnum::failed => $this->failed,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/Events/Payments/FailedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class FailedEvent extends BaseEvent { }
class FailedEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Payments/NewEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class NewEvent extends BaseEvent { }
class NewEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Payments/RefundEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class RefundEvent extends BaseEvent { }
class RefundEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Payments/SuccessEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class SuccessEvent extends BaseEvent { }
class SuccessEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Payments/WaitRefundEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class WaitRefundEvent extends BaseEvent { }
class WaitRefundEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Processes/CheckedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class CheckedEvent extends BaseEvent { }
class CheckedEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Processes/RefundedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class RefundedEvent extends BaseEvent { }
class RefundedEvent extends BaseEvent {}
2 changes: 1 addition & 1 deletion src/Events/Processes/StartedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

use CashierProvider\Core\Events\BaseEvent;

class StartedEvent extends BaseEvent { }
class StartedEvent extends BaseEvent {}
8 changes: 4 additions & 4 deletions src/Jobs/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public function retryUntil(): ?Carbon
protected function findStatus(?string $status): ?Status
{
return match (true) {
$this->hasFailed($status) => Status::failed,
$this->hasFailed($status) => Status::failed,
$this->hasRefunding($status) => Status::waitRefund,
$this->hasRefunded($status) => Status::refund,
$this->hasSuccess($status) => Status::success,
default => null
$this->hasRefunded($status) => Status::refund,
$this->hasSuccess($status) => Status::success,
default => null
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/Observers/DetailsObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function saved(CashierDetail $model): void

if ($model->isDirty('details')) {
match (true) {
$statuses->hasSuccess($status) => $this->updateStatus($model, Status::success),
$statuses->hasSuccess($status) => $this->updateStatus($model, Status::success),
$statuses->hasRefunded($status) => $this->updateStatus($model, Status::refund),
$statuses->hasFailed($status) => $this->updateStatus($model, Status::failed),
$statuses->hasFailed($status) => $this->updateStatus($model, Status::failed),
};
}

Expand Down

0 comments on commit 0179434

Please sign in to comment.