-
Notifications
You must be signed in to change notification settings - Fork 136
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
Parameter support #88
base: master
Are you sure you want to change the base?
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 ? |
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. |
* | ||
* @return Config | ||
*/ | ||
public static function load($path) | ||
public static function load($path, array $parameters = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about let the optional $parameters
be the empty array []
?
*/ | ||
public function __construct($path) | ||
public function __construct($path, array $parameters = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has the same issue in the previous comment thread I mention.
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] <[email protected]> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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
Config
as 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.