10000 [3.0] Remove deprecated interfaces · symfony/symfony@881d1eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 881d1eb

Browse files
[3.0] Remove deprecated interfaces
1 parent 38c059f commit 881d1eb

File tree

15 files changed

+1
-467
lines changed

15 files changed

+1
-467
lines changed

src/Symfony/Bundle/FrameworkBundle/DataCollector/AjaxDataCollector.php

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

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,27 +116,6 @@ public function panelAction(Request $request, $token)
116116
)), 200, array('Content-Type' => 'text/html'));
117117
}
118118

119-
/**
120-
* Purges all tokens.
121-
*
122-
* @return Response A Response instance
123-
*
124-
* @throws NotFoundHttpException
125-
*/
126-
public function purgeAction()
127-
{
128-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
129-
130-
if (null === $this->profiler) {
131-
throw new NotFoundHttpException('The profiler must be enabled.');
132-
}
133-
134-
$this->profiler->disable();
135-
$this->profiler->purge();
136-
137-
return new RedirectResponse($this->generator->generate('_profiler_info', array('about' => 'purge')), 302, array('Content-Type' => 'text/html'));
138-
}
139-
140119
/**
141120
* Displays information page.
142121
*

src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
<default key="_controller">web_profiler.controller.profiler:searchBarAction</default>
1717
</route>
1818

19-
<route id="_profiler_purge" path="/purge">
20-
<default key="_controller">web_profiler.controller.profiler:purgeAction</default>
21-
</route>
22-
2319
<route id="_profiler_info" path="/info/{about}">
2420
<default key="_controller">web_profiler.controller.profiler:infoAction</default>
2521
</route>

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ private function parseDefinition(\DOMElement $service, $file)
217217
if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) {
218218
$parameters[$normalizedName] = XmlUtils::phpize($node->nodeValue);
219219
}
220-
// keep not normalized key for BC too
221-
$parameters[$name] = XmlUtils::phpize($node->nodeValue);
222220
}
223221

224222
$definition->addTag($tag->getAttribute('name'), $parameters);

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -901,10 +901,7 @@ private function relativize($xpath)
901901
$expression = substr($expression, strlen($parenthesis));
902902
}
903903

904-
// BC for Symfony 2.4 and lower were elements were adding in a fake _root parent
905-
if (0 === strpos($expression, '/_root/')) {
906-
$expression = './'.substr($expression, 7);
907-
} elseif (0 === strpos($expression, 'self::*/')) {
904+
if (0 === strpos($expression, 'self::*/')) {
908905
$expression = './'.substr($expression, 8);
909906
}
910907

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -135,35 +135,6 @@ public function createListFromChoices($choices, $value = null)
135135
return $this->lists[$hash];
136136
}
137137

138-
/**
139-
* {@inheritdoc}
140-
*
141-
* @deprecated Added for backwards compatibility in Symfony 2.7, to be
142-
* removed in Symfony 3.0.
143-
*/
144-
public function createListFromFlippedChoices($choices, $value = null, $triggerDeprecationNotice = true)
145-
{
146-
if ($choices instanceof \Traversable) {
147-
$choices = iterator_to_array($choices);
148-
}
149-
150-
// The value is not validated on purpose. The decorated factory may
151-
// decide which values to accept and which not.
152-
153-
// We ignore the choice groups for caching. If two choice lists are
154-
// requested with the same choices, but a different grouping, the same
155-
// choice list is returned.
156-
self::flatten($choices, $flatChoices);
157-
158-
$hash = self::generateHash(array($flatChoices, $value), 'fromFlippedChoices');
159-
160-
if (!isset($this->lists[$hash])) {
161-
$this->lists[$hash] = $this->decoratedFactory->createListFromFlippedChoices($choices, $value, $triggerDeprecationNotice);
162-
}
163-
164-
return $this->lists[$hash];
165-
}
166-
167138
/**
168139
* {@inheritdoc}
169140
*/

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,6 @@ interface ChoiceListFactoryInterface
3939
*/
4040
public function createListFromChoices($choices, $value = null);
4141

42-
/**
43-
* Creates a choice list for the given choices.
44-
*
45-
* The choices should be passed in the keys of the choices array. Since the
46-
* choices array will be flipped, the entries of the array must be strings
47-
* or integers.
48-
*
49-
* Optionally, a callable can be passed for generating the choice values.
50-
* The callable receives the choice as first and the array key as the second
51-
* argument.
52-
*
53-
* @param array|\Traversable $choices The choices
54-
* @param null|callable $value The callable generating the choice
55-
* values
56-
*
57-
* @return ChoiceListInterface The choice list
58-
*
59-
* @deprecated Added for backwards compatibility in Symfony 2.7, to be
60-
* removed in Symfony 3.0.
61-
*/
62-
public function createListFromFlippedChoices($choices, $value = null);
63-
6442
/**
6543
* Creates a choice list that is loaded with the given loader.
6644
*

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

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

1212
namespace Symfony\Component\Form\ChoiceList\Factory;
1313

14-
use Symfony\Component\Form\ChoiceList\ArrayKeyChoiceList;
1514
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
1615
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1716
use Symfony\Component\Form\ChoiceList\LazyChoiceList;
@@ -35,21 +34,6 @@ public function createListFromChoices($choices, $value = null)
3534
return new ArrayChoiceList($choices, $value);
3635
}
3736

38-
/**
39-
* {@inheritdoc}
40-
*
41-
* @deprecated Added for backwards compatibility in Symfony 2.7, to be
42-
* removed in Symfony 3.0.
43-
*/
44-
public function createListFromFlippedChoices($choices, $value = null, $triggerDeprecationNotice = true)
45-
{
46-
if ($triggerDeprecationNotice) {
47-
@trigger_error('The '.__METHOD__.' is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
48-
}
49-
50-
return new ArrayKeyChoiceList($choices, $value);
51-
}
52-
5337
/**
5438
* {@inheritdoc}
5539
*/

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,25 +104,6 @@ public function createListFromChoices($choices, $value = null)
104104
return $this->decoratedFactory->createListFromChoices($choices, $value);
105105
}
106106

107-
/**
108-
* {@inheritdoc}
109-
*
110-
* @param array|\Traversable $choices The choices
111-
* @param null|callable|string|PropertyPath $value The callable or path for
112-
* generating the choice values
113-
*
114-
* @return ChoiceListInterface The choice list
115-
*
116-
* @deprecated Added for backwards compatibility in Symfony 2.7, to be
117-
* removed in Symfony 3.0.
118-
*/
119-
public function createListFromFlippedChoices($choices, $value = null, $triggerDeprecationNotice = true)
120-
{
121-
// Property paths are not supported here, because array keys can never
122-
// be objects
123-
return $this->decoratedFactory->createListFromFlippedChoices($choices, $value, $triggerDeprecationNotice);
124-
}
125-
126107
/**
127108
* {@inheritdoc}
128109
*

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ public function buildView(FormView $view, FormInterface $form, array $options)
199199
$view->vars['placeholder'] = $options['placeholder'];
2002 10000 00
}
201201

202-
// BC
203-
$view->vars['empty_value_in_choices'] = $view->vars['placeholder_in_choices'];
204-
205202
if ($options['multiple'] && !$options['expanded']) {
206203
// Add "[]" to the name in case a select tag with multiple options is
207204
// displayed. Otherwise only one of the selected options is sent in the
@@ -260,11 +257,6 @@ public function configureOptions(OptionsResolver $resolver)
260257
// Harden against NULL values (like in EntityType and ModelType)
261258
$choices = null !== $options['choices'] ? $options['choices'] : array();
262259

263-
// BC when choices are in the keys, not in the values
264-
if (!$options['choices_as_values']) {
265-
return $choiceListFactory->createListFromFlippedChoices($choices, $options['choice_value'], false);
266-
}
267-
268260
return $choiceListFactory->createListFromChoices($choices, $options['choice_value']);
269261
};
270262

@@ -299,7 +291,6 @@ public function configureOptions(OptionsResolver $resolver)
299291
$resolver->setDefaults(array(
300292
'multiple' => false,
301293
'expanded' => false,
302-
'choice_list' => null, // deprecated
303294
'choices' => array(),
304295
'choices_as_values' => false,
305296
'choice_loader' => null,
@@ -320,11 +311,9 @@ public function configureOptions(OptionsResolver $resolver)
320311
'choice_translation_domain' => true,
321312
));
322313

323-
$resolver->setNormalizer('choice_list', $choiceListNormalizer);
324314
$resolver->setNormalizer('placeholder', $placeholderNormalizer);
325315
$resolver->setNormalizer('choice_translation_domain', $choiceTranslationDomainNormalizer);
326316

327-
$resolver->setAllowedTypes('choice_list', array('null', 'Symfony\Component\Form\ChoiceList\ChoiceListInterface'));
328317
$resolver->setAllowedTypes('choices', array('null', 'array', '\Traversable'));
329318
$resolver->setAllowedTypes('choice_translation_domain', array('null', 'bool', 'string'));
330319
$resolver->setAllowedTypes('choices_as_values', 'bool');

src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,10 @@ public function finishView(FormView $view, FormInterface $form, array $options)
121121
*/
122122
public function configureOptions(OptionsResolver $resolver)
123123
{
124-
// BC clause for the "intention" option
125124
$csrfTokenId = function (Options $options) {
126125
return $options['intention'];
127126
};
128127

129-
// BC clause for the "csrf_provider" option
130128
$csrfTokenManager = function (Options $options) {
131129
if ($options['csrf_provider'] instanceof CsrfTokenManagerInterface) {
132130
return $options['csrf_provider'];

src/Symfony/Component/Form/Tests/AbstractFormTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase
3434

3535
protected function setUp()
3636
{
37-
// We need an actual dispatcher to use the deprecated
38-
// bindRequest() method
3937
$this->dispatcher = new EventDispatcher();
4038
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
4139
$this->form = $this->createForm();

0 commit comments

Comments
 (0)
0