symfony/HttpFoundation — pull request #4 by maikg (2012-02-26 17:00:11+00:00)
Title: Add 422 status code

Native HTTP doesn't have a good status code to represent validation failures in a request body. The closest you can get is using 400 Bad Request, but that should only be returned when the request body is malformed (i.e. incorrect syntax). Rails uses 422 Unprocessable Entity in those cases, which has been added to HTTP through a WebDAV extension. I prefer to do this in my PHP code as well, as the description matches the use case mentioned above perfectly.

> **422 Unprocessable Entity (WebDAV) (RFC 4918)**
> The request was well-formed but was unable to be followed due to semantic errors.