Skip to content

Commit f0838ed

Browse files
authored
Merge pull request #67 from dsbe-ak/master
symfony 6 support
2 parents 80e8528 + 9da23d3 commit f0838ed

File tree

19 files changed

+49
-45
lines changed

19 files changed

+49
-45
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
coverage: "none"
4242

4343
- name: "Install composer dependencies"
44-
uses: "ramsey/composer-install@v1"
44+
uses: "ramsey/composer-install@v2"
4545
with:
4646
dependency-versions: "${{ matrix.dependencies }}"
4747

composer.json

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
22
"name": "setono/sylius-terms-plugin",
3-
"type": "sylius-plugin",
43
"description": "Sylius terms and conditions plugin",
4+
"license": "MIT",
5+
"type": "sylius-plugin",
56
"keywords": [
67
"sylius",
78
"sylius-plugin",
89
"terms"
910
],
10-
"license": "MIT",
1111
"require": {
1212
"php": ">=7.4",
1313
"behat/transliterator": "^1.3",
1414
"doctrine/collections": "^1.6",
1515
"doctrine/orm": "^2.7",
1616
"knplabs/knp-menu": "^3.1",
1717
"sylius/resource-bundle": "^1.6",
18-
"symfony/config": "^4.4 || ^5.0",
19-
"symfony/dependency-injection": "^4.4 || ^5.0",
20-
"symfony/form": "^4.4 || ^5.0",
21-
"symfony/http-foundation": "^4.4 || ^5.0.0",
22-
"symfony/http-kernel": "^4.4 || ^5.1.5",
23-
"symfony/options-resolver": "^4.4 || ^5.0",
24-
"symfony/routing": "^4.4 || ^5.0",
18+
"symfony/config": "^4.4 || ^5.4 || ^6.0",
19+
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
20+
"symfony/form": "^4.4 || ^5.4 || ^6.0",
21+
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
22+
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
23+
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.0",
24+
"symfony/routing": "^4.4 || ^5.4 || ^6.0",
2525
"symfony/translation-contracts": "^1.1 || ^2.4",
2626
"thecodingmachine/safe": "^1.1",
27-
"twig/twig": "^2.14",
27+
"twig/twig": "^2.14 || ^3.3",
2828
"webmozart/assert": "^1.9"
2929
},
3030
"require-dev": {
@@ -35,21 +35,14 @@
3535
"psalm/plugin-symfony": "^2.4",
3636
"roave/security-advisories": "dev-latest",
3737
"setono/code-quality-pack": "^2.1.1",
38-
"sylius/sylius": "~1.7.0",
38+
"sylius/sylius": "~1.10.14",
3939
"symfony/debug-bundle": "^5.1",
4040
"symfony/dotenv": "^5.1",
4141
"symfony/intl": "^4.4 || ^5.0",
4242
"symfony/proxy-manager-bridge": "^4.4.25",
4343
"symfony/web-profiler-bundle": "^5.0"
4444
},
45-
"config": {
46-
"sort-packages": true
47-
},
48-
"extra": {
49-
"branch-alias": {
50-
"dev-master": "1.1-dev"
51-
}
52-
},
45+
"prefer-stable": true,
5346
"autoload": {
5447
"psr-4": {
5548
"Setono\\SyliusTermsPlugin\\": "src/"
@@ -63,7 +56,19 @@
6356
"tests/Application/Kernel.php"
6457
]
6558
},
66-
"prefer-stable": true,
59+
"config": {
60+
"allow-plugins": {
61+
"symfony/thanks": false,
62+
"dealerdirect/phpcodesniffer-composer-installer": false,
63+
"ergebnis/composer-normalize": true
64+
},
65+
"sort-packages": true
66+
},
67+
"extra": {
68+
"branch-alias": {
69+
"dev-master": "1.1-dev"
70+
}
71+
},
6772
"scripts": {
6873
"all": [
6974
"@checks",
@@ -89,7 +94,7 @@
8994
"ensure-env-dev-copied": "(cd tests/Application && ([[ -f .env.dev.local ]] || cp .env .env.dev.local))",
9095
"ensure-env-test-copied": "(cd tests/Application && ([[ -f .env.test.local ]] || cp .env.test .env.test.local))",
9196
"ensure-schema-updated": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:schema:update --force -e ${SYMFONY_ENV:-'dev'})",
92-
"ensure-test-container-exists": "[[ -f tests/Application/var/cache/test/ApplicationTests_Setono_SyliusTermsPlugin_Application_KernelTestDebugContainer.xml ]] || tests/Application/bin/console cache:warmup --env=test",
97+
"ensure-test-container-exists": "[[ -f tests/Application/var/cache/test/Tests_Setono_SyliusTermsPlugin_Application_KernelTestDebugContainer.xml ]] || tests/Application/bin/console cache:warmup --env=test",
9398
"ensure-vendors-installed": "[[ -f vendor/autoload.php ]] || php -d memory_limit=-1 /usr/local/bin/composer install",
9499
"fix-style": "ecs check --fix",
95100
"fixtures": [

psalm.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0"?>
22
<psalm
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
totallyTyped="true"
54
errorLevel="1"
65
xmlns="https://getpsalm.org/schema/config"
76
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -17,7 +16,7 @@
1716
</projectFiles>
1817
<plugins>
1918
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
20-
<containerXml>tests/Application/var/cache/test/ApplicationTests_Setono_SyliusTermsPlugin_Application_KernelTestDebugContainer.xml</containerXml>
19+
<containerXml>tests/Application/var/cache/test/Tests_Setono_SyliusTermsPlugin_Application_KernelTestDebugContainer.xml</containerXml>
2120
</pluginClass>
2221
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
2322
</plugins>

spec/Form/Extension/CompleteTypeExtensionSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class CompleteTypeExtensionSpec extends ObjectBehavior
1515
{
1616
private const OPTIONS = [
17-
'validation_groups' => ['sylius_checkout_complete']
17+
'validation_groups' => ['sylius_checkout_complete'],
1818
];
1919

2020
public function let(TermsProviderInterface $termsProvider, TermsInterface $terms): void

src/ClickStrategy.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ private function __construct()
1717

1818
public const CLICK_STRATEGY_MODAL = 'modal';
1919

20+
/**
21+
* @return string[]
22+
*/
2023
public static function getClickStrategies(): array
2124
{
2225
return [

src/ClickStrategyApplicator/CompositeClickStrategyApplicator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ final class CompositeClickStrategyApplicator extends ArrayCollection implements
1111
/** @var string */
1212
private $clickStrategy;
1313

14+
/**
15+
* @psalm-suppress ConstructorSignatureMismatch, ImplementedParamTypeMismatch, InvalidPropertyAssignmentValue
16+
*/
1417
public function __construct(string $clickStrategy)
1518
{
1619
$this->clickStrategy = $clickStrategy;

src/DependencyInjection/SetonoSyliusTermsExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function load(array $configs, ContainerBuilder $container): void
1616
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
1717
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
1818

19-
$container->setParameter('setono_sylius_terms.click_strategy', $config['click_strategy']);
19+
$container->setParameter('setono_sylius_terms.click_strategy', (string) $config['click_strategy']);
2020

2121
$loader->load('services.xml');
2222

src/Fixture/Factory/TermsExampleFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ protected function configureOptions(OptionsResolver $resolver): void
111111
{
112112
$resolver
113113
->setDefault('name', function (Options $options): string {
114-
return implode(' ', (array) $this->faker->words(3));
114+
/** @var string[] $words */
115+
$words = (array) $this->faker->words(3);
116+
117+
return implode(' ', $words);
115118
})
116119

117120
->setDefault('code', function (Options $options): string {

src/Model/Terms.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
class Terms implements TermsInterface
1515
{
1616
use TimestampableTrait;
17+
1718
use TranslatableTrait {
1819
__construct as private initializeTranslationsCollection;
20+
1921
getTranslation as private doGetTranslation;
2022
}
2123

tests/Application/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function getContainerLoader(ContainerInterface $container): LoaderInte
8585
/** @var ContainerBuilder $container */
8686
Assert::isInstanceOf($container, ContainerBuilder::class);
8787

88-
$locator = new FileLocator($this, $this->getRootDir() . '/Resources');
88+
$locator = new FileLocator($this);
8989
$resolver = new LoaderResolver(array(
9090
new XmlFileLoader($container, $locator),
9191
new YamlFileLoader($container, $locator),

0 commit comments

Comments
 (0)