Skip to content

Commit d695274

Browse files
committed
Add support for Symfony 7
1 parent 9240ed3 commit d695274

File tree

5 files changed

+49
-38
lines changed

5 files changed

+49
-38
lines changed

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php: [ "8.1", "8.2", "8.3" ]
17-
symfony: [ "^5.4", "^6.4" ]
17+
symfony: [ "^5.4", "^6.4", "^7.4" ]
1818
name: "PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }}"
1919
env:
2020
APP_ENV: test

composer.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,32 @@
1616
"require": {
1717
"php": "^8.1",
1818
"laminas/laminas-stdlib": "^3.18",
19-
"symfony/config": "^5.4 || ^6.0",
20-
"symfony/dependency-injection": "^5.4 || ^6.0",
21-
"symfony/expression-language": "^5.4 || ^6.0",
22-
"symfony/http-kernel": "^5.4 || ^6.0",
23-
"symfony/stopwatch": "^5.4 || ^6.0",
24-
"symfony/twig-bundle": "^5.4 || ^6.0",
19+
"symfony/config": "^5.4 || ^6.4 || ^7.0",
20+
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
21+
"symfony/expression-language": "^5.4 || ^6.4 || ^7.0",
22+
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
23+
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0",
24+
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
2525
"symfony/ux-live-component": "^2.17",
2626
"symfony/ux-twig-component": "^2.17",
2727
"twig/twig": "^2.15 || ^3.0"
2828
},
2929
"require-dev": {
30-
"matthiasnoback/symfony-config-test": "^4.3",
31-
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1",
30+
"matthiasnoback/symfony-config-test": "^5.1",
31+
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
3232
"phpstan/phpstan": "^1.10",
3333
"phpstan/phpstan-symfony": "^1.3",
3434
"phpunit/phpunit": "^9.6",
35-
"symfony/console": "^5.4 || ^6.0",
36-
"symfony/debug-bundle": "^5.4 || ^6.0",
37-
"symfony/dom-crawler": "^5.4 || ^6.0",
38-
"symfony/dotenv": "^5.4 || ^6.0",
35+
"symfony/console": "^5.4 || ^6.4 || ^7.0",
36+
"symfony/debug-bundle": "^5.4 || ^6.4 || ^7.0",
37+
"symfony/dom-crawler": "^5.4 || ^6.4 || ^7.0",
38+
"symfony/dotenv": "^5.4 || ^6.4 || ^7.0",
3939
"symfony/flex": "^2.4",
40-
"symfony/framework-bundle": "^5.4 || ^6.0",
41-
"symfony/runtime": "^5.4 || ^6.0",
42-
"symfony/translation": "^5.4 || ^6.0",
43-
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
44-
"symfony/yaml": "^5.4 || ^6.0 ",
40+
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
41+
"symfony/runtime": "^5.4 || ^6.4 || ^7.0",
42+
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
43+
"symfony/web-profiler-bundle": "^5.4 || ^6.4 || ^7.0",
44+
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
4545
"symplify/monorepo-builder": "11.2.*"
4646
},
4747
"autoload": {
@@ -69,7 +69,7 @@
6969
},
7070
"extra": {
7171
"symfony": {
72-
"require": "6.4.*"
72+
"require": "7.0.*"
7373
}
7474
}
7575
}

monorepo-builder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
ComposerJsonSection::REQUIRE_DEV => [
1515
'phpstan/phpstan' => '^1.10',
16-
'symfony/debug-bundle' => '^5.4 || ^6.0',
16+
'symfony/debug-bundle' => '^5.4 || ^6.4 || ^7.0',
1717
'symfony/flex' => '^2.4',
1818
'symplify/monorepo-builder' => '11.2.*',
1919
'phpstan/phpstan-symfony' => '^1.3'

src/TwigHooks/composer.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616
"require": {
1717
"php": "^8.1",
1818
"laminas/laminas-stdlib": "^3.18",
19-
"symfony/config": "^5.4 || ^6.0",
20-
"symfony/dependency-injection": "^5.4 || ^6.0",
21-
"symfony/expression-language": "^5.4 || ^6.0",
22-
"symfony/http-kernel": "^5.4 || ^6.0",
23-
"symfony/stopwatch": "^5.4 || ^6.0",
19+
"symfony/config": "^5.4 || ^6.4 || ^7.0",
20+
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
21+
"symfony/expression-language": "^5.4 || ^6.4 || ^7.0",
22+
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
23+
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0",
2424
"symfony/ux-live-component": "^2.17",
2525
"symfony/ux-twig-component": "^2.17",
26-
"symfony/twig-bundle": "^5.4 || ^6.0",
26+
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
2727
"twig/twig": "^2.15 || ^3.0"
2828
},
2929
"require-dev": {
30-
"symfony/console": "^5.4 || ^6.0",
31-
"symfony/dom-crawler": "^5.4 || ^6.0",
32-
"symfony/dotenv": "^5.4 || ^6.0",
33-
"symfony/framework-bundle": "^5.4 || ^6.0",
34-
"symfony/runtime": "^5.4 || ^6.0",
35-
"symfony/translation": "^5.4 || ^6.0",
36-
"symfony/twig-bundle": "^5.4 || ^6.0",
37-
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
38-
"symfony/yaml": "^5.4 || ^6.0 ",
39-
"matthiasnoback/symfony-config-test": "^4.3",
40-
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1",
30+
"symfony/console": "^5.4 || ^6.4 || ^7.0",
31+
"symfony/dom-crawler": "^5.4 || ^6.4 || ^7.0",
32+
"symfony/dotenv": "^5.4 || ^6.4 || ^7.0",
33+
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
34+
"symfony/runtime": "^5.4 || ^6.4 || ^7.0",
35+
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
36+
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
37+
"symfony/web-profiler-bundle": "^5.4 || ^6.4 || ^7.0",
38+
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
39+
"matthiasnoback/symfony-config-test": "^5.1",
40+
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
4141
"phpunit/phpunit": "^9.6"
4242
},
4343
"suggest": {

src/TwigHooks/src/Hookable/Renderer/Debug/HookableDebugCommentRenderer.php

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
use Sylius\TwigHooks\Hookable\AbstractHookable;
88
use Sylius\TwigHooks\Hookable\HookableComponent;
99
use Sylius\TwigHooks\Hookable\HookableTemplate;
10+
use Sylius\TwigHooks\Hookable\Merger\HookableMergerInterface;
1011
use Sylius\TwigHooks\Hookable\Metadata\HookableMetadata;
12+
use Sylius\TwigHooks\Hookable\Renderer\Exception\HookRenderException;
1113
use Sylius\TwigHooks\Hookable\Renderer\HookableRendererInterface;
1214

13-
final class HookableDebugCommentRenderer implements HookableRendererInterface
15+
final class HookableDebugCommentRenderer implements HookableRendererInterface, HookableMergerInterface
1416
{
1517
public function __construct(private readonly HookableRendererInterface $innerRenderer)
1618
{
@@ -61,4 +63,13 @@ private function getClosingDebugComment(AbstractHookable $hookable): string
6163
$hookable->priority(),
6264
);
6365
}
66+
67+
public function merge(AbstractHookable ...$hookables): AbstractHookable
68+
{
69+
if (!$this->innerRenderer instanceof HookableMergerInterface) {
70+
throw new HookRenderException(sprintf('"%s" should implement "%s" to merge hookables\' data.', $this->innerRenderer::class, HookableMergerInterface::class));
71+
}
72+
73+
return $this->innerRenderer->merge(...$hookables);
74+
}
6475
}

0 commit comments

Comments
 (0)