ParamConverter from SensioFrameworkExtraBundle. Extracted for use with any application that uses Symfony HttpKernel events.