Skip to content

Service implementing ResetInterface with shared: false is not being reset #60903

Open
@FluffyDiscord

Description

@FluffyDiscord

Symfony version(s) affected

7.3

Description

Non-shared services are not being reset when they implement ResetInterface. This kind of makes sense, but they are services non-the-less, so they should be referenced in container and should be resettable.

How to reproduce

<?php

use Symfony\Contracts\Service\ResetInterface;

#[Autoconfigure(
    shared: false,
)]
class Test implements ResetInterface 
{
    public function reset(): void
    {
        dd('Hello!');
    }
}

class Something
{
    public function __construct(private readonly Test $test): void
    {
    }
}

Test->reset() is never called

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy