I'm thinking we should probably have an AbstractResponseSender that contains this method, as it doesn't vary significantly between the implementations; right now, we're getting some code duplication.

Also, note that your implementation is missing checks that the PhpEnvironmentResponseSender has, making this one slightly less robust.