Skip to content

Commit

Permalink
Apply ECS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Sep 5, 2024
1 parent 9452271 commit 6b63355
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 11 deletions.
1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PaymentNotificationAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

final class PaymentNotificationAction
{
public function __construct (
public function __construct(
private Payum $payum,
private NotifyFactoryInterface $notifyFactory,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __invoke(PreSubmitEvent $preSubmitEvent): void
[
'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.client_secret',
'mapped' => false,
]
],
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Form/Type/TpayGatewayConfigurationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

final class TpayGatewayConfigurationType extends AbstractType
{
public function __construct (
public function __construct(
private PreventSavingEmptyClientSecretListener $preventSavingEmptyClientSecretListener,
) {
}
Expand All @@ -37,15 +37,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
PasswordType::class,
[
'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.client_secret',
]
],
)
->add(
'production_mode',
CheckboxType::class,
[
'label' => 'commerce_weavers_sylius_tpay.admin.gateway_configuration.production_mode',
'value' => false,
]
],
)
;

Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Action/Api/CreateTransactionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class CreateTransactionAction extends BaseApiAwareAction implements Generi
{
use GenericTokenFactoryAwareTrait;

public function __construct (
public function __construct(
private RouterInterface $router,
private string $successRoute,
private string $errorRoute,
Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Action/Api/NotifyAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function execute($request): void
$notificationData = $request->getData();
$status = $notificationData['tr_status'] ?? '';

$details['tpay']['status'] = match(true) {
$details['tpay']['status'] = match (true) {
str_contains($status, 'TRUE') => PaymentInterface::STATE_COMPLETED,
str_contains($status, 'CHARGEBACK') => PaymentInterface::STATE_REFUNDED,
default => PaymentInterface::STATE_FAILED,
Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CaptureAction implements ActionInterface, GatewayAwareInterface
{
use GatewayAwareTrait;

public function __construct (
public function __construct(
private CreateTransactionFactoryInterface $createTransactionFactory,
) {
}
Expand Down
4 changes: 4 additions & 0 deletions src/Payum/Action/GetStatusAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@ public function execute($request): void
case 'correct':
case PaymentInterface::STATE_COMPLETED:
$request->markCaptured();

break;
case 'pending':
case PaymentInterface::STATE_PROCESSING:
$request->markPending();

break;
case 'refund':
case PaymentInterface::STATE_REFUNDED:
$request->markRefunded();

break;
case 'failed':
case PaymentInterface::STATE_FAILED:
$request->markFailed();

break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Request/Api/CreateTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class CreateTransaction extends Generic
{
public function __construct (
public function __construct(
mixed $model,
) {
parent::__construct($model);
Expand Down
2 changes: 1 addition & 1 deletion src/Payum/Request/Api/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Notify extends BaseNotify
/**
* @param ArrayAccess<array-key, mixed> $data
*/
public function __construct (
public function __construct(
mixed $model,
private \ArrayAccess $data,
) {
Expand Down

0 comments on commit 6b63355

Please sign in to comment.