Skip to content

Commit 8a96b1d

Browse files
[7.0] Remove remaining deprecated code paths
1 parent 41802f6 commit 8a96b1d

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CHANGELOG
88
* Remove `ProxyHelper`, use `Symfony\Component\VarExporter\ProxyHelper` instead
99
* Remove `ReferenceSetArgumentTrait`
1010
* Remove support of `@required` annotation, use the `Symfony\Contracts\Service\Attribute\Required` attribute instead
11-
* Passing `null` to `ContainerAwareTrait::setContainer()` must be done explicitly
11+
* Require explicit argument when calling `ContainerAwareTrait::setContainer()`
1212
* Remove `PhpDumper` options `inline_factories_parameter` and `inline_class_loader_parameter`, use options `inline_factories` and `inline_class_loader` instead
1313
* Parameter names of `ParameterBag` cannot be numerics
1414
* Remove `ContainerAwareInterface` and `ContainerAwareTrait`, use dependency injection instead

Compiler/RegisterServiceSubscribersPass.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

1414
use Psr\Container\ContainerInterface as PsrContainerInterface;
15-
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1615
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1716
use Symfony\Component\DependencyInjection\ContainerInterface;
1817
use Symfony\Component\DependencyInjection\Definition;
1918
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2019
use Symfony\Component\DependencyInjection\Reference;
2120
use Symfony\Component\DependencyInjection\TypedReference;
22-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
2321
use Symfony\Contracts\Service\Attribute\SubscribedService;
2422
use Symfony\Contracts\Service\ServiceProviderInterface;
2523
use Symfony\Contracts\Service\ServiceSubscriberInterface;
@@ -71,8 +69,6 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
7169
throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $this->currentId, ServiceSubscriberInterface::class));
7270
}
7371
$class = $r->name;
74-
// to remove when symfony/dependency-injection will stop being compatible with symfony/framework-bundle<6.0
75-
$replaceDeprecatedSession = $this->container->has('.session.deprecated') && $r->isSubclassOf(AbstractController::class);
7672
$subscriberMap = [];
7773

7874
foreach ($class::getSubscribedServices() as $key => $type) {
@@ -99,11 +95,6 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
9995
if (!$autowire) {
10096
throw new InvalidArgumentException(sprintf('Service "%s" misses a "container.service_subscriber" tag with "key"/"id" attributes corresponding to entry "%s" as returned by "%s::getSubscribedServices()".', $this->currentId, $key, $class));
10197
}
102-
if ($replaceDeprecatedSession && SessionInterface::class === $type) {
103-
// This prevents triggering the deprecation when building the container
104-
// to remove when symfony/dependency-injection will stop being compatible with symfony/framework-bundle<6.0
105-
$type = '.session.deprecated';
106-
}
10798
$serviceMap[$key] = new Reference($type);
10899
}
109100

Tests/Compiler/ResolveBindingsPassTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1615
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1716
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
1817
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
@@ -38,8 +37,6 @@
3837

3938
class ResolveBindingsPassTest extends TestCase
4039
{
41-
use ExpectDeprecationTrait;
42-
4340
public function testProcess()
4441
{
4542
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)