Skip to content

Commit 39dadeb

Browse files
author
Damian D'amico
authored
Merge pull request #21 from odiseoteam/1.6
Update Sylius 1.12 and Symfony 6.4
2 parents d5e1d5c + 5b8c3bb commit 39dadeb

133 files changed

Lines changed: 458 additions & 1088 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,39 @@ on:
1414

1515
jobs:
1616
tests:
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-latest
1818

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

2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["7.4", "8.0"]
25-
symfony: ["^4.4", "^5.2"]
26-
sylius: ["~1.9.0", "~1.10.0"]
27-
node: ["14.x"]
24+
php: ["8.0", "8.1"]
25+
symfony: ["5.4.*", "^6.0"]
26+
sylius: ["^1.12"]
27+
node: ["14.x", "16.x", "18.x"]
2828
mysql: ["5.7", "8.0"]
2929

30-
exclude:
31-
-
32-
php: "8.0"
33-
sylius: "~1.9.0"
34-
3530
env:
3631
APP_ENV: test
3732
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
3833

3934
steps:
4035
-
41-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
4237

4338
-
4439
name: Setup PHP
4540
uses: shivammathur/setup-php@v2
4641
with:
4742
php-version: "${{ matrix.php }}"
4843
extensions: intl
49-
tools: symfony
44+
tools: flex,symfony
5045
coverage: none
5146

5247
-
5348
name: Setup Node
54-
uses: actions/setup-node@v1
49+
uses: actions/setup-node@v3
5550
with:
5651
node-version: "${{ matrix.node }}"
5752

@@ -85,22 +80,27 @@ jobs:
8580
-
8681
name: Get Composer cache directory
8782
id: composer-cache
88-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
83+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8984

9085
-
9186
name: Cache Composer
92-
uses: actions/cache@v2
87+
uses: actions/cache@v3
9388
with:
9489
path: ${{ steps.composer-cache.outputs.dir }}
9590
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
9691
restore-keys: |
9792
${{ runner.os }}-php-${{ matrix.php }}-composer-
9893
94+
-
95+
name: Configure global composer
96+
run: |
97+
composer global config --no-plugins allow-plugins.symfony/flex true
98+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2"
99+
99100
-
100101
name: Restrict Symfony version
101102
if: matrix.symfony != ''
102103
run: |
103-
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
104104
composer config extra.symfony.require "${{ matrix.symfony }}"
105105
106106
-
@@ -111,15 +111,17 @@ jobs:
111111
-
112112
name: Install PHP dependencies
113113
run: composer install --no-interaction
114+
env:
115+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
114116

115117
-
116118
name: Get Yarn cache directory
117119
id: yarn-cache
118-
run: echo "::set-output name=dir::$(yarn cache dir)"
120+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
119121

120122
-
121123
name: Cache Yarn
122-
uses: actions/cache@v2
124+
uses: actions/cache@v3
123125
with:
124126
path: ${{ steps.yarn-cache.outputs.dir }}
125127
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
@@ -140,7 +142,7 @@ jobs:
140142
name: Prepare test application assets
141143
run: |
142144
(cd tests/Application && bin/console assets:install public -vvv)
143-
(cd tests/Application && yarn build)
145+
(cd tests/Application && yarn build:prod)
144146
145147
-
146148
name: Prepare test application cache
@@ -184,7 +186,7 @@ jobs:
184186

185187
-
186188
name: Upload Behat logs
187-
uses: actions/upload-artifact@v2
189+
uses: actions/upload-artifact@v3
188190
if: failure()
189191
with:
190192
name: Behat logs

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@
1515
/behat.yml
1616
/phpspec.yml
1717
/phpunit.xml
18+
19+
# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project
20+
/.php-version
21+
/php.ini

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<img src="https://img.shields.io/packagist/v/odiseoteam/sylius-report-plugin.svg" />
1111
</a>
1212
<a href="https://github.com/odiseoteam/SyliusReportPlugin/actions" title="Build Status" target="_blank">
13-
<img src="https://img.shields.io/github/workflow/status/odiseoteam/SyliusReportPlugin/Build" />
13+
<img src="https://img.shields.io/github/actions/workflow/status/odiseoteam/SyliusReportPlugin/build.yml" />
1414
</a>
1515
<a href="https://scrutinizer-ci.com/g/odiseoteam/SyliusReportPlugin/" title="Scrutinizer" target="_blank">
1616
<img src="https://img.shields.io/scrutinizer/g/odiseoteam/SyliusReportPlugin.svg" />
@@ -21,7 +21,7 @@
2121
<a href="https://sylius-devs.slack.com" title="Slack" target="_blank">
2222
<img src="https://img.shields.io/badge/community%20chat-slack-FF1493.svg" />
2323
</a>
24-
<a href="https://odiseo.io/contact?utm_source=github&utm_medium=referral&utm_campaign=plugins_vendor" title="Support" target="_blank">
24+
<a href="https://odiseo.io/contact-us" title="Support" target="_blank">
2525
<img src="https://img.shields.io/badge/support-contact%20author-blue" />
2626
</a>
2727
</p>
@@ -30,8 +30,6 @@
3030
## Description
3131

3232
This plugin adds data reports to the Sylius administration interface.
33-
It's highly inspired on the old [SyliusReportBundle](https://github.com/Sylius/SyliusReportBundle) and
34-
[Report](https://github.com/Sylius/Report) component using its good architecture.
3533

3634
Support Sylius version 1.9+.
3735

composer.json

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
"description": "Plugin for Sylius to make customizable reports.",
1010
"license": "MIT",
1111
"require": {
12-
"php": "^7.4 || ^8.0",
13-
"sylius/sylius": "^1.9",
12+
"php": "^8.0",
13+
"sylius/sylius": "^1.12",
14+
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
15+
"symfony/webpack-encore-bundle": "^1.15",
1416
"beberlei/doctrineextensions": "^1.2"
1517
},
1618
"require-dev": {
@@ -26,28 +28,40 @@
2628
"friends-of-behat/suite-settings-extension": "^1.0",
2729
"friends-of-behat/symfony-extension": "^2.1",
2830
"friends-of-behat/variadic-extension": "^1.3",
29-
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
30-
"phpspec/phpspec": "^7.0",
31+
"phpspec/phpspec": "^7.2",
3132
"phpstan/extension-installer": "^1.0",
32-
"phpstan/phpstan": "0.12.85",
33-
"phpstan/phpstan-doctrine": "0.12.33",
34-
"phpstan/phpstan-strict-rules": "^0.12.0",
35-
"phpstan/phpstan-webmozart-assert": "0.12.12",
33+
"phpstan/phpstan": "^1.8.1",
34+
"phpstan/phpstan-doctrine": "1.3.40",
35+
"phpstan/phpstan-strict-rules": "^1.3.0",
36+
"phpstan/phpstan-webmozart-assert": "^1.2.0",
3637
"phpunit/phpunit": "^9.5",
37-
"sensiolabs/security-checker": "^6.0",
38-
"sylius-labs/coding-standard": "^4.0",
39-
"symfony/browser-kit": "^4.4 || ^5.2",
40-
"symfony/debug-bundle": "^4.4 || ^5.2",
41-
"symfony/dotenv": "^4.4 || ^5.2",
42-
"symfony/intl": "^4.4 || ^5.2",
43-
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
44-
"vimeo/psalm": "4.7.1"
38+
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
39+
"sylius-labs/coding-standard": "^4.2",
40+
"symfony/browser-kit": "^5.4 || ^6.0",
41+
"symfony/debug-bundle": "^5.4 || ^6.0",
42+
"symfony/dotenv": "^5.4 || ^6.0",
43+
"symfony/flex": "^2.2.2",
44+
"symfony/intl": "^5.4 || ^6.0",
45+
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
46+
"vimeo/psalm": "5.12.0"
47+
},
48+
"conflict": {
49+
"symfony/framework-bundle": "6.2.8",
50+
"api-platform/core": "2.7.17",
51+
"behat/mink-selenium2-driver": ">=1.7.0"
4552
},
4653
"config": {
47-
"sort-packages": true
54+
"sort-packages": true,
55+
"allow-plugins": {
56+
"dealerdirect/phpcodesniffer-composer-installer": false,
57+
"phpstan/extension-installer": true,
58+
"symfony/flex": true
59+
}
4860
},
49-
"conflict": {
50-
"doctrine/dbal": "^3.0"
61+
"extra": {
62+
"symfony": {
63+
"require": "^5.4 || ^6.0"
64+
}
5165
},
5266
"autoload": {
5367
"psr-4": {

ecs.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
4-
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
5-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6-
use Symplify\EasyCodingStandard\ValueObject\Option;
6+
use Symplify\EasyCodingStandard\Config\ECSConfig;
7+
8+
return static function (ECSConfig $ecsConfig): void {
9+
$ecsConfig->paths([
10+
__DIR__ . '/src',
11+
__DIR__ . '/tests/Behat',
12+
__DIR__ . '/ecs.php',
13+
]);
714

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

11-
$containerConfigurator->parameters()->set(Option::SKIP, [
17+
$ecsConfig->skip([
1218
VisibilityRequiredFixer::class => ['*Spec.php'],
1319
]);
1420
};

phpstan.neon

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
parameters:
2+
level: max
23
reportUnmatchedIgnoredErrors: false
34
checkMissingIterableValueType: false
45
checkGenericClassInNonGenericObjectType: false
6+
paths:
7+
- src
8+
- tests/Behat
59

6-
excludes_analyse:
10+
excludePaths:
711
# Makes PHPStan crash
812
- 'src/DependencyInjection/Configuration.php'
913

@@ -13,3 +17,8 @@ parameters:
1317

1418
ignoreErrors:
1519
- '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
20+
- '/Cannot cast mixed to int./'
21+
- '/Cannot cast mixed to string./'
22+
-
23+
message: '/but returns mixed./'
24+
path: src/Repository

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<PossiblyUndefinedMethod errorLevel="info" />
2626
<MixedMethodCall errorLevel="info" />
2727
<PossiblyInvalidArgument errorLevel="info" />
28+
<MissingTemplateParam errorLevel="info" />
2829
<MixedArrayAssignment errorLevel="info" />
2930
<MixedArgumentTypeCoercion errorLevel="info" />
3031
<TooManyArguments errorLevel="info" />

spec/Controller/ReportControllerSpec.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
use Symfony\Component\HttpFoundation\Response;
3535
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
3636

37-
/**
38-
* @author Diego D'amico <diego@odiseo.com.ar>
39-
*/
4037
final class ReportControllerSpec extends ObjectBehavior
4138
{
4239
function let(

spec/DataFetcher/DataSpec.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
use Odiseo\SyliusReportPlugin\DataFetcher\Data;
88
use PhpSpec\ObjectBehavior;
99

10-
/**
11-
* @author Diego D'amico <diego@odiseo.com.ar>
12-
*/
1310
class DataSpec extends ObjectBehavior
1411
{
1512
function it_is_initializable()

spec/DataFetcher/DelegatingDataFetcherSpec.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
use PhpSpec\ObjectBehavior;
1515
use Sylius\Component\Registry\ServiceRegistryInterface;
1616

17-
/**
18-
* @author Diego D'amico <diego@odiseo.com.ar>
19-
*/
2017
class DelegatingDataFetcherSpec extends ObjectBehavior
2118
{
2219
function let(ServiceRegistryInterface $registry)

0 commit comments

Comments
 (0)