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 21, 2024
1 parent c955e5c commit e727201
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 37 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: [ "^6.4" ]
symfony: [ "^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": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/expression-language": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/stopwatch": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/stopwatch": "^6.4 || ^7.0",
"symfony/twig-bundle": "^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": "^6.4",
"symfony/debug-bundle": "^6.4",
"symfony/dom-crawler": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/console": "^6.4 || ^7.0",
"symfony/debug-bundle": "^6.4 || ^7.0",
"symfony/dom-crawler": "^6.4 || ^7.0",
"symfony/dotenv": "^6.4 || ^7.0",
"symfony/flex": "^2.4",
"symfony/framework-bundle": "^6.4",
"symfony/runtime": "^6.4",
"symfony/translation": "^6.4",
"symfony/web-profiler-bundle": "^6.4",
"symfony/yaml": "^6.4 ",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/runtime": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
"symfony/yaml": "^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' => '^6.4',
'symfony/debug-bundle' => '^6.4 || ^7.0',
'symfony/flex' => '^2.4',
'symplify/monorepo-builder' => '11.2.*',
'phpstan/phpstan-symfony' => '^1.3'
Expand Down
32 changes: 16 additions & 16 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": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/expression-language": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/stopwatch": "^6.4",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/stopwatch": "^6.4 || ^7.0",
"symfony/ux-live-component": "^2.17",
"symfony/ux-twig-component": "^2.17",
"symfony/twig-bundle": "^6.4",
"symfony/twig-bundle": "^6.4 || ^7.0",
"twig/twig": "^2.15 || ^3.0"
},
"require-dev": {
"symfony/console": "^6.4",
"symfony/dom-crawler": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/runtime": "^6.4",
"symfony/translation": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/web-profiler-bundle": "^6.4",
"symfony/console": "^6.4 || ^7.0",
"symfony/dom-crawler": "^6.4 || ^7.0",
"symfony/dotenv": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/runtime": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 ",
"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",
"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 e727201

Please sign in to comment.