Skip to content

Commit

Permalink
Add support for Symfony 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Dec 1, 2023
1 parent 9976cf8 commit cd37a8d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
fail-fast: false
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "~6.0.0", "~6.1.0", "~6.2.0"]
symfony: ["^5.4", "~6.0.0", "~6.4.0"]
twig: ["^2.12", "^3.0"]
persistence: ["^2.0", "^3.0"]
exclude:
-
php: "8.0"
symfony: "~6.1.0"
symfony: "~6.4.0"
-
php: "8.0"
symfony: "~6.2.0"
persistence: "^2.0"
symfony: "~6.4.0"

steps:
-
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"sylius/grid-bundle": "^1.7 || v1.12.0-ALPHA.1",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0",
"symfony/workflow": "^5.4 || ^6.0",
"twig/twig": "^2.12 || ^3.0",
"vimeo/psalm": "^4.22",
Expand Down
34 changes: 34 additions & 0 deletions src/Bundle/Controller/ContainerAwareTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Sylius\Bundle\ResourceBundle\Controller;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* @internal
*/
trait ContainerAwareTrait
{
/** @var ContainerInterface|null */
protected $container;

public function setContainer(ContainerInterface $container = null)
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/dependency-injection', '6.2', 'Calling "%s::%s()" without any arguments is deprecated, pass null explicitly instead.', __CLASS__, __FUNCTION__);
}

$this->container = $container;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function process(ContainerBuilder $container): void
$resolveTargetEntityListener->addMethodCall('addResolveTargetEntity', [$interface, $model, []]);
}

/** @var object|string $resolveTargetEntityListenerClass */
$resolveTargetEntityListenerClass = $container->getParameterBag()->resolveValue($resolveTargetEntityListener->getClass());
if (is_a($resolveTargetEntityListenerClass, EventSubscriber::class, true)) {
if (!$resolveTargetEntityListener->hasTag('doctrine.event_subscriber')) {
Expand Down

0 comments on commit cd37a8d

Please sign in to comment.