Skip to content

Commit

Permalink
Merge pull request #3 from odiseoteam/1.1
Browse files Browse the repository at this point in the history
Update Sylius 1.12 and Symfony 6.4
  • Loading branch information
bigboss86 authored Mar 22, 2024
2 parents e9804de + ebf4f52 commit aa41051
Show file tree
Hide file tree
Showing 68 changed files with 295 additions and 609 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,39 @@ on:

jobs:
tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"

strategy:
fail-fast: false
matrix:
php: ["7.4", "8.0"]
symfony: ["^4.4", "^5.2"]
sylius: ["~1.9.0", "~1.10.0"]
node: ["10.x"]
php: ["8.0", "8.1"]
symfony: ["5.4.*", "^6.0"]
sylius: ["^1.12"]
node: ["14.x", "16.x", "18.x"]
mysql: ["5.7", "8.0"]

exclude:
-
php: "8.0"
sylius: "~1.9.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
with:
php-version: "${{ matrix.php }}"
extensions: intl
tools: symfony
tools: flex,symfony
coverage: none

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

Expand Down Expand Up @@ -85,22 +80,27 @@ jobs:
-
name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

-
name: Cache Composer
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Configure global composer
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2"
-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
Expand All @@ -111,15 +111,17 @@ jobs:
-
name: Install PHP dependencies
run: composer install --no-interaction
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

-
name: Get Yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

-
name: Cache Yarn
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
Expand All @@ -140,7 +142,7 @@ jobs:
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)
(cd tests/Application && yarn build:prod)
-
name: Prepare test application cache
Expand Down Expand Up @@ -184,7 +186,7 @@ jobs:

-
name: Upload Behat logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: Behat logs
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
/behat.yml
/phpspec.yml
/phpunit.xml

# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
/.php-version
/php.ini
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<a href="https://packagist.org/packages/odiseoteam/sylius-mercado-pago-plugin" title="Version" target="_blank">
<img src="https://img.shields.io/packagist/v/odiseoteam/sylius-mercado-pago-plugin.svg" />
</a>
<a href="https://github.com/odiseoteam/SyliusAvataxPlugin/actions" title="Build Status" target="_blank">
<img src="https://img.shields.io/github/workflow/status/odiseoteam/SyliusAvataxPlugin/Build" />
<a href="https://github.com/odiseoteam/SyliusMercadoPagoPlugin/actions" title="Build Status" target="_blank">
<img src="https://img.shields.io/github/actions/workflow/status/odiseoteam/SyliusMercadoPagoPlugin/build.yml" />
</a>
<a href="https://scrutinizer-ci.com/g/odiseoteam/SyliusMercadoPagoPlugin/" title="Scrutinizer" target="_blank">
<img src="https://img.shields.io/scrutinizer/g/odiseoteam/SyliusMercadoPagoPlugin.svg" />
Expand All @@ -21,11 +21,11 @@
<a href="https://sylius-devs.slack.com" title="Slack" target="_blank">
<img src="https://img.shields.io/badge/community%20chat-slack-FF1493.svg" />
</a>
<a href="https://odiseo.io/contact?utm_source=github&utm_medium=referral&utm_campaign=plugins_vendor" title="Support" target="_blank">
<a href="https://odiseo.io/contact-us" title="Support" target="_blank">
<img src="https://img.shields.io/badge/support-contact%20author-blue" />
</a>
</p>
<p align="center"><a href="https://sylius.com/partners/odiseo/" target="_blank"><img src="https://github.com/odiseoteam/SyliusAvataxPlugin/blob/master/badge-partner-by-sylius.png" width="140"></a></p>
<p align="center"><a href="https://sylius.com/partners/odiseo/" target="_blank"><img src="https://github.com/odiseoteam/SyliusMercadoPagoPlugin/blob/master/badge-partner-by-sylius.png" width="140"></a></p>

## Description

Expand Down
52 changes: 33 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"description": "Plugin for Sylius to add Mercado Pago payment method",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"sylius/sylius": "^1.9",
"php": "^8.0",
"sylius/sylius": "^1.12",
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
"symfony/webpack-encore-bundle": "^1.15",
"mercadopago/dx-php": "^2.2"
},
"require-dev": {
Expand All @@ -27,28 +29,40 @@
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"phpspec/phpspec": "^7.0",
"phpspec/phpspec": "^7.2",
"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.1",
"phpstan/phpstan-doctrine": "1.3.40",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpstan/phpstan-webmozart-assert": "^1.2.0",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"vimeo/psalm": "4.7.1"
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "^4.2",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/flex": "^2.2.2",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"vimeo/psalm": "5.12.0"
},
"conflict": {
"symfony/framework-bundle": "6.2.8",
"api-platform/core": "2.7.17",
"behat/mink-selenium2-driver": ">=1.7.0"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"phpstan/extension-installer": true,
"symfony/flex": true
}
},
"conflict": {
"doctrine/dbal": "^3.0"
"extra": {
"symfony": {
"require": "^5.4 || ^6.0"
}
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 8 additions & 2 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ return [
```yml
# config/packages/_sylius.yaml
imports:
...

# ...
- { resource: "@OdiseoSyliusMercadoPagoPlugin/Resources/config/config.yaml" }
```
4. Finish the installation updating the database schema and installing assets
```
php bin/console doctrine:migrations:migrate
php bin/console sylius:theme:assets:install
php bin/console cache:clear
18 changes: 12 additions & 6 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;

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

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');
$ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php');

$containerConfigurator->parameters()->set(Option::SKIP, [
$ecsConfig->skip([
VisibilityRequiredFixer::class => ['*Spec.php'],
]);
};
10 changes: 0 additions & 10 deletions features/admin/payment/adding_payment_method.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ Feature: Adding a new payment method
Then I should be notified that it has been successfully created
And the payment method "Paypal Express Checkout" should appear in the registry

@ui
Scenario: Adding a new stripe payment method
Given I want to create a new payment method with "Stripe Checkout" gateway factory
When I name it "Stripe Checkout" in "English (United States)"
And I specify its code as "SC"
And I configure it with test stripe gateway data
And I add it
Then I should be notified that it has been successfully created
And the payment method "Stripe Checkout" should appear in the registry

@ui
Scenario: Adding a new mercado pago payment method
Given I want to create a new payment method with "Mercado Pago" gateway factory
Expand Down
11 changes: 10 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
parameters:
level: max
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- src
- tests/Behat

excludes_analyse:
excludePaths:
# Makes PHPStan crash
- 'src/DependencyInjection/Configuration.php'

Expand All @@ -13,3 +17,8 @@ parameters:

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\./'
- '/Cannot cast mixed to int./'
- '/Cannot cast mixed to string./'
-
message: '/but returns mixed./'
path: src/Repository
6 changes: 6 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@
<PossiblyUndefinedMethod errorLevel="info" />
<MixedMethodCall errorLevel="info" />
<PossiblyInvalidArgument errorLevel="info" />
<MissingTemplateParam errorLevel="info" />
<MixedArrayAssignment errorLevel="info" />
<MixedArgumentTypeCoercion errorLevel="info" />
<TooManyArguments errorLevel="info" />
<MixedOperand errorLevel="info" />
<MixedArrayAccess errorLevel="info" />
</issueHandlers>
</psalm>
2 changes: 2 additions & 0 deletions src/Form/Type/MercadoPagoGatewayConfigurationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void

/**
* @psalm-suppress MixedArrayAssignment
*
* @phpstan-ignore-next-line
*/
$data['payum.http_client'] = '@sylius.payum.http_client';
})
Expand Down
Loading

0 comments on commit aa41051

Please sign in to comment.