Repository navigation
refactor: footer handler decoupling - #5991
Merged
Merged
Conversation
Breaking changes:
- getFooter() now accepts only array $dimensions parameter
- UUID must be set via setTemplateVar('uuid', $uuid) before calling getFooter()
Changes:
- Remove FileEntity dependency from getFooter() signature
- Allow customization of all template variables via setTemplateVar()
- Only fetch default values from appConfig if not already customized
- Check if 'uuid' exists in templateVars before building validationSite
Benefits:
- Reduced coupling - no dependency on FileEntity
- More flexible - all variables customizable via same API
- Cleaner design - consistent use of setTemplateVar() for all variables
- Easier testing - no need to mock FileEntity
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Use setTemplateVar('uuid') to pass UUID to FooterHandler
- Call getFooter() with only dimensions parameter
- Maintains all existing functionality
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Use setTemplateVar('uuid') before calling getFooter()
- Remove FileEntity mock creation
- Simplify test setup
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Only generate QR code if validationSite is available in templateVars. This prevents undefined array key error when uuid is not set. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add tests for specific edge cases: - testGetFooterWithoutUuid: ensures no error when uuid is not set - testCustomValidationSiteNotOverwritten: validates that custom validationSite set via setTemplateVar() is not overwritten by appConfig defaults These tests complement the existing dataProvider tests and ensure the refactored code handles edge cases properly. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Introduces a type-safe collection class for footer template variables using magic methods (__call) with runtime type validation. Benefits: - Whitelist of allowed variables with expected types - Runtime type checking for all setters - Fluent interface for method chaining - Clean API with only ~70 lines of code - Prevents invalid variables or type mismatches Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace raw array with TemplateVariables class for better type safety and explicit contract of available template variables. Changes: - Use TemplateVariables instance instead of array - Replace array access with typed getters/setters - Maintain backward compatibility via setTemplateVar() - Improved code readability with explicit method names Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add 21 tests with 53 assertions covering: - Setters/getters for all 9 variables (via DataProvider) - Null returns for unset variables - Array conversion and merge functionality - Whitelist validation (rejects unknown variables) - Type validation (rejects wrong types) - Invalid method calls Use PHP 8 attributes for DataProviders for cleaner syntax. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
vitormattos
force-pushed
the
refactor/footer-handler-decoupling
branch
from
December 4, 2025 16:50
8fa149e to
6c27ee1
Compare
Member
Author
|
/backport to stable32 |
Member
Author
|
/backport to stable31 |
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This was referenced Dec 4, 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 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.
No description provided.