Closed rustamwin closed 1 year ago
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ✔️ |
Breaks BC? | ❌ |
Fixed issues | #227 |
Patch coverage: 100.00
% and no project coverage change.
Comparison is base (
d211ca6
) 99.74% compared to head (c6a0271
) 99.74%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Introduction of constant variable for PHP extension
For more consistent code, a constant PHP_EXTENSION
has been introduced. This adjustment makes our code more resilient against minor changes and less prone to errors.
Use of new constant in place initialization
The property $defaultExtension
within ViewTrait
has been modified to use the new constant PHP_EXTENSION
, replacing the previous static string, 'php'. This change is consistent with the introduction of the new constant. In addition, a new attribute $fallbackExtension
has been introduced with a default value of PHP_EXTENSION
.
Addition of backup solution
A new method withFallbackExtension
was added to the ViewTrait
trait. If the selected extension is not available, this method provides an automatic alternative, improving reliability.
Modifying find methods to adapt to fallback strategy
The findTemplateFile
method in ViewTrait
has been altered to use the $fallbackExtension
value rather than the static '.php'. This harmonizes with the above highlights, providing a more flexible and adjustable solution.
Tests covering new fallback mechanism
For verification of newly added functionalities, a new test case testRenderWithoutFileExtension
has been added in the ViewTest
class. The test uses the withDefaultExtension
and withFallbackExtension
methods, ensuring that the changes work as intended and improving overall robustness of the software.
👍