Skip to content

[Form] [Hackday] [2.7] Deprecate PRE_BIND, BIND and POST_BIND form events #12648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
8 changes: 8 additions & 0 deletions src/Symfony/Component/Form/FormConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ public function __construct($name, $dataClass, EventDispatcherInterface $dispatc
*/
public function addEventListener($eventName, $listener, $priority = 0)
{
if (FormEvents::PRE_BIND === $eventName) {
trigger_error('Event FormEvents::PRE_BIND is deprecated since Symfony 2.3. Use FormEvents::PRE_SUBMIT instead', E_USER_DEPRECATED);
} elseif (FormEvents::BIND === $eventName) {
trigger_error('Event FormEvents::BIND is deprecated since Symfony 2.3. Use FormEvents::SUBMIT instead', E_USER_DEPRECATED);
} elseif (FormEvents::POST_BIND === $eventName) {
trigger_error('Event FormEvents::POST_BIND is deprecated since Symfony 2.3. Use FormEvents::POST_SUBMIT instead', E_USER_DEPRECATED);
}

if ($this->locked) {
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy