Parameter support#88
Open
TiMESPLiNTER wants to merge 5 commits into
Open
Conversation
…capsulated string which is not a parameter will make the config fail to load
|
That looks a good addition, @hassankhan would you like to merge it ? |
Collaborator
|
I'm really sorry for the delay. I would like to know how you can handle the case where you want to put in a property the string "%parameters.foo%", even if I have a property with the same key. |
peter279k
approved these changes
Dec 18, 2018
| * @return Config | ||
| */ | ||
| public static function load($path) | ||
| public static function load($path, array $parameters = null) |
Contributor
There was a problem hiding this comment.
How about let the optional $parameters be the empty array []?
| * @param array $parameters | ||
| */ | ||
| public function __construct($path) | ||
| public function __construct($path, array $parameters = null) |
Contributor
There was a problem hiding this comment.
It has the same issue in the previous comment thread I mention.
peter279k
pushed a commit
to open-source-contributions/config
that referenced
this pull request
May 8, 2021
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.75 to 0.12.76. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Commits](phpstan/phpstan@0.12.75...0.12.76) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal for #85
This is a first proposal to add parameter support. At the moment no recursive parameters are supported. This proposal is implemented to preserve backward compatibility.
Let's say we call the
Configas follows:we can use it in each of the config files like this:
this will result in:
if you use a not existing parameter in a config value it will not be replaced and the configuration parsing will not fail:
will result in:
Another idea would be to just merge the dynamic parameters into the config data and then allow using every config value as a parameter in another config value.