Skip to content

Commit 33f3400

Browse files
committed
[Form] removed deprecated features
1 parent 582f3a3 commit 33f3400

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+28
-2824
lines changed

src/Symfony/Bridge/Twig/Extension/FormExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser;
1515
use Symfony\Bridge\Twig\Form\TwigRendererInterface;
16-
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
16+
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
1717

1818
/**
1919
* FormExtension extends Twig with form capabilities.

src/Symfony/Component/Form/ButtonBuilder.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -378,23 +378,6 @@ public function setByReference($byReference)
378378
throw new BadMethodCallException('Buttons do not support data mapping.');
379379
}
380380

381-
/**
382-
* Unsupported method.
383-
*
384-
* This method should not be invoked.
385-
*
386-
* @param bool $virtual
387-
*
388-
* @throws BadMethodCallException
389-
*
390-
* @deprecated since version 2.3, to be removed in 3.0. Use
391-
* {@link setInheritData()} instead.
392-
*/
393-
public function setVirtual($virtual)
394-
{
395-
throw new BadMethodCallException('Buttons cannot be virtual.');
396-
}
397-
398381
/**
399382
* Unsupported method.
400383
*
@@ -587,21 +570,6 @@ public function getByReference()
587570
return false;
588571
}
589572

590-
/**
591-
* Unsupported method.
592-
*
593-
* @return bool Always returns false.
594-
*
595-
* @deprecated since version 2.3, to be removed in 3.0.
596-
* Use {@link getInheritData()} instead.
597-
*/
598-
public function getVirtual()
599-
{
600-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\FormConfigBuilder::getInheritData method instead.', E_USER_DEPRECATED);
601-
602-
return false;
603-
}
604-
605573
/**
606574
* Unsupported method.
607575
*

src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
1616
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1717
use Symfony\Component\Form\ChoiceList\LazyChoiceList;
18-
use Symfony\Component\Form\ChoiceList\LegacyChoiceListAdapter;
1918
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
2019
use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;
2120
use Symfony\Component\Form\ChoiceList\View\ChoiceListView;
2221
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
23-
use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
2422

2523
/**
2624
* Default implementation of {@link ChoiceListFactoryInterface}.
@@ -65,23 +63,6 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
6563
*/
6664
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null)
6765
{
68-
// Backwards compatibility
69-
if ($list instanceof LegacyChoiceListAdapter && empty($preferredChoices)
70-
&& null === $label && null === $index && null === $groupBy && null === $attr) {
71-
$mapToNonLegacyChoiceView = function (LegacyChoiceView &$choiceView) {
72-
$choiceView = new ChoiceView($choiceView->data, $choiceView->value, $choiceView->label);
73-
};
74-
75-
$adaptedList = $list->getAdaptedList();
76-
77-
$remainingViews = $adaptedList->getRemainingViews();
78-
$preferredViews = $adaptedList->getPreferredViews();
79-
array_walk_recursive($remainingViews, $mapToNonLegacyChoiceView);
80-
array_walk_recursive($preferredViews, $mapToNonLegacyChoiceView);
81-
82-
return new ChoiceListView($remainingViews, $preferredViews);
83-
}
84-
8566
$preferredViews = array();
8667
$otherViews = array();
8768
$choices = $list->getChoices();

src/Symfony/Component/Form/ChoiceList/LegacyChoiceListAdapter.php

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Extension\Core\View;
12+
namespace Symfony\Component\Form\ChoiceList\View;
1313

1414
/**
1515
* Represents a choice in templates.
1616
*
1717
* @author Bernhard Schussek <bschussek@gmail.com>
18-
*
19-
* @deprecated since version 2.7, to be removed in 3.0.
20-
* Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead.
2118
*/
2219
class ChoiceView
2320
{
@@ -42,32 +39,6 @@ class ChoiceView
4239
*/
4340
public $data;
4441

45-
/**
46-
* Creates a new ChoiceView.
47-
*
48-
* @param mixed $data The original choice.
49-
* @param string $value The view representation of the choice.
50-
* @param string $label The label displayed to humans.
51-
*/
52-
public function __construct($data, $value, $label)
53-
{
54-
$this->data = $data;
55-
$this->value = $value;
56-
$this->label = $label;
57-
}
58-
}
59-
60-
namespace Symfony\Component\Form\ChoiceList\View;
61-
62-
use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
63-
64-
/**
65-
* Represents a choice in templates.
66-
*
67-
* @author Bernhard Schussek <bschussek@gmail.com>
68-
*/
69-
class ChoiceView extends LegacyChoiceView
70-
{
7142
/**
7243
* Additional attributes for the HTML tag.
7344
*
@@ -85,8 +56,9 @@ class ChoiceView extends LegacyChoiceView
8556
*/
8657
public function __construct($data, $value, $label, array $attr = array())
8758
{
88-
parent::__construct($data, $value, $label);
89-
59+
$this->data = $data;
60+
$this->value = $value;
61+
$this->label = $label;
9062
$this->attr = $attr;
9163
}
9264
}

src/Symfony/Component/Form/Exception/AlreadyBoundException.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Symfony/Component/Form/Exception/AlreadySubmittedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
*
1818
* @author Bernhard Schussek <bschussek@gmail.com>
1919
*/
20-
class AlreadySubmittedException extends AlreadyBoundException
20+
class AlreadySubmittedException extends LogicException
2121
{
2222
}

0 commit comments

Comments
 (0)
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