Skip to content

Commit ff7674f

Browse files
Merge branch '2.7' into 2.8
* 2.7: (40 commits) [Debug] Fix ClassNotFoundFatalErrorHandler candidates lookups [2.6][Translator] Extend, refactor and simplify Translator tests. Update DebugClassLoader.php inject asset packages in assets helper service [travis] Do not exclude legacy tests on 2.7 [HttpFoundation] remove getExtension method [2.6][Translation] fix legacy tests. [Form] Removed remaining deprecation notices in the test suite [Form] Moved deprecation notice triggers to file level [Debug] Map PHP errors to LogLevel::CRITICAL [Routing][DependencyInjection] Support .yaml extension in YAML loaders [DX] improve file loader error for router/other resources in bundle [FrameworkBundle] Initialize translator with the default locale. [FrameworkBundle] Fix Routing\DelegatingLoader resiliency to fatal errors [2.7][Translation] remove duplicate code for loading catalogue. [2.6][Translation] remove duplicate code for loading catalogue. [HttpKernel] Cleanup ExceptionListener CS fixes [DependencyInjection] Show better error when the Yaml component is not installed [2.3] SCA for Components - reference mismatches ...
2 parents 326103b + 3cfe159 commit ff7674f

16 files changed

+82
-50
lines changed

Extension/Core/ChoiceList/ChoiceList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14+
trigger_error('The '.__NAMESPACE__.'\ChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\FormConfigBuilder;
1517
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1618
use Symfony\Component\Form\Exception\InvalidConfigurationException;
@@ -92,8 +94,6 @@ public function __construct($choices, array $labels, array $preferredChoices = a
9294
}
9395

9496
$this->initialize($choices, $labels, $preferredChoices);
95-
96-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
9797
}
9898

9999
/**

Extension/Core/ChoiceList/LazyChoiceList.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14+
trigger_error('The '.__NAMESPACE__.'\LazyChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\Exception\InvalidArgumentException;
1517

1618
/**
@@ -34,11 +36,6 @@ abstract class LazyChoiceList implements ChoiceListInterface
3436
*/
3537
private $choiceList;
3638

37-
public function __construct()
38-
{
39-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\LazyChoiceList instead.', E_USER_DEPRECATED);
40-
}
41-
4239
/**
4340
* {@inheritdoc}
4441
*/

Extension/Core/ChoiceList/ObjectChoiceList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14+
trigger_error('The '.__NAMESPACE__.'\ObjectChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\Exception\StringCastException;
1517
use Symfony\Component\Form\Exception\InvalidArgumentException;
1618
use Symfony\Component\PropertyAccess\PropertyPath;
@@ -96,8 +98,6 @@ public function __construct($choices, $labelPath = null, array $preferredChoices
9698
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
9799

98100
parent::__construct($choices, array(), $preferredChoices);
99-
100-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
101101
}
102102

103103
/**

Extension/Core/ChoiceList/SimpleChoiceList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14+
trigger_error('The '.__NAMESPACE__.'\SimpleChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* A choice list for choices of type string or integer.
1618
*

Extension/Core/DataTransformer/BaseDateTimeTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
4040
*/
4141
public function __construct($inputTimezone = null, $outputTimezone = null)
4242
{
43-
if (!is_string($inputTimezone) && null !== $inputTimezone) {
43+
if (null !== $inputTimezone && !is_string($inputTimezone)) {
4444
throw new UnexpectedTypeException($inputTimezone, 'string');
4545
}
4646

47-
if (!is_string($outputTimezone) && null !== $outputTimezone) {
47+
if (null !== $outputTimezone && !is_string($outputTimezone)) {
4848
throw new UnexpectedTypeException($outputTimezone, 'string');
4949
}
5050

Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
1313

14+
trigger_error('The class '.__NAMESPACE__.'\ChoiceToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1517
use Symfony\Component\Form\DataTransformerInterface;
1618
use Symfony\Component\Form\Exception\TransformationFailedException;
@@ -37,8 +39,6 @@ public function __construct(ChoiceListInterface $choiceList, $placeholderPresent
3739
{
3840
$this->choiceList = $choiceList;
3941
$this->placeholderPresent = $placeholderPresent;
40-
41-
trigger_error('The class '.__CLASS__.' is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\LazyChoiceList instead.', E_USER_DEPRECATED);
4242
}
4343

4444
/**

Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
1313

14+
trigger_error('The class '.__NAMESPACE__.'\ChoicesToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1517
use Symfony\Component\Form\DataTransformerInterface;
1618
use Symfony\Component\Form\Exception\TransformationFailedException;
@@ -28,8 +30,6 @@ class ChoicesToBooleanArrayTransformer implements DataTransformerInterface
2830
public function __construct(ChoiceListInterface $choiceList)
2931
{
3032
$this->choiceList = $choiceList;
31-
32-
trigger_error('The class '.__CLASS__.' is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\LazyChoiceList instead.', E_USER_DEPRECATED);
3333
}
3434

3535
/**

Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public function transform($dateTime)
9999
// remove leading zeros
100100
$entry = (string) (int) $entry;
101101
}
102+
// unset reference to keep scope clear
103+
unset($entry);
102104
}
103105

104106
return $result;

Extension/Core/EventListener/FixCheckboxInputListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\EventListener;
1313

14+
trigger_error('The class '.__NAMESPACE__.'\FixCheckboxInputListener is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1517
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1618
use Symfony\Component\Form\Exception\TransformationFailedException;
@@ -38,8 +40,6 @@ class FixCheckboxInputListener implements EventSubscriberInterface
3840
public function __construct(ChoiceListInterface $choiceList)
3941
{
4042
$this->choiceList = $choiceList;
41-
42-
trigger_error('The class '.__CLASS__.' is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper instead.', E_USER_DEPRECATED);
4343
}
4444

4545
public function preSubmit(FormEvent $event)

Extension/Core/EventListener/FixRadioInputListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\EventListener;
1313

14+
trigger_error('The class '.__NAMESPACE__.'\FixRadioInputListener is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1517
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1618
use Symfony\Component\Form\FormEvent;
@@ -41,8 +43,6 @@ public function __construct(ChoiceListInterface $choiceList, $placeholderPresent
4143
{
4244
$this->choiceList = $choiceList;
4345
$this->placeholderPresent = $placeholderPresent;
44-
45-
trigger_error('The class '.__CLASS__.' is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper instead.', E_USER_DEPRECATED);
4646
}
4747

4848
public function preSubmit(FormEvent $event)

0 commit comments

Comments
 (0)