php-fig/http-message — pull request #9 by michaelmoussa (2014-10-27 19:03:51+00:00)
Title: An abstract implementation of the Message, Request, and Response interfaces

Following the precedent set by [`Psr\Log\AbstractLogger`](https://github.com/php-fig/log/blob/master/Psr/Log/AbstractLogger.php), I created some simple, generic, abstract implementations of the Message, Request, and Response interfaces. This would allow developers to begin writing PSR-7 compatible wrappers around their favorite HTTP libraries while the proposal moves forward.

A few things to note:

1. It was not clear to me if, for example, `"@throws \InvalidArgumentException for invalid header names or values."` in the interface docblocks meant "non-string" or if it meant to literally check against a whitelist of valid HTTP header field names. As such, I simply went the type-checking route, which can be expanded to include checking against a whitelist if that is the intention.
2. I have `AbstractRequest` validating URLs using a `validateUrl(...)` method that the extending `RequestInterface` class must implement. It seemed to me that validating a URL against RFC 3986 was beyond the scope of what this PSR aims to accomplish (and there are plenty of libraries for doing that anyway).
3. I haven't dealt with `IncomingRequestInterface` or `StreamableInterface` yet, so this is just a starting point. I can work on that (or invite anyone else to do so, naturally) if this PR generates interest.
4. Integration with Travis might be a good idea to ensure the Abstract implementations don't break if the Interfaces continue to evolve.

Feedback welcome!