Skip to content

Commit 757003d

Browse files
committed
symfony 6 support (psalm)
1 parent 44639d6 commit 757003d

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"ensure-env-dev-copied": "(cd tests/Application && ([[ -f .env.dev.local ]] || cp .env .env.dev.local))",
9595
"ensure-env-test-copied": "(cd tests/Application && ([[ -f .env.test.local ]] || cp .env.test .env.test.local))",
9696
"ensure-schema-updated": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:schema:update --force -e ${SYMFONY_ENV:-'dev'})",
97-
"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",
9898
"ensure-vendors-installed": "[[ -f vendor/autoload.php ]] || php -d memory_limit=-1 /usr/local/bin/composer install",
9999
"fix-style": "ecs check --fix",
100100
"fixtures": [

psalm.xml

Lines changed: 0 additions & 1 deletion
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"

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ final class CompositeClickStrategyApplicator extends ArrayCollection implements
1111
/** @var string */
1212
private $clickStrategy;
1313

14-
public function __construct(string $clickStrategy)
14+
public function __construct(array $elements = [], string $clickStrategy = '')
1515
{
1616
$this->clickStrategy = $clickStrategy;
1717

18-
parent::__construct();
18+
parent::__construct($elements);
1919
}
2020

2121
public function addClickStrategyApplicator(ClickStrategyApplicatorInterface $clickStrategyApplicator, string $alias): void

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ 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+
return implode(' ', $words);
115117
})
116118

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

0 commit comments

Comments
 (0)