Template
| Q | A |
|---|---|
| Is bugfix? | ✔️/❌ |
| New feature? | ✔️/❌ |
| Breaks BC? | ✔️/❌ |
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any |
PR Summary
-
Introduction of New 'Template' Class A new file, 'Template.php', was introduced. This file defines a 'Template' class, a useful tool for rendering a view. It takes in a path, parameters, a view instance, and an optional view context instance then holds them for easy access. Moreover, this class comes with getter methods to fetch this information back.
-
Changes in 'TemplateRendererInterface' Interface The
rendermethod signature within the 'TemplateRendererInterface' interface has been updated to accept a newly defined 'Template' object instead of individual parameters. This streamlines the method's usage by requiring only one object argument rather than a series of parameters. -
Changes in 'PhpTemplateRenderer' Class Similarly, changes have been made in the 'PhpTemplateRenderer' class. The
rendermethod signature now accepts a 'Template' object, providing a consolidated and standardized way for the method to draw data. It uses the getter methods from the 'Template' object to acquire its necessary parameters. -
Removal of 'render' Method from 'ViewTrait' The 'render' method from the 'ViewTrait' has been removed. Instead, its function was replaced by the
rendermethod of the renderer, utilizing a 'Template' object for its parameters. -
Introduction of 'TemplateTest.php' File A new testing file, 'TemplateTest.php' is added to ensure the functionality of the newly added 'Template' class. The file aims to assess and validate the reliability and effectiveness of this class.
Codecov Report
Patch coverage: 100.00% and no project coverage change.
Comparison is base (
d211ca6) 99.74% compared to head (84223fd) 99.75%.
Additional details and impacted files
@@ Coverage Diff @@
## master #231 +/- ##
=========================================
Coverage 99.74% 99.75%
- Complexity 299 304 +5
=========================================
Files 18 19 +1
Lines 791 803 +12
=========================================
+ Hits 789 801 +12
Misses 2 2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/PhpTemplateRenderer.php | 100.00% <100.00%> (ø) |
|
| src/Template.php | 100.00% <100.00%> (ø) |
|
| src/ViewTrait.php | 100.00% <100.00%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Good refactoring but doesn't solve any current issues and is backwards incompatible. Will hold it for now.