Skip to content

Template - #231

Draft
rustamwin wants to merge 6 commits into
masterfrom
template
Draft

Template#231
rustamwin wants to merge 6 commits into
masterfrom
template

Conversation

@rustamwin

Copy link
Copy Markdown
Member
QA
Is bugfix?✔️/❌
New feature?✔️/❌
Breaks BC?✔️/❌
Fixed issuescomma-separated list of tickets # fixed by the PR, if any

@what-the-diff

Copy link
Copy Markdown

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 render method 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 render method 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 render method 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

codecovBot commented Jul 11, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (d211ca6) to head (84223fd).
⚠️ Report is 84 commits behind head on master.

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 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samdark

Copy link
Copy Markdown
Member

Good refactoring but doesn't solve any current issues and is backwards incompatible. Will hold it for now.

@rustamwin
rustamwin marked this pull request as draft July 22, 2023 14:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rustamwin@samdark@StyleCIBot