Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48d1169

Browse filesBrowse files
committed
feature #16024 [Validator] removed deprecated features in Validator and Form (fabpot)
This PR was merged into the 3.0-dev branch. Discussion ---------- [Validator] removed deprecated features in Validator and Form | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 33f3400 [Form] removed deprecated features 582f3a3 [Form] removed deprecated FormType::getName() bfba6ca [Form] removed precision option 17cedd3 [Form] removed usage of Validator deprecated features 8fd32ba [Validator] remove the API_VERSION 2a6b629 [Validator] removed deprecated methods 925ecaf [Validator] removed deprecated features in Constraints
2 parents 7bab317 + 33f3400 commit 48d1169
Copy full SHA for 48d1169

File tree

204 files changed

+329
-7091
lines changed
Filter options

Some content is hidden

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

204 files changed

+329
-7091
lines changed

‎src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
2323
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator;
2424
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
25-
use Symfony\Component\Validator\Validation;
2625
use Doctrine\ORM\Tools\SchemaTool;
2726

2827
/**
@@ -47,11 +46,6 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
4746
*/
4847
protected $repository;
4948

50-
protected function getApiVersion()
51-
{
52-
return Validation::API_VERSION_2_5;
53-
}
54-
5549
protected function setUp()
5650
{
5751
$this->em = DoctrineTestHelper::createTestEntityManager();

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/FormExtension.php
+1-1Lines 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/AbstractExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/AbstractExtension.php
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,7 @@ private function initTypes()
156156
throw new UnexpectedTypeException($type, 'Symfony\Component\Form\FormTypeInterface');
157157
}
158158

159-
// Since Symfony 3.0 types are identified by their FQCN
160-
$fqcn = get_class($type);
161-
$legacyName = $type->getName();
162-
163-
$this->types[$fqcn] = $type;
164-
165-
if ($legacyName) {
166-
$this->types[$legacyName] = $type;
167-
}
159+
$this->types[get_class($type)] = $type;
168160
}
169161
}
170162

‎src/Symfony/Component/Form/AbstractType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/AbstractType.php
+1-14Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ public function configureOptions(OptionsResolver $resolver)
4747
{
4848
}
4949

50-
/**
51-
* {@inheritdoc}
52-
*/
53-
public function getName()
54-
{
55-
// As of Symfony 2.8, the name defaults to the fully-qualified class name
56-
return get_class($this);
57-
}
58-
5950
/**
6051
* Returns the prefix of the template block name for this type.
6152
*
@@ -66,11 +57,7 @@ public function getName()
6657
*/
6758
public function getBlockPrefix()
6859
{
69-
$fqcn = get_class($this);
70-
$name = $this->getName();
71-
72-
// For BC: Use the name as block prefix if one is set
73-
return $name !== $fqcn ? $name : StringUtil::fqcnToBlockPrefix($fqcn);
60+
return StringUtil::fqcnToBlockPrefix(get_class($this));
7461
}
7562

7663
/**

‎src/Symfony/Component/Form/ButtonBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ButtonBuilder.php
-32Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php
-19Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/LegacyChoiceListAdapter.php
-144Lines changed: 0 additions & 144 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php
+4-32Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Exception/AlreadyBoundException.php
-30Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.