Skip to content

Commit

Permalink
Merge pull request #21 from tomkalon/OP-368
Browse files Browse the repository at this point in the history
OP-368 - Added Sylius 1.13 support
  • Loading branch information
bitbager committed Sep 3, 2024
2 parents f998268 + bacd741 commit 5664b4d
Show file tree
Hide file tree
Showing 63 changed files with 426 additions and 522 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.0 ]
symfony: [ ^5.4, ^6.0 ]
sylius: [ ~1.11.0, ~1.12.0 ]
node: [ 12.x ]
mysql: [ 5.7, 8.0 ]

php: ["8.0", "8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["20.x"]
mysql: ["5.7", "8.0"]
exclude:
-
sylius: ~1.11.0
symfony: ^6.0
- sylius: "~1.13.0"
php: "8.0"

env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -47,7 +46,7 @@ jobs:
coverage: none

- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"

Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,6 @@ sylius_fixtures:
clientId: "test"
region: de
```
Configure config/packages/webpack_encore.yaml
```yaml
builds:
*: *
shop: '%kernel.project_dir%/public/build/shop'
admin: '%kernel.project_dir%/public/build/admin'
```
## Testing


Expand Down
23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
"require": {
"php": "^8.0",
"amzn/amazon-pay-sdk-php": "^3.7",
"sylius/sylius": "~1.11.0 || ~1.12.0",
"symfony/webpack-encore-bundle": "^1.14"
"sylius/sylius": "~1.12.0 || ~1.13.0"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"bitbag/coding-standard": "^1.0",
"behat/behat": "^3.7",
"behat/mink-selenium2-driver": "~1.6.0",
"bitbag/coding-standard": "^3.0",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
Expand All @@ -29,18 +28,19 @@
"friends-of-behat/variadic-extension": "^1.3",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.85",
"phpstan/phpstan-doctrine": "0.12.33",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-strict-rules": "^1.3",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"vimeo/psalm": "4.7.1 || ^5.0"
"vimeo/psalm": "4.7.1 || ^5.0",
"symfony/webpack-encore-bundle": "^1.14"
},
"config": {
"sort-packages": true,
Expand All @@ -51,6 +51,9 @@
"symfony/flex": true
}
},
"conflict": {
"doctrine/persistence": "<3.0"
},
"autoload": {
"psr-4": {
"BitBag\\SyliusAmazonPayPlugin\\": "src/",
Expand Down
15 changes: 6 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php');
return static function (ECSConfig $config): void {

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
__DIR__ . '/tests',
]);
putenv('ALLOW_BITBAG_OS_HEADER=1');

$config->import('vendor/bitbag/coding-standard/ecs.php');
$config->paths(['src', 'tests']);
};
17 changes: 8 additions & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon

parameters:
reportUnmatchedIgnoredErrors: false
level: 8

symfony:
container_xml_path: tests/Application/var/cache/test/ApplicationTests_BitBag_SyliusAmazonPayPlugin_Application_KernelTestDebugContainer.xml
paths:
- src

reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false

excludes_analyse:
# Makes PHPStan crash
Expand All @@ -18,4 +16,5 @@ parameters:
- 'tests/Application/src/**.php'

ignoreErrors:
- '/Parameter #1 $configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration() expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface|null given./'
- identifier: missingType.iterableValue
- identifier: missingType.generics
15 changes: 6 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
colors="true"
bootstrap="tests/Application/config/bootstrap.php">
<testsuites>
<testsuite name="BitBagSyliusAmazonPayPlugin Test Suite">
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
<env name="APP_ENV" value="test"/>
<env name="SHELL_VERBOSITY" value="-1" />
</testsuites>

<php>
<ini name="error_reporting" value="-1" />

<server name="KERNEL_CLASS_PATH" value="/tests/Application/AppKernel.php" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />

<!-- ###+ symfony/framework-bundle ### -->
<env name="APP_ENV" value="dev"/>
<env name="APP_SECRET" value="9757207ee812063f4a21ab5aae31ab92"/>
<!-- ###- symfony/framework-bundle ### -->
<env name="APP_ENV" value="test"/>
<env name="SHELL_VERBOSITY" value="-1" />
</php>
</phpunit>
9 changes: 5 additions & 4 deletions src/AmazonPayGatewayFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/BitBagSyliusAmazonPayPlugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
13 changes: 7 additions & 6 deletions src/Cli/Command/UpdateAmazonPayStatusCommand.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand All @@ -28,7 +29,7 @@ final class UpdateAmazonPayStatusCommand extends Command

public function __construct(
PaymentRepositoryInterface $paymentRepository,
PaymentStateResolverInterface $paymentStateResolver
PaymentStateResolverInterface $paymentStateResolver,
) {
parent::__construct();

Expand All @@ -49,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$payments = $this->paymentRepository->findAllByGatewayFactoryNameAndState(
AmazonPayGatewayFactory::FACTORY_NAME,
PaymentInterface::STATE_PROCESSING
PaymentInterface::STATE_PROCESSING,
);

foreach ($payments as $payment) {
Expand Down
9 changes: 5 additions & 4 deletions src/Client/AmazonPayApiClient.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Client/AmazonPayApiClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Controller/Action/AddressSelectAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Controller/Action/AmazonPayErrorAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down
11 changes: 6 additions & 5 deletions src/Controller/Action/AmazonPayInitializeAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct(
PaymentMethodResolverInterface $paymentMethodResolver,
AmazonPayApiClientInterface $amazonPayApiClient,
OrderProcessorInterface $orderProcessor,
EntityManagerInterface $orderEntityManager
EntityManagerInterface $orderEntityManager,
) {
$this->cartContext = $cartContext;
$this->paymentMethodResolver = $paymentMethodResolver;
Expand Down
11 changes: 6 additions & 5 deletions src/Controller/Action/AmazonPayStartAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?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
*/
* 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 hello@bitbag.io.
*/

declare(strict_types=1);

Expand Down Expand Up @@ -35,7 +36,7 @@ public function __construct(Environment $templating)
public function __invoke(Request $request): Response
{
return new Response(
$this->templating->render('BitBagSyliusAmazonPayPlugin:AmazonPay:amazonPayStart.html.twig')
$this->templating->render('BitBagSyliusAmazonPayPlugin:AmazonPay:amazonPayStart.html.twig'),
);
}
}
Loading

0 comments on commit 5664b4d

Please sign in to comment.