symfony/symfony — pull request #5841 by jfsimon (2012-10-26 08:33:16+00:00)
Title: [http-foudation] Better accept header parsing

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: yes

**Quality:**
The special `q` item attribute represents its quality. I had to make some choices:
* if I set `q` attribute, it's assigned to quality property, but not to attributes
* the `__toString()` method only render `q` attribute if quality is less than 1

**BC break:**
The return of `Request::splitHttpAcceptHeader()` has changed. It's result was an array of qualities indexed by an accept value, it now returns an array of `AcceptHeaderItem` indexed by its value.

**Perf warning:**
`AcceptHeaderItem` are sorted by quality. It cant use `uasort` because of its "indetermined order of equal values" problem, so I solved it by implementing a `merge sort` method.