-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add support for appending config options #72
base: master
Are you sure you want to change the base?
Conversation
Another approach I thought of, was to use a special symbol to indicate that the list should be extended, eg: {
"symbol-whitelist" : ["*", "strict"],
"php-core-extensions" : ["*", "json"]
} |
Is it really necessary to opt-in into append mode after all, or can we just append by default? |
I don't understand the issue: can you elaborate on what this is and why it is needed? |
This library currently allows you to configure the list of symbols to ignore. However you must pass the default list the library ships with, plus your symbols. This PR allows you to append to the default list, instead of just a complete override. |
I would prefer to remove the builtin symbols from this whitelist, so extending would not be needed anymore. Instead of whitelisting the builtin symbols, we could possibly use the Have a look at this for an |
BetterReflection only has minimal support for built-ins via stubbing, but it could indeed work. As for the suggestion above, a simpler way would be to allow an invokable class to contain the built-ins, such as: namespace Some\Defaults;
final class BuiltIns
{
public function __invoke() : array
{
return [...];
}
} Then in the config, refer to |
I hope I'm getting it right, you think about adding something like adding |
More like having the class name in the configuration 👌 |
Hello, just interested in the status of this. I could really use it. Also, what do you think about using composer extra for this? Would be quite convenient and would avoid having to use config file altogether. |
When configuring to exclude a symbol, we have to copy all the default symbols, and then keep that up to date as new symbols are added in future.
To avoid this, I propose allowing configuration to be appended to, as well as overwritten: