Finished #3886

Replaces https://github.com/symfony/symfony-docs/pull/3886
This listener exists in 2.3: https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php