Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a custom denormalizer to correctly map data payloads for website settings updates and registers it as a serializer service.
- Introduces
WebsiteSettingsUpdateDenormalizerto handle array, string, and boolean payloads fordata - Tags the new denormalizer in
config/website_settings.yaml - Cleans up minor formatting in the update controller
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/WebsiteSetting/Request/WebsiteSettingsUpdateDenormalizer.php | New denormalizer class that constructs WebsiteSettingsUpdate from request payloads |
| src/WebsiteSetting/Controller/UpdateController.php | Removed an extra blank line |
| config/website_settings.yaml | Registered the new denormalizer service tag |
Comments suppressed due to low confidence (2)
src/WebsiteSetting/Request/WebsiteSettingsUpdateDenormalizer.php:43
- The
denormalize()method can throwInvalidArgumentException; please add a@throws InvalidArgumentExceptionannotation to the docblock to document this behavior.
public function denormalize(
src/WebsiteSetting/Request/WebsiteSettingsUpdateDenormalizer.php:1
- This new denormalizer logic isn’t covered by existing tests. Please add unit tests in
tests/Unitfor cases wheredatais an array, string, boolean, and invalid type to verify expected behavior.
<?php
martineiber
requested changes
Jul 14, 2025
|
martineiber
approved these changes
Jul 14, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Changes in this pull request
Resolves #1210
Additional info
Symfony maps data always to the object (ElementParameter) when using MapRequestPayload.
Introduced custom denormalizer to tackle this issue.