Skip to content

Commit

Permalink
Add support for Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Jun 19, 2024
1 parent 9240ed3 commit 63ed218
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
php: [ "8.1", "8.2", "8.3" ]
symfony: [ "^5.4", "^6.4" ]
symfony: [ "^5.4", "^6.4", "^7.4" ]
name: "PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }}"
env:
APP_ENV: test
Expand Down
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@
"require": {
"php": "^8.1",
"laminas/laminas-stdlib": "^3.18",
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/expression-language": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0",
"symfony/twig-bundle": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/expression-language": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/ux-live-component": "^2.17",
"symfony/ux-twig-component": "^2.17",
"twig/twig": "^2.15 || ^3.0"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.3",
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1",
"matthiasnoback/symfony-config-test": "^5.1",
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^9.6",
"symfony/console": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/console": "^5.4 || ^6.4 || ^7.0",
"symfony/debug-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/dom-crawler": "^5.4 || ^6.4 || ^7.0",
"symfony/dotenv": "^5.4 || ^6.4 || ^7.0",
"symfony/flex": "^2.4",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/runtime": "^5.4 || ^6.0",
"symfony/translation": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0 ",
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/runtime": "^5.4 || ^6.4 || ^7.0",
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
"symplify/monorepo-builder": "11.2.*"
},
"autoload": {
Expand Down Expand Up @@ -69,7 +69,7 @@
},
"extra": {
"symfony": {
"require": "6.4.*"
"require": "7.0.*"
}
}
}
2 changes: 1 addition & 1 deletion monorepo-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
ComposerJsonSection::REQUIRE_DEV => [
'phpstan/phpstan' => '^1.10',
'symfony/debug-bundle' => '^5.4 || ^6.0',
'symfony/debug-bundle' => '^5.4 || ^6.4 || ^7.0',
'symfony/flex' => '^2.4',
'symplify/monorepo-builder' => '11.2.*',
'phpstan/phpstan-symfony' => '^1.3'
Expand Down
34 changes: 17 additions & 17 deletions src/TwigHooks/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@
"require": {
"php": "^8.1",
"laminas/laminas-stdlib": "^3.18",
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/expression-language": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0",
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/expression-language": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0",
"symfony/ux-live-component": "^2.17",
"symfony/ux-twig-component": "^2.17",
"symfony/twig-bundle": "^5.4 || ^6.0",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
"twig/twig": "^2.15 || ^3.0"
},
"require-dev": {
"symfony/console": "^5.4 || ^6.0",
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/runtime": "^5.4 || ^6.0",
"symfony/translation": "^5.4 || ^6.0",
"symfony/twig-bundle": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0 ",
"matthiasnoback/symfony-config-test": "^4.3",
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1",
"symfony/console": "^5.4 || ^6.4 || ^7.0",
"symfony/dom-crawler": "^5.4 || ^6.4 || ^7.0",
"symfony/dotenv": "^5.4 || ^6.4 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/runtime": "^5.4 || ^6.4 || ^7.0",
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
"matthiasnoback/symfony-config-test": "^5.1",
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
"phpunit/phpunit": "^9.6"
},
"suggest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
use Sylius\TwigHooks\Hookable\AbstractHookable;
use Sylius\TwigHooks\Hookable\HookableComponent;
use Sylius\TwigHooks\Hookable\HookableTemplate;
use Sylius\TwigHooks\Hookable\Merger\HookableMergerInterface;
use Sylius\TwigHooks\Hookable\Metadata\HookableMetadata;
use Sylius\TwigHooks\Hookable\Renderer\Exception\HookRenderException;
use Sylius\TwigHooks\Hookable\Renderer\HookableRendererInterface;

final class HookableDebugCommentRenderer implements HookableRendererInterface
final class HookableDebugCommentRenderer implements HookableRendererInterface, HookableMergerInterface
{
public function __construct(private readonly HookableRendererInterface $innerRenderer)
{
Expand Down Expand Up @@ -61,4 +63,13 @@ private function getClosingDebugComment(AbstractHookable $hookable): string
$hookable->priority(),
);
}

public function merge(AbstractHookable ...$hookables): AbstractHookable
{
if (!$this->innerRenderer instanceof HookableMergerInterface) {
throw new HookRenderException(sprintf('"%s" should implement %s to merge hookables\' data.', $this->innerRenderer::class, HookableMergerInterface::class));
}

return $this->innerRenderer->merge(...$hookables);
}
}

0 comments on commit 63ed218

Please sign in to comment.