expectedbehavior / php-docraptor

PHP consumer for the DocRaptor.com API
ISC License
7 stars 1 forks source link

Add versioned user agent to the wrapper #31

Closed janxious closed 9 years ago

janxious commented 9 years ago

@markushausammann Thoughts on how to do this better? Seems like there should be a way for me to read the version from composer or read the version from somewhere else and put it in the composer json file.

Also changelog added!

janxious commented 9 years ago

Having read the user agent rfc, I agree re /. I will change that. I have also added the php version in just for fun. Thanks for the feedback!

janxious commented 9 years ago

@markushausammann Added a config class with the reporting config and version information. Thoughts?

markushausammann commented 9 years ago

I think introducing a final config class is a good idea at that point, but I would really like to inject it instead of introducing global state with a singleton.

janxious commented 9 years ago

I don't know if I'm convinced, but I'll give it a go and see if I prefer non-global (or am at least neutral).

markushausammann commented 9 years ago

I avoid global state and singletons as a habit, sooner or later it always leads to problems, introducing unneeded coupling, inhibiting testability. IMO 99.9% of cases better to inject an interface and keep everything open for mocking.

janxious commented 9 years ago

Now with less global config!

netshade commented 9 years ago

:+1: