Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template #231

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Template #231

wants to merge 6 commits into from

Conversation

rustamwin
Copy link
Member

Q A
Is bugfix? ✔️/❌
New feature? ✔️/❌
Breaks BC? ✔️/❌
Fixed issues comma-separated list of tickets # fixed by the PR, if any

@what-the-diff
Copy link

what-the-diff bot commented Jul 11, 2023

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
Copy link

codecov bot commented Jul 11, 2023

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%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@samdark
Copy link
Member

samdark commented Jul 12, 2023

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 free to 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