Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #27267 [DependencyInjection] resolve array env vars (jamesthomaso…
…njr) This PR was squashed before being merged into the 3.4 branch (closes #27267). Discussion ---------- [DependencyInjection] resolve array env vars | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27239 | License | MIT | Doc PR | n/a ## Why This bugfix solves a problem where environment variables resolved as an array would cause an error while compiling the container if they aren't the last parameter in the ParameterBag: the next parameter to be resolved would fail at the `stripos()` check. More information about the bug is available at #27239 ## Tests - This PR modifies existing ContainerBuilder tests to make use of the EnvVarProcessor to resolve json strings into arrays, instead of relying upon a TestingEnvPlaceholderParameterBag class. - I would liked to have kept EnvVarProcessor logic out of the ContainerBuilder tests, but it was the interaction between the ContainerBuilder and EnvVarProcessor that caused the bug - This PR adds a new ContainerBuilder test to verify that an environment variable resolved into an array doesn't cause an error when the next variable attempts to be resolved ## Code - ~This PR adds an `\is_string()` sanity check before the `stripos()` method call so that only a string are passed into `stripos()`~ - This PR also adds a `$completed` flag so that completely resolved environment variables (currently only determined by `$placeholder === $value`) can break out of the loop early (handled via `break 2;` Commits ------- 4c3b950 [DependencyInjection] resolve array env vars
- Loading branch information