Skip to content

Commit

Permalink
Merge pull request #21 from odiseoteam/1.6
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 19, 2024
2 parents d5e1d5c + 5b8c3bb commit 39dadeb
Show file tree
Hide file tree
Showing 133 changed files with 458 additions and 1,088 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: ["14.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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<img src="https://img.shields.io/packagist/v/odiseoteam/sylius-report-plugin.svg" />
</a>
<a href="https://github.com/odiseoteam/SyliusReportPlugin/actions" title="Build Status" target="_blank">
<img src="https://img.shields.io/github/workflow/status/odiseoteam/SyliusReportPlugin/Build" />
<img src="https://img.shields.io/github/actions/workflow/status/odiseoteam/SyliusReportPlugin/build.yml" />
</a>
<a href="https://scrutinizer-ci.com/g/odiseoteam/SyliusReportPlugin/" title="Scrutinizer" target="_blank">
<img src="https://img.shields.io/scrutinizer/g/odiseoteam/SyliusReportPlugin.svg" />
Expand All @@ -21,7 +21,7 @@
<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>
Expand All @@ -30,8 +30,6 @@
## Description

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

Support Sylius version 1.9+.

Expand Down
52 changes: 33 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"description": "Plugin for Sylius to make customizable reports.",
"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",
"beberlei/doctrineextensions": "^1.2"
},
"require-dev": {
Expand All @@ -26,28 +28,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
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'],
]);
};
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
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<PossiblyUndefinedMethod errorLevel="info" />
<MixedMethodCall errorLevel="info" />
<PossiblyInvalidArgument errorLevel="info" />
<MissingTemplateParam errorLevel="info" />
<MixedArrayAssignment errorLevel="info" />
<MixedArgumentTypeCoercion errorLevel="info" />
<TooManyArguments errorLevel="info" />
Expand Down
3 changes: 0 additions & 3 deletions spec/Controller/ReportControllerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
* @author Diego D'amico <diego@odiseo.com.ar>
*/
final class ReportControllerSpec extends ObjectBehavior
{
function let(
Expand Down
3 changes: 0 additions & 3 deletions spec/DataFetcher/DataSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Odiseo\SyliusReportPlugin\DataFetcher\Data;
use PhpSpec\ObjectBehavior;

/**
* @author Diego D'amico <diego@odiseo.com.ar>
*/
class DataSpec extends ObjectBehavior
{
function it_is_initializable()
Expand Down
3 changes: 0 additions & 3 deletions spec/DataFetcher/DelegatingDataFetcherSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use PhpSpec\ObjectBehavior;
use Sylius\Component\Registry\ServiceRegistryInterface;

/**
* @author Diego D'amico <diego@odiseo.com.ar>
*/
class DelegatingDataFetcherSpec extends ObjectBehavior
{
function let(ServiceRegistryInterface $registry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

/**
* @author Mateusz Zalewski <mateusz.zalewski@lakion.com>
* @author Diego D'amico <diego@odiseo.com.ar>
*/
final class RegisterDataFetchersPassSpec extends ObjectBehavior
{
function it_should_implement_compiler_pass_interface()
Expand All @@ -33,7 +29,10 @@ function it_processes_with_given_container(ContainerBuilder $container, Definiti
];
$container->findTaggedServiceIds('odiseo_sylius_report_plugin.data_fetcher')->willReturn($dataFetcherServices);

$dataFetcherDefinition->addMethodCall('register', ['test', new Reference('odiseo_sylius_report_plugin.form.type.data_fetcher.test')])->shouldBeCalled();
$dataFetcherDefinition->addMethodCall(
'register',
['test', new Reference('odiseo_sylius_report_plugin.form.type.data_fetcher.test')]
)->willReturn($dataFetcherDefinition);
$container->setParameter('odiseo_sylius_report_plugin.data_fetchers', ['test' => 'Test data fetcher'])->shouldBeCalled();

$this->process($container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

/**
* @author Mateusz Zalewski <mateusz.zalewski@lakion.com>
* @author Diego D'amico <diego@odiseo.com.ar>
*/
final class RegisterRenderersPassSpec extends ObjectBehavior
{
function it_should_implement_compiler_pass_interface()
Expand All @@ -33,7 +29,10 @@ function it_processes_with_given_container(ContainerBuilder $container, Definiti
];
$container->findTaggedServiceIds('odiseo_sylius_report_plugin.renderer')->willReturn($rendererServices);

$rendererDefinition->addMethodCall('register', ['test', new Reference('odiseo_sylius_report_plugin.form.type.renderer.test')])->shouldBeCalled();
$rendererDefinition->addMethodCall(
'register',
['test', new Reference('odiseo_sylius_report_plugin.form.type.renderer.test')]
)->willReturn($rendererDefinition);
$container->setParameter('odiseo_sylius_report_plugin.renderers', ['test' => 'Test renderer'])->shouldBeCalled();

$this->process($container);
Expand Down
3 changes: 0 additions & 3 deletions spec/Entity/ReportSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Model\TimestampableInterface;

/**
* @author Diego D'amico <diego@odiseo.com.ar>
*/
final class ReportSpec extends ObjectBehavior
{
function it_is_initializable()
Expand Down
Loading

0 comments on commit 39dadeb

Please sign in to comment.