Skip to content

Make it possible to override DebugClassLoader settings through .env.local #48872

Closed
@TomaszGasior

Description

@TomaszGasior

Symfony version(s) affected

5.4

Description

There is no way to set SYMFONY_PATCH_TYPE_DECLARATIONS used by DebugClassLoader in .env.local.

I want to disable typing related deprecations because they make my work related to upgrading my app harder — I want to focus on real problems first, then on adding types to my code... From the other hand, I don't want to disable these deprecation for all developers by modifying index.php and keep them by default.

How to reproduce

Add SYMFONY_PATCH_TYPE_DECLARATIONS='deprecations=0' to your .env.local. There is no effect, even after bin/console cache:clear.

Possible Solution

Using $_ENV instead of getenv() here?

parse_str(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?: '', $this->patchTypes);

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