Refactor info boxes - #121
Merged
Merged
Conversation
Revised connection and uptime messages for improved readability and accuracy. Enhanced connection percentage calculation by adding safeguards to prevent division by zero. Simplified phrasing for per-user connection limits.
Inject the StatusValues and Variables models directly via dependency injection factory services instead of fetching them from database repositories in runtime code. Move constructor injection to the AbstractInfoBox base class so all individual InfoBoxes inherit it. Decouple controllers and the page rendering by introducing a new RenderInfoBoxFactory and removing the obsolete Page model.
Declare the AbstractInfoBox base class and all its 27 subclasses as readonly classes. Remove the obsolete getStatusValues and getVariables getter methods from the base class, and replace all respective method calls in the subclasses with direct property access.
Declare all concrete InfoBox subclasses, the ListElement DTO, and the RenderInfoBoxFactory as final classes. This prevents inheritance and enforces better encapsulation in the InfoBox system.
Remove the updateView method and ViewInterface dependencies from AbstractInfoBox. Delegate view variable assignment and rendering to RenderInfoBoxFactory. Additionally, rename the abstract renderBody method to getBody in the base class and all subclasses.
Create InfoBoxInterface defining the TITLE constant and getBody. Update AbstractInfoBox to implement this interface and remove its local TITLE constant and getTitle method. Change all InfoBox subclasses to declare TITLE as public. Read the constant dynamically in the factory.
Remove the abstract getBody method declaration from the AbstractInfoBox base class. Since AbstractInfoBox implements InfoBoxInterface and all concrete subclasses implement getBody, the explicit abstract method declaration is redundant.
Remove the constructor declaration from AbstractInfoBox. Define a local constructor in each of the 27 InfoBox subclasses to inject StatusValues and Variables models directly. This removes the need to call parent::__construct inside the subclasses.
Remove the AbstractInfoBox base class completely from the project. Change all 27 InfoBox subclasses to directly implement the InfoBoxInterface instead of inheriting from AbstractInfoBox.
Reorder the constants and constructor declarations inside all 27 InfoBox subclasses to follow standard member order guidelines: traits, constants, constructor, then methods.
Run php-cs-fixer using the project's CGL configuration file to format all modified controllers, InfoBox classes, and interface files to comply with the TYPO3 coding guidelines.
Rename the typo3_13.yml workflow configuration to ci.yml in the GitHub workflow directory to reflect general continuous integration tasks.
Update the InfoBoxSystem.md specification file to describe the new stateless architecture. Describe the InfoBoxInterface, the removal of AbstractInfoBox, constructor DI autowiring, and RenderInfoBoxFactory.
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.