Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-135/Sylius upgrade #60

Merged
merged 20 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,16 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 7.4]
symfony: [^4.4, ^5.2]
sylius: [~1.9.0, ~1.10.0, ~1.11.0]
php: [8.0 ]
symfony: [^5.4, ^6.0]
sylius: [~1.11.0, ~1.12.0]
node: [14.19]
mysql: [5.7]
mysql: [5.7, 8.0]

exclude:
-
php: 8.0
sylius: ~1.9.0
-
sylius: ~1.10.0
symfony: ^4.4
-
sylius: ~1.11.0
php: 7.4
symfony: ^6.0

env:
APP_ENV: test
Expand Down Expand Up @@ -143,7 +137,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 encore dev)
-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)
Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"description": "MailChimp plugin for Sylius.",
"license": "MIT",
"require": {
"php": "^7.3 || ^7.4 || ^8.0",
"sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0",
"php": " ^8.0",
"sylius/sylius": "~1.11.0 || ~1.12.0",
"drewm/mailchimp-api": "^v2.5.4",
"ext-json": "*",
"vimeo/psalm": "^4.12",
"composer/xdebug-handler": "^2.0",
"bitbag/coding-standard": "^1.0"
},
"require-dev": {
"symfony/webpack-encore-bundle": "^1.14",
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dmore/behat-chrome-extension": "^1.3",
Expand All @@ -33,14 +34,12 @@
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"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",
"friendsofsymfony/oauth-server-bundle": "2.*@dev",
"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",
"polishsymfonycommunity/symfony-mocker-container": "^1.0"
},
"prefer-stable": true,
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false

excludes_analyse:
# Makes PHPStan crash
Expand Down
1 change: 1 addition & 0 deletions src/Handler/NewsletterSubscriptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function unsubscribeEmail(string $email): void

public function unsubscribeCustomerFromLocalDatabase(string $email): void
{
/** @var CustomerInterface $customer */
$customer = $this->customerRepository->findOneBy(['email' => $email]);
$this->updateCustomer($customer, false);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './js';
import './scss/main.scss';
Empty file.
3 changes: 3 additions & 0 deletions src/Resources/assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './js';
import './scss/main.scss';
import '../../public/bitbag-mailchimp-plugin-newsletter'
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions tests/Application/.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ MAILER_URL=smtp://localhost
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=sync://
###< symfony/messenger ###

MAIL_CHIMP_API_KEY=""
MAIL_CHIMP_LIST_ID=""
18 changes: 12 additions & 6 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +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
*/

declare(strict_types=1);

namespace Tests\BitBag\SyliusMailChimpPlugin\Application;
Expand All @@ -12,7 +18,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

final class Kernel extends BaseKernel
{
Expand Down Expand Up @@ -58,7 +64,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
}
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes(RoutingConfigurator $routes): void
{
foreach ($this->getConfigurationDirectories() as $confDir) {
$this->loadRoutesConfiguration($routes, $confDir);
Expand Down Expand Up @@ -87,11 +93,11 @@ private function loadContainerConfiguration(LoaderInterface $loader, string $con
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
}

private function loadRoutesConfiguration(RouteCollectionBuilder $routes, string $confDir): void
private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
{
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/Application/assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'sylius/bundle/AdminBundle/Resources/private/entry';
1 change: 1 addition & 0 deletions tests/Application/assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'sylius/bundle/ShopBundle/Resources/private/entry';
8 changes: 7 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<?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);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Expand Down Expand Up @@ -56,4 +61,5 @@
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true]
];
2 changes: 0 additions & 2 deletions tests/Application/config/packages/staging/swiftmailer.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Application/config/packages/test/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
handler_id: ~
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
handler_id: session.storage.mock_file
7 changes: 7 additions & 0 deletions tests/Application/config/packages/webpack_encore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
webpack_encore:
output_path: '%kernel.project_dir%/public/build/default'
builds:
shop: '%kernel.project_dir%/public/build/shop'
admin: '%kernel.project_dir%/public/build/admin'
cs_shop: '%kernel.project_dir%/public/build/bitbag/cs/shop'
cs_admin: '%kernel.project_dir%/public/build/bitbag/cs/admin'
2 changes: 1 addition & 1 deletion tests/Application/config/routes/sylius_shop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sylius_shop_default_locale:
path: /
methods: [GET]
defaults:
_controller: sylius.controller.shop.locale_switch:switchAction
_controller: sylius.controller.shop.locale_switch::switchAction
6 changes: 0 additions & 6 deletions tests/Application/config/sylius/1.10/bundles.php

This file was deleted.

148 changes: 0 additions & 148 deletions tests/Application/config/sylius/1.10/packages/security.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions tests/Application/config/sylius/1.11/bundles.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?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);

return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
];
16 changes: 16 additions & 0 deletions tests/Application/config/sylius/1.12/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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);

return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
];
Loading