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

Allow to provide a default value to getValue function #4

Open
ppalomera opened this issue Dec 13, 2023 · 2 comments
Open

Allow to provide a default value to getValue function #4

ppalomera opened this issue Dec 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ppalomera
Copy link
Member

Instead of returning an empty array, we should have the option to define a default value to return if our config is empty. Like is done in drupal state and drupal settings:

public function getValue($siteKey, $field, $defaultValue = []) {}
@ppalomera ppalomera added the enhancement New feature or request label Dec 13, 2023
@jherencia
Copy link
Member

jherencia commented Dec 13, 2023

I do not see why [] is a valid $defaultValue, it should be NULL instead, right?

@ppalomera
Copy link
Member Author

I do not see why [] is a valid $defaultValue, it should be NULL instead, right?

Yes, I assumed [] as default value to be compliant with current solution, but I have changed it to NULL

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

No branches or pull requests

3 participants