8000 [Form] Moved deprecation notice triggers to file level · symfony/symfony@c3adce6 · GitHub
[go: up one dir, main page]

Skip to content

Commit c3adce6

Browse files
committed
[Form] Moved deprecation notice triggers to file level
1 parent 8be2903 commit c3adce6

File tree

11 files changed

+22
-21
lines changed

11 files changed

+22
-21
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php

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

1212
namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
1313

14+
trigger_error('The '.__NAMESPACE__.'\EntityChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader instead.', E_USER_DEPRECATED);
15+
1416
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
1517
use Doctrine\Common\Persistence\ObjectManager;
1618
use Symfony\Component\Form\Exception\RuntimeException;
@@ -129,8 +131,6 @@ public function __construct(ObjectManager $manager, $class, $labelPath = null, E
129131
}
130132

131133
parent::__construct($entities, $labelPath, $preferredEntities, $groupPath, null, $propertyAccessor);
132-
133-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader instead.', E_USER_DEPRECATED);
134134
}
135135

136136
/**

src/Symfony/Component/Form/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
/**

src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.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__.'\ChoiceListInterface interface is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ChoiceListInterface instead.', E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Form\ChoiceList\ChoiceListInterface as BaseChoiceListInterface;
1517

1618
/**

src/Symfony/Component/Form/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
/**
@@ -35,11 +37,6 @@ abstract class LazyChoiceList implements ChoiceListInterface
3537
*/
3638
private $choiceList;
3739

38-
public function __construct()
39-
{
40-
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);
41-
}
42-
4340
/**
4441
* {@inheritdoc}
4542
*/

src/Symfony/Component/Form/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;
@@ -97,8 +99,6 @@ public function __construct($choices, $labelPath = null, array $preferredChoices
9799
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
98100

99101
parent::__construct($choices, array(), $preferredChoices);
100-
101-
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);
102102
}
103103

104104
/**

src/Symfony/Component/Form/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
*

src/Symfony/Component/Form/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;
@@ -38,8 +40,6 @@ public function __construct(ChoiceListInterface $choiceList, $placeholderPresent
3840
{
3941
$this->choiceList = $choiceList;
4042
$this->placeholderPresent = $placeholderPresent;
41-
42-
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);
4343
}
4444

4545
/**

src/Symfony/Component/Form/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;
@@ -29,8 +31,6 @@ class ChoicesToBooleanArrayTransformer implements DataTransformerInterface
2931
public function __construct(ChoiceListInterface $choiceList)
3032
{
3133
$this->choiceList = $choiceList;
32-
33-
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);
3434
}
3535

3636
/**

src/Symfony/Component/Form/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;
@@ -39,8 +41,6 @@ class FixCheckboxInputListener implements EventSubscriberInterface
3941
public function __construct(ChoiceListInterface $choiceList)
4042
{
4143
$this->choiceList = $choiceList;
42-
43-
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);
4444
}
4545

4646
public function preSubmit(FormEvent $event)

src/Symfony/Component/Form/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;
@@ -42,8 +44,6 @@ public function __construct(ChoiceListInterface $choiceList, $placeholderPresent
4244
{
4345
$this->choiceList = $choiceList;
4446
$this->placeholderPresent = $placeholderPresent;
45-
46-
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);
4747
}
4848

4949
public function preSubmit(FormEvent $event)

src/Symfony/Component/Form/Extension/Core/View/ChoiceView.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\View;
1313

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

1618
/**
@@ -33,7 +35,5 @@ class ChoiceView extends BaseChoiceView
3335
public function __construct($data, $value, $label)
3436
{
3537
parent::__construct($label, $value, $data);
36-
37-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED);
3838
}
3939
}

0 commit comments

Comments
 (0)
0