-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support for default values #54
Merged
mike4git
merged 9 commits into
teamneusta:main
from
jan888adams:default-value-property-mapping-populator
Oct 16, 2023
Merged
Support for default values #54
mike4git
merged 9 commits into
teamneusta:main
from
jan888adams:default-value-property-mapping-populator
Oct 16, 2023
Conversation
This file contains 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
jan888adams
changed the title
Add default value for PropertyMappingPopulator
Default value for PropertyMappingPopulator
Sep 28, 2023
jdreesen
reviewed
Sep 29, 2023
jan888adams
force-pushed
the
default-value-property-mapping-populator
branch
from
October 9, 2023 05:12
0a7ec21
to
e238339
Compare
jan888adams
force-pushed
the
default-value-property-mapping-populator
branch
from
October 9, 2023 05:26
e238339
to
01d1660
Compare
jan888adams
changed the title
Default value for PropertyMappingPopulator
Support for default values when the source property returns null
Oct 9, 2023
jan888adams
changed the title
Support for default values when the source property returns null
Support for default values
Oct 9, 2023
jdreesen
reviewed
Oct 9, 2023
* ci: Split qa and test workflow for pipeline * fix: re-add cache:clear before phpstan * refactor: remove tests from qa
jan888adams
force-pushed
the
default-value-property-mapping-populator
branch
from
October 10, 2023 08:09
c66c745
to
9e42a6c
Compare
mike4git
reviewed
Oct 16, 2023
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.
I'm fine with - especially the new syntax
mike4git
approved these changes
Oct 16, 2023
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.
This merge request introduces the option to specify a default value for a property in case the source value is null. The key changes include:
Configuration.php:
Users can now use the keyword 'source' to define the source property and 'default' to specify a default value. If no default value is needed, the old syntax can still be used.
NeustaConverterExtension.php:
Modified NeustaConverterExtension.php to pass the default value property to the DefaultMappingPopulator by reading the default property.
PropertyMappingPopulator.php:
In PropertyMappingPopulator.php, a new constructor parameter of type 'mixed' has been added, allowing any type (string, bool, int, null, etc.) to be passed as the default value. When the source property returns null, it will be replaced with the provided default value.
Example Configuration:
Resolves Default value (PropertyMappingPopulator) #49 issue.