-
Couldn't load subscription status.
- Fork 10
Description
Hi,
I just found your library, and find some improvements would be really useful.
I would like to do some refactoring to allow more flexibility.
Mainly, my goal is to separate the building engine and the rendering engine.
It will allow other rendering than HTML. For example :
- a pure HTML+CSS rendering (as it is)
- an HTML-for-email rendering (it's actually my need)
- more generally, a templated-rendering (Twig)
- a command-line table
- a command-line table, using symfony helper (https://symfony.com/doc/current/components/console/helpers/table.html)
- ...
So, a schematic working plan on it would be :
- move printTable content into a "HTML Renderer class"
- split "toHtml" into buildTable and call to render
- inject an instance
- it implies making interfaces to contractualize :
** what a renderer is (RendererInterface)
** what a pivot table, built, is (currently, what are in $table, $maxX, $maxY. With DataObjects classes for sub-objects)
Well, in fact... the more I'm thinking to it, the more I went to the conclusion that what is needed is :
- create another library, more generic (let's call it "stats")
- deports the code in it
- make this library a simple caller of a method "createPivotTable" in stats
Please let me know what you think of it. I plan to do that with successive PRs, but, as refactoring can be time-consuming, I would'nt like to spent it if you're not agreeing this plan
Furthermore, to avoid conflicts, can you tell me what coding style rules you use ? It would help me push commits without space or braces change.