[Form] handle BC use of deprecated stuff in non-test-methods.
This commit is contained in:
parent
fc2be6ddc8
commit
c21b12e896
@ -366,7 +366,9 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
|
|
||||||
// Hook to change content of the data
|
// Hook to change content of the data
|
||||||
if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) {
|
if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) {
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
$event = new FormEvent($this, $modelData);
|
$event = new FormEvent($this, $modelData);
|
||||||
|
restore_error_handler();
|
||||||
$dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event);
|
$dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event);
|
||||||
// BC until 2.3
|
// BC until 2.3
|
||||||
$dispatcher->dispatch(FormEvents::SET_DATA, $event);
|
$dispatcher->dispatch(FormEvents::SET_DATA, $event);
|
||||||
@ -529,7 +531,9 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
|
|
||||||
// Hook to change content of the data bound by the browser
|
// Hook to change content of the data bound by the browser
|
||||||
if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) {
|
if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) {
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
$event = new FormEvent($this, $submittedData);
|
$event = new FormEvent($this, $submittedData);
|
||||||
|
restore_error_handler();
|
||||||
$dispatcher->dispatch(FormEvents::PRE_BIND, $event);
|
$dispatcher->dispatch(FormEvents::PRE_BIND, $event);
|
||||||
// BC until 2.3
|
// BC until 2.3
|
||||||
$dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event);
|
$dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event);
|
||||||
@ -589,7 +593,9 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
// Hook to change content of the data into the normalized
|
// Hook to change content of the data into the normalized
|
||||||
// representation
|
// representation
|
||||||
if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) {
|
if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) {
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
$event = new FormEvent($this, $normData);
|
$event = new FormEvent($this, $normData);
|
||||||
|
restore_error_handler();
|
||||||
$dispatcher->dispatch(FormEvents::BIND, $event);
|
$dispatcher->dispatch(FormEvents::BIND, $event);
|
||||||
// BC until 2.3
|
// BC until 2.3
|
||||||
$dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event);
|
$dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event);
|
||||||
@ -613,9 +619,11 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
$dispatcher->dispatch(FormEvents::POST_BIND, $event);
|
$dispatcher->dispatch(FormEvents::POST_BIND, $event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
foreach ($this->config->getValidators() as $validator) {
|
foreach ($this->config->getValidators() as $validator) {
|
||||||
$validator->validate($this);
|
$validator->validate($this);
|
||||||
}
|
}
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,9 @@ class FormFactory implements FormFactoryInterface
|
|||||||
$typeGuess = $guesser->guessType($class, $property);
|
$typeGuess = $guesser->guessType($class, $property);
|
||||||
$maxLengthGuess = $guesser->guessMaxLength($class, $property);
|
$maxLengthGuess = $guesser->guessMaxLength($class, $property);
|
||||||
// Keep $minLengthGuess for BC until Symfony 2.3
|
// Keep $minLengthGuess for BC until Symfony 2.3
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
$minLengthGuess = $guesser->guessMinLength($class, $property);
|
$minLengthGuess = $guesser->guessMinLength($class, $property);
|
||||||
|
restore_error_handler();
|
||||||
$requiredGuess = $guesser->guessRequired($class, $property);
|
$requiredGuess = $guesser->guessRequired($class, $property);
|
||||||
$patternGuess = $guesser->guessPattern($class, $property);
|
$patternGuess = $guesser->guessPattern($class, $property);
|
||||||
|
|
||||||
|
@ -131,11 +131,13 @@ class FormRegistry implements FormRegistryInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handleBC'));
|
||||||
$this->addType($this->resolvedTypeFactory->createResolvedType(
|
$this->addType($this->resolvedTypeFactory->createResolvedType(
|
||||||
$type,
|
$type,
|
||||||
$typeExtensions,
|
$typeExtensions,
|
||||||
$parentType ? $this->getType($parentType) : null
|
$parentType ? $this->getType($parentType) : null
|
||||||
));
|
));
|
||||||
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user