Skip to content

Commit

Permalink
refactor #200 [Maintenance] Add PHP version to requirements + adjust …
Browse files Browse the repository at this point in the history
…Kernel and bundles configuration (GSadee)

This PR was merged into the main branch.

Discussion
----------

Continuation of #199 

Commits
-------

f2ec6dc Update Kernel and bundles configuration in test application
6fa4d23 [Composer] Add PHP version to requirements
  • Loading branch information
GSadee committed Jun 10, 2024
2 parents 35c6a31 + 6fa4d23 commit 06affc3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.1","8.2","8.3"]
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4"]
sylius: ["~1.12.0", "~1.13.0"]
node: ["20.x"]
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
}
],
"require": {
"php": "^8.1",
"sylius/sylius": "~1.12.0 || ~1.13.0",
"friendsofsymfony/jsrouting-bundle": "^3.2"
},
Expand Down
14 changes: 0 additions & 14 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@ private function registerBundlesFromFile(string $bundlesFile): iterable
{
$contents = require $bundlesFile;

if (SyliusCoreBundle::MINOR_VERSION > 10) {
$contents = array_merge(
['Sylius\Calendar\SyliusCalendarBundle' => ['all' => true]],
$contents,
);
}

if (SyliusCoreBundle::MINOR_VERSION > 12) {
$contents = array_merge(
['Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle' => ['all' => true]],
$contents,
);
}

foreach ($contents as $class => $envs) {
if (isset($envs['all']) || isset($envs[$this->environment])) {
yield new $class();
Expand Down
12 changes: 5 additions & 7 deletions tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

declare(strict_types=1);

use Sylius\Bundle\CoreBundle\Application\Kernel;
use Sylius\Bundle\CoreBundle\SyliusCoreBundle;

$bundles = [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true],
Expand Down Expand Up @@ -39,6 +40,7 @@
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Expand All @@ -62,12 +64,8 @@
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
];

if (Kernel::VERSION_ID < 11200) {
$bundles[Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class] = ['all' => true];
}

if (11200 <= Kernel::VERSION_ID) {
$bundles[League\FlysystemBundle\FlysystemBundle::class] = ['all' => true];
if (SyliusCoreBundle::VERSION_ID >= '11300') {
$bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true];
}

return $bundles;

0 comments on commit 06affc3

Please sign in to comment.