N°9661 - feat(Utils): Add validation to GetConfigurationValue - #70
Draft
Hipska wants to merge 4 commits into
Draft
N°9661 - feat(Utils): Add validation to GetConfigurationValue#70Hipska wants to merge 4 commits into
GetConfigurationValue#70Hipska wants to merge 4 commits into
Conversation
Member
|
Hey @Hipska, thanks for this PR and its associated tests :) in case of invalid value, it doesn't seem to be error thrown (or logs), is it on purpose ? |
Collaborator
Author
|
No, it returns the default value or Do you want it to log something when this happens? (didn't seem necessary to me) |
Member
|
Thank you for your answer. If a user set a filter, he'll probably expect that an error is thrown in case of invalid value - rather than making a fallback on default value (not only a silent log) - and a log would also be appreciated. |
Collaborator
Author
|
Okay, so throw exception on invalid value and only return default if no value set? |
GetConfigurationValueGetConfigurationValue
Member
|
Yep that's it (exception + log in case of invalid value) :) |
4 tasks
Hipska
marked this pull request as draft
July 22, 2026 14:09
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.
Base information
Objective
When retrieving settings, you sometimes need to additional type checking validation. The objective is to reduce this as much as possible.
Before:
After:
Proposed solution
Use php's integrated functionality to filter/validate variables by adding an optional filter flag to the
GetConfigurationValuemethod. Current behaviour is not altered.Checklist before requesting a review