Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DependencyInjection] BC break in 7.3.4 breaks lazy proxies of some interfaces (php 8.3) #62291

Open
@stollr

Description

@stollr

Symfony version(s) affected

7.3.4

Description

I have a service class with a dependency ofTokenStorageInterface marked as lazy. This worked in the past. But after the update from v7.3.3 to v7.3.4 this breaks.

Here's my simplified class:

<?phpnamespaceApp\Extension\Serializer\Normalizer;useSymfony\Component\DependencyInjection\Attribute\Autowire;useSymfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;class ProfileNormalizer{publicfunction__construct(        #[Autowire(lazy:true)]privatereadonlyTokenStorageInterface$tokenStorage,    ) {}}

The responsible commit is002d735 with ththe change insrc/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

This results in theLazyServiceDumper trying to create a lazy proxy forSymfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage. This fails because is is final.

Previously the container definition was created for the interface and not the service which is aliased by the interface. So this is a bc issue.

How to reproduce

Checkout this reproduce project:https://github.com/stollr/symfony-lazy-proxy-bug-reproducer
and executephp8.3 /usr/local/bin/composer install.

This issue isnot reproducable with PHP 8.4. So you need to verify it with PHP 8.3.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp