bjo3rnf / DpnXmlSitemapBundle

27 stars 8 forks source link

[RFC] started refactor for 2.0 #22

Closed kbond closed 10 years ago

kbond commented 10 years ago

Here is the start of my idea for a 2.0 refactor (ref #20)

Let me know what you think.

TODO:

kbond commented 10 years ago

What about now? Didn't validate, but just parsed the results and use defaults if not correct.

bjo3rnf commented 10 years ago

What about now? Didn't validate, but just parsed the results and use defaults if not correct.

I like that. What about naming it normalizeLastMod' and include assigning the defaults instead of returning null?

kbond commented 10 years ago

I renamed all three of the static methods to normalize*

For normalizeLastMod, the default is null according to the sitemap protocol.

bjo3rnf commented 10 years ago

Cool. I like. Ready to merge?

kbond commented 10 years ago

Almost, I want to fix the tests first. Will work on that today.

kbond commented 10 years ago

Ok, I think this is good to merge now.

bjo3rnf commented 10 years ago

Hm. Another idea: What about adding those normalize methods to the interface and adding an abstract generator class that implements the interface for convenience? This way they (the normalize methods) could be invoked on generate() calls and thus entries assigned to the template are safe i.e. no need to check for defaults in templates.

bjo3rnf commented 10 years ago

Ok, I'll merge this one and open a new PR for further discussion.

kbond commented 10 years ago

Ok, yeah, I will probably need an example.

bjo3rnf commented 10 years ago

Ok, yeah, I will probably need an example.

See #24 ;)