o / sitemap-php

Library for generating Google sitemap XML files
MIT License
300 stars 177 forks source link

Allow null $location param in the constructor and sanitize it #25

Open belyas opened 7 years ago

belyas commented 7 years ago

For type-hinting reason, we should set $location parameter in the constructor of WebSitemapItem class to null value which enables to use setLocation method from type-hinting

o commented 7 years ago

Hi @belyas The new version is still in progress. I am planning to finish to end of this month. https://github.com/o/sitemap-php/milestone/1

I just checked the sitemap spec, it seems location is required, this is why I kept location in constructor. And I am not sure about sanitize location. I want to keep this function flexible for every user.

So, everything is still in progress, lets discuss after a few days. Still I have to refactor and implement lots of things in library.

(But today you can use the library from packagist https://packagist.org/packages/osm/sitemap-php, be careful lots of thing (API, structure) will be change)

belyas commented 7 years ago

Hi @o ,

Alright, I see I'll be back later to have a look at it

Good luck :)