Skip to content

Commit

Permalink
Merge pull request #18 from SzymonKostrubiec/feature/op-454
Browse files Browse the repository at this point in the history
OP-454 - Add support for Sylius 1.13
  • Loading branch information
senghe authored Aug 11, 2024
2 parents eecafbf + 3591bb1 commit c253bfb
Show file tree
Hide file tree
Showing 40 changed files with 263 additions and 318 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ "8.0" ]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.0", "~1.12.0"]
node: ["^14.17.x"]
mysql: [ "5.7", "8.0" ]
php: [ "8.0", "8.1", "8.2", "8.3" ]
symfony: [ "^5.4", "^6.0" ]
sylius: [ "^1.12", "^1.13" ]
node: [ "18.x", "20.x" ]
mysql: [ "8.0" ]

exclude:
- sylius: ~1.11.0
symfony: ^6.0
- sylius: ^1.13
php: 8.0
- sylius: ^1.12
php: 8.0
symfony: ^6.4

env:
APP_ENV: test
Expand Down Expand Up @@ -135,7 +138,7 @@ jobs:
run: (cd tests/Application && bin/console doctrine:schema:validate)

- name: Run PHPStan
run: vendor/bin/phpstan analyse -c vendor/bitbag/coding-standard/phpstan.neon -l max src/
run: vendor/bin/phpstan analyse -c vendor/bitbag/coding-standard/phpstan.neon -l 8 src/

- name: Run ECS
run: vendor/bin/ecs check src
Expand All @@ -150,7 +153,7 @@ jobs:
name: Behat logs
path: etc/build/
if-no-files-found: ignore

- name: Failed build Slack notification
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
Expand Down
23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
"license": "MIT",
"require": {
"php": "^8.0",
"sylius/sylius": "~1.11 || ~1.12.0"
"sylius/sylius": "^1.12 || ^1.13"
},
"require-dev": {
"behat/behat": "^3.6.1",
"behat/behat": "^3.7",
"behat/mink-selenium2-driver": "^1.4",
"bitbag/coding-standard": "^1.0",
"bitbag/coding-standard": "^3.0",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0.0",
"friends-of-behat/mink-debug-extension": "^2.0",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"phpspec/phpspec": "^7.0",
"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",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-strict-rules": "^1.3.0",
"phpstan/phpstan-webmozart-assert": "^1.2.0",
"phpunit/phpunit": "^9.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "^4.0",
Expand All @@ -35,8 +35,11 @@
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.13",
"vimeo/psalm": "4.12"
"symfony/webpack-encore-bundle": "^1.16",
"vimeo/psalm": "4.27"
},
"conflict": {
"behat/mink-selenium2-driver": ">=1.7.0"
},
"config": {
"sort-packages": true,
Expand Down
17 changes: 8 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?php

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
declare(strict_types=1);

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php');
use Symplify\EasyCodingStandard\Config\ECSConfig;

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
__DIR__ . '/tests',
]);
return static function (ECSConfig $config): void {

putenv('ALLOW_BITBAG_OS_HEADER=1');

$config->import('vendor/bitbag/coding-standard/ecs.php');
$config->paths(['src', 'spec', 'tests/Integration', 'tests/Behat', 'tests/Functional']);
};
7 changes: 7 additions & 0 deletions src/BitBagSyliusProductAttributeGroupsPlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\SyliusProductAttributeGroupsPlugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Entity/Attribute.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Entity/AttributeInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Entity/Group.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Entity/GroupInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Factory/AttributeFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Factory/AttributeFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Form/DataTransformer/AttributeTransformer.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
13 changes: 8 additions & 5 deletions src/Form/Extension/ProductAttributeTypeExtension.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand All @@ -14,6 +15,7 @@
use BitBag\SyliusProductAttributeGroupsPlugin\Entity\Group;
use BitBag\SyliusProductAttributeGroupsPlugin\Factory\AttributeFactoryInterface;
use Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeType;
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractTypeExtension;
Expand All @@ -29,7 +31,7 @@ final class ProductAttributeTypeExtension extends AbstractTypeExtension

public function __construct(
RepositoryInterface $attributeRepository,
AttributeFactoryInterface $attributeFactory
AttributeFactoryInterface $attributeFactory,
) {
$this->attributeRepository = $attributeRepository;
$this->attributeFactory = $attributeFactory;
Expand Down Expand Up @@ -77,6 +79,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$previousGroups = $this->attributeRepository->findBy(['syliusAttribute' => $event->getData()]);

if (0 !== count($previousGroups)) {
/** @var ResourceInterface $previousGroup */
foreach ($previousGroups as $previousGroup) {
$this->attributeRepository->remove($previousGroup);
}
Expand Down
9 changes: 5 additions & 4 deletions src/Form/Type/GroupType.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Menu/AttributeGroupMenuListener.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Repository/GroupRepository.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Repository/GroupRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Twig/Extension/RenderAttributeNamesExtension.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Twig/Runtime/RenderAttributeNamesRuntime.php
Original file line number Diff line number Diff line change
@@ -1,10 +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
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
Loading

0 comments on commit c253bfb

Please sign in to comment.