Merge branch '4.2' into 4.3

* 4.2:
  [WebProfilerBundle] fix FC with HttpFoundation v5
  [OptionsResolver] fix adding $triggerDeprecation to Options::offsetGet()
  [Form] test case is not legacy
  Fix reporting unsilenced deprecations from insulated tests
  Added FormInterface to @return Form::getClickedButton docblock
This commit is contained in:
Nicolas Grekas 2019-06-11 17:41:59 +02:00
commit bde8204da3
5 changed files with 7 additions and 10 deletions

View File

@ -284,7 +284,8 @@ class SymfonyTestsListenerTrait
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) { foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null)); $error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null));
if ($deprecation[0]) { if ($deprecation[0]) {
@trigger_error($error, E_USER_DEPRECATED); // unsilenced on purpose
trigger_error($error, E_USER_DEPRECATED);
} else { } else {
@trigger_error($error, E_USER_DEPRECATED); @trigger_error($error, E_USER_DEPRECATED);
} }

View File

@ -459,7 +459,8 @@ abstract class Client
unlink($deprecationsFile); unlink($deprecationsFile);
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) { foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
if ($deprecation[0]) { if ($deprecation[0]) {
@trigger_error($deprecation[1], E_USER_DEPRECATED); // unsilenced on purpose
trigger_error($deprecation[1], E_USER_DEPRECATED);
} else { } else {
@trigger_error($deprecation[1], E_USER_DEPRECATED); @trigger_error($deprecation[1], E_USER_DEPRECATED);
} }

View File

@ -95,7 +95,7 @@ class Form implements \IteratorAggregate, FormInterface, ClearableErrorsInterfac
private $submitted = false; private $submitted = false;
/** /**
* @var ClickableInterface|null The button that was used to submit the form * @var FormInterface|ClickableInterface|null The button that was used to submit the form
*/ */
private $clickedButton; private $clickedButton;
@ -753,7 +753,7 @@ class Form implements \IteratorAggregate, FormInterface, ClearableErrorsInterfac
/** /**
* Returns the button that was used to submit the form. * Returns the button that was used to submit the form.
* *
* @return ClickableInterface|null * @return FormInterface|ClickableInterface|null
*/ */
public function getClickedButton() public function getClickedButton()
{ {

View File

@ -725,10 +725,7 @@ class ChoiceTypeTest extends BaseTypeTest
$this->assertSame(['test'], $form->getData()); $this->assertSame(['test'], $form->getData());
} }
/** public function testNullChoices()
* @group legacy
*/
public function testLegacyNullChoices()
{ {
$form = $this->factory->create(static::TESTED_TYPE, null, [ $form = $this->factory->create(static::TESTED_TYPE, null, [
'multiple' => false, 'multiple' => false,

View File

@ -16,8 +16,6 @@ namespace Symfony\Component\OptionsResolver;
* *
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
* @author Tobias Schultze <http://tobion.de> * @author Tobias Schultze <http://tobion.de>
*
* @method mixed offsetGet(string $option, bool $triggerDeprecation = true)
*/ */
interface Options extends \ArrayAccess, \Countable interface Options extends \ArrayAccess, \Countable
{ {