Skip to content

Commit

Permalink
OP-377 - Apply ECS fixes, update ECS config and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKostrubiec committed Jul 26, 2024
1 parent 54d9486 commit 71a42da
Show file tree
Hide file tree
Showing 28 changed files with 240 additions and 68 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"symfony/webpack-encore-bundle": "^1.16"
},
"require-dev": {
"doctrine/annotations": "^1.13",
"bitbag/coding-standard": "^3.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.8.1",
Expand Down
21 changes: 4 additions & 17 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

declare(strict_types=1);

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

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests/Behat',
__DIR__ . '/ecs.php',
]);
return static function (ECSConfig $config): void {

$ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php');
putenv('ALLOW_BITBAG_OS_HEADER=1');

$ecsConfig->skip([
VisibilityRequiredFixer::class => ['*Spec.php'],
]);
$config->import('vendor/bitbag/coding-standard/ecs.php');
$config->paths(['src', 'tests']);
};
11 changes: 9 additions & 2 deletions src/Action/CaptureAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down Expand Up @@ -71,7 +78,7 @@ public function execute($request): void

$transactionReference = $model['transactionReference'] ?? null;

if ($transactionReference !== null) {
if (null !== $transactionReference) {
if ($this->mercanetBnpParibasBridge->isPostMethod()) {
$model['status'] = $this->mercanetBnpParibasBridge->paymentVerification() ?
PaymentInterface::STATE_COMPLETED : PaymentInterface::STATE_CANCELLED
Expand All @@ -84,7 +91,7 @@ public function execute($request): void
return;
}

if ($model['status'] === PaymentInterface::STATE_COMPLETED) {
if (PaymentInterface::STATE_COMPLETED === $model['status']) {
return;
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/Action/ConvertPaymentAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down Expand Up @@ -40,7 +47,7 @@ public function supports($request)
return
$request instanceof Convert &&
$request->getSource() instanceof PaymentInterface &&
$request->getTo() === 'array'
'array' === $request->getTo()
;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Action/NotifyAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
11 changes: 9 additions & 2 deletions src/Action/StatusAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down Expand Up @@ -53,12 +60,12 @@ public function execute($request): void
return;
}

if ($status === PaymentInterface::STATE_CANCELLED) {
if (PaymentInterface::STATE_CANCELLED === $status) {
$request->markCanceled();

return;
}
if ($status === PaymentInterface::STATE_COMPLETED) {
if (PaymentInterface::STATE_COMPLETED === $status) {
$request->markCaptured();

return;
Expand Down
7 changes: 7 additions & 0 deletions src/BitBagMercanetBnpParibasPlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
7 changes: 7 additions & 0 deletions src/Bridge/MercanetBnpParibasBridge.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
7 changes: 7 additions & 0 deletions src/Bridge/MercanetBnpParibasBridgeInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
7 changes: 7 additions & 0 deletions src/DependencyInjection/BitBagMercanetBnpParibasExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
7 changes: 7 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\MercanetBnpParibasPlugin\DependencyInjection;
Expand Down
7 changes: 7 additions & 0 deletions src/Form/Type/MercanetBnpParibasGatewayConfigurationType.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

/**
Expand Down
Loading

0 comments on commit 71a42da

Please sign in to comment.