Commit 491c47c1 authored by xa's avatar xa

changes: added changelog

parent bea80cb6
In a nutshell
* Avoided to [inject repositories into entities](https://thinkbeforecoding.com/post/2009/03/04/How-not-to-inject-services-in-entities) (that would enabled fluent interface like `$quote->getSite()`)
* Encapsulate some snippets of code into helpers.
* Full coverage of TemplateManager from the start.
* Made refactorisation with [shameless code](https://blog.red-badger.com/2014/08/20/i-spent-3-days-with-sandi-metz-heres-what-i-learned), then reiterate once to [separation of behaviors](http://aspiringcraftsman.com/2008/01/03/art-of-separation-of-concerns/).
* Refactorisation made new placeholders and casting rules registerable.
```php
$renderer = new Evaneos\Template\Renderer();
// register new placeholder
$renderer->register('quote:date', function (Quote $quote) {
$quote->dateQuote->format('u');
});
// register new parameter
$renderer->registerParameter('param', function ($value) {
new Object($value);
});
```
In order
1. Fixed testing environment
* Installed PHP environment
* Created a git repo
* Updated dependencies
* Setup phpunit with coverage
* Setup namespacing
2. Testing TemplateManager
* Explore the TemplateManager -> 5 placeholders
* NEED to test each placeholder before refactoring
* Added a trait `Evaneos\Tests\AssertsUrl`
* Added a `Evaneos\Helper\Router::link` in order to cleanup placeholder
* Test [quote:destination_link] placeholder
* Test [quote:summary*] placeholders
* Added `Copywritting::capitalize`
* Test [user:first_name] placeholder
* Removed dead code from TemplateManager
* Full coverage !
3. Upgrade TemplateManager:
* Rewrote TemplateManager with shameless code
* Separation of behaviors into `Template\Renderer` and `Template\Renderer\Placeholder`.
4. Made TemplateManager extensible
* Registerable new templates
* Registerable new casting parameters
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment