winmillwill/BadFaith — pull request #8 by cboden (2012-05-15 19:28:18+00:00)
Title: API addition, internal changes

Bug fix: yes
Feature addition: yes
Backwards compatibility break: yes
Tests pass: yes
Tickets: #5

This PR replaces #6

* In some cases browsers do not send all 4 Accept headers, now make sure they're set if nothing given
* I created a unit test to simulate this then code to fix the issue
* Code was refactored to take advantage of late static binding, removing much duplicate code in classes that extended others
* `getPreferred` was implemented in `Negotiator`
* To do this the storage behind the scenes was changed, using an SplHeap instead of array to weight the order based on quality
* Added `AcceptItemInterface` to tie each accept header together
* `Negotiator`'s API was not broken, just internal classes