Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters defined using function notation in neon config not available when calling getParameter #301

Closed
maryo opened this issue Nov 14, 2023 · 4 comments

Comments

@maryo
Copy link

maryo commented Nov 14, 2023

Version: 3.1.8

Bug Description

Parameters defined using function notation in neon config are not available both when calling $container->getParameter('php_version') or $container->getParameters().
It was working in 3.0.x, stopped working in 3.1.0, then it started to work in 3.1.5 and in 3.1.8 it stopped working again.

parameters:
    php_version: ::constant(PHP_VERSION)

(we call a different function, this is just to illustrate)

It is a bug in my opinion, at least a BC break but perhaps it is intentional?
I know a proper way is to inject the parameter inside a service but we are dealing with some legacy code.

@dg
Copy link
Member

dg commented Nov 14, 2023

Did it ever really work in 3.0.x? I don't think so… I tried to make it work in 3.1.5 and I made so much trouble that I don't like to remember it.

@maryo
Copy link
Author

maryo commented Nov 14, 2023

It was working at least in 3.0.2 (version we were migrating from). I just tried it.

@dg
Copy link
Member

dg commented Nov 14, 2023

You're right, it only worked in 3.0.2 and was reverted in 3.0.3. It's not possible to implement this feature because it causes a huge amount of problems and has minimal benefit.

@dg dg closed this as completed Nov 16, 2023
@dg
Copy link
Member

dg commented Feb 4, 2024

In version 3.1.9, $container->getParameter('php_version') should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants