Permalink
Browse files

merged branch fabpot/deprecated (PR #7227)

This PR was merged into the master branch.

Discussion
----------

[WIP] Removed deprecated stuff

Commits
-------

f2a8908 removed deprecated functionality from RouteCollection
4f4a5d1 [TwigBundle] removed deprecated syntax
45bd413 [FrameworkBundle] removed deprecated options
0bb5d01 [FrameworkBundle] removed deprecated cookie options
b3081e8 [Form] removed deprecated methods and classes
e0385a2 [Validator] removed deprecated methods
65e3b16 [Validator] removed deprecated constraints
4a70ddf [HttpFoundation] removed deprecated session methods
4e7943f [Yaml] removed deprecated support of PHP parsin when parsing YAML files
09a5969 [HttpFoundation] removed deprecated Request::splitHttpAcceptHeader() method
c28f1b0 removed deprected way to declared trusted proxies
5ff6006 removed deprecated stuff in the fragment sub-framework
0a06a7c [Translation] removed deprecated classes
67f6397 [Security] removed deprecated classes
  • Loading branch information...
2 parents 5b5c7db + f2a8908 commit 26750075b846821ed1014fb8f50f05c50eb410c5 @fabpot fabpot committed Mar 23, 2013
Showing with 91 additions and 5,865 deletions.
  1. +0 −8 src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php
  2. +0 −8 src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php
  3. +0 −2 src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php
  4. +0 −33 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
  5. +0 −11 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  6. +0 −2 src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
  7. +0 −83 src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
  8. +0 −11 src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
  9. +1 −1 src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml
  10. +0 −2 src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php
  11. +0 −2 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
  12. +0 −20 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php
  13. +0 −17 ...ymfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php
  14. +12 −13 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
  15. +0 −12 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml
  16. +0 −12 ...ymfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml
  17. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
  18. +0 −16 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml
  19. +0 −14 ...ymfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml
  20. +12 −13 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
  21. +0 −31 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
  22. +0 −23 src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php
  23. +0 −9 src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php
  24. +0 −82 src/Symfony/Component/Form/AbstractType.php
  25. +0 −40 src/Symfony/Component/Form/AbstractTypeExtension.php
  26. +0 −44 src/Symfony/Component/Form/CallbackValidator.php
  27. +0 −74 src/Symfony/Component/Form/Event/DataEvent.php
  28. +0 −22 src/Symfony/Component/Form/Event/FilterDataEvent.php
  29. +0 −1 src/Symfony/Component/Form/Extension/Core/CoreExtension.php
  30. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php
  31. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
  32. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
  33. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/DateType.php
  34. +0 −32 src/Symfony/Component/Form/Extension/Core/Type/FieldType.php
  35. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/FileType.php
  36. +2 −12 src/Symfony/Component/Form/Extension/Core/Type/FormType.php
  37. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php
  38. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php
  39. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php
  40. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/NumberType.php
  41. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/PercentType.php
  42. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/TextType.php
  43. +0 −8 src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
  44. +1 −8 src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
  45. +0 −8 src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
  46. +3 −226 src/Symfony/Component/Form/Form.php
  47. +0 −28 src/Symfony/Component/Form/FormBuilder.php
  48. +0 −38 src/Symfony/Component/Form/FormBuilderInterface.php
  49. +0 −188 src/Symfony/Component/Form/FormConfigBuilder.php
  50. +0 −11 src/Symfony/Component/Form/FormConfigBuilderInterface.php
  51. +0 −9 src/Symfony/Component/Form/FormConfigInterface.php
  52. +46 −2 src/Symfony/Component/Form/FormEvent.php
  53. +0 −18 src/Symfony/Component/Form/FormEvents.php
  54. +0 −70 src/Symfony/Component/Form/FormFactory.php
  55. +2 −14 src/Symfony/Component/Form/FormRegistry.php
  56. +0 −11 src/Symfony/Component/Form/FormRegistryInterface.php
  57. +0 −12 src/Symfony/Component/Form/FormTypeGuesserChain.php
  58. +0 −12 src/Symfony/Component/Form/FormTypeGuesserInterface.php
  59. +0 −28 src/Symfony/Component/Form/FormValidatorInterface.php
  60. +0 −233 src/Symfony/Component/Form/FormView.php
  61. +0 −8 src/Symfony/Component/Form/ResolvedFormType.php
  62. +0 −16 src/Symfony/Component/Form/Tests/CompoundFormTest.php
  63. +0 −13 src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php
  64. +0 −118 src/Symfony/Component/Form/Tests/FormFactoryTest.php
  65. +0 −32 src/Symfony/Component/Form/Tests/FormRegistryTest.php
  66. +0 −21 src/Symfony/Component/Form/Tests/SimpleFormTest.php
  67. +0 −15 src/Symfony/Component/Form/Util/FormUtil.php
  68. +0 −57 src/Symfony/Component/Form/Util/PropertyPath.php
  69. +0 −36 src/Symfony/Component/Form/Util/PropertyPathBuilder.php
  70. +0 −27 src/Symfony/Component/Form/Util/PropertyPathInterface.php
  71. +0 −36 src/Symfony/Component/Form/Util/PropertyPathIterator.php
  72. +0 −27 src/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php
  73. +0 −50 src/Symfony/Component/HttpFoundation/Request.php
  74. +1 −18 src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php
  75. +0 −109 src/Symfony/Component/HttpFoundation/Session/Session.php
  76. +1 −60 src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
  77. +0 −14 src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php
  78. +0 −106 src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php
  79. +0 −29 src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
  80. +0 −21 src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
  81. +0 −113 src/Symfony/Component/Routing/RouteCollection.php
  82. +0 −29 src/Symfony/Component/Security/Core/Validator/Constraint/UserPassword.php
  83. +0 −29 src/Symfony/Component/Security/Core/Validator/Constraint/UserPasswordValidator.php
  84. +0 −30 src/Symfony/Component/Translation/Loader/QtTranslationsLoader.php
  85. +0 −84 src/Symfony/Component/Validator/ConstraintValidator.php
  86. +0 −51 src/Symfony/Component/Validator/Constraints/Max.php
  87. +0 −51 src/Symfony/Component/Validator/Constraints/MaxLength.php
  88. +0 −62 src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php
  89. +0 −56 src/Symfony/Component/Validator/Constraints/MaxValidator.php
  90. +0 −51 src/Symfony/Component/Validator/Constraints/Min.php
  91. +0 −51 src/Symfony/Component/Validator/Constraints/MinLength.php
  92. +0 −62 src/Symfony/Component/Validator/Constraints/MinLengthValidator.php
  93. +0 −61 src/Symfony/Component/Validator/Constraints/MinValidator.php
  94. +0 −126 src/Symfony/Component/Validator/ExecutionContext.php
  95. +0 −236 src/Symfony/Component/Validator/GraphWalker.php
  96. +1 −14 src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php
  97. +0 −63 src/Symfony/Component/Validator/Mapping/ClassMetadataFactoryAdapter.php
  98. +0 −30 src/Symfony/Component/Validator/Mapping/ClassMetadataFactoryInterface.php
  99. +0 −17 src/Symfony/Component/Validator/Mapping/MemberMetadata.php
  100. +0 −71 src/Symfony/Component/Validator/Tests/ConstraintValidatorTest.php
  101. +0 −140 src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php
  102. +0 −124 src/Symfony/Component/Validator/Tests/Constraints/MaxValidatorTest.php
  103. +0 −140 src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php
  104. +0 −121 src/Symfony/Component/Validator/Tests/Constraints/MinValidatorTest.php
  105. +0 −138 src/Symfony/Component/Validator/Tests/ExecutionContextTest.php
  106. +0 −592 src/Symfony/Component/Validator/Tests/GraphWalkerTest.php
  107. +4 −21 src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
  108. +0 −18 src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php
  109. +0 −76 src/Symfony/Component/Validator/Tests/ValidatorContextTest.php
  110. +0 −193 src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php
  111. +0 −21 src/Symfony/Component/Validator/ValidationVisitor.php
  112. +0 −10 src/Symfony/Component/Validator/ValidationVisitorInterface.php
  113. +1 −8 src/Symfony/Component/Validator/ValidatorBuilder.php
  114. +2 −5 src/Symfony/Component/Validator/ValidatorBuilderInterface.php
  115. +0 −124 src/Symfony/Component/Validator/ValidatorContext.php
  116. +0 −65 src/Symfony/Component/Validator/ValidatorContextInterface.php
  117. +0 −234 src/Symfony/Component/Validator/ValidatorFactory.php
  118. +0 −10 src/Symfony/Component/Yaml/Tests/YamlTest.php
  119. +1 −62 src/Symfony/Component/Yaml/Yaml.php
View
8 src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php
@@ -141,14 +141,6 @@ public function guessMaxLength($class, $property)
/**
* {@inheritDoc}
*/
- public function guessMinLength($class, $property)
- {
- trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
- }
-
- /**
- * {@inheritDoc}
- */
public function guessPattern($class, $property)
{
$ret = $this->getMetadata($class);
View
8 src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php
@@ -132,14 +132,6 @@ public function guessMaxLength($class, $property)
/**
* {@inheritDoc}
*/
- public function guessMinLength($class, $property)
- {
- trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
- }
-
- /**
- * {@inheritDoc}
- */
public function guessPattern($class, $property)
{
if ($column = $this->getColumn($class, $property)) {
View
2 src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php
@@ -54,8 +54,6 @@ public function getFunctions()
*/
public function renderFragment($uri, $options = array())
{
- $options = $this->handler->fixOptions($options);
-
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
unset($options['strategy']);
View
33 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -26,8 +26,6 @@ class Configuration implements ConfigurationInterface
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
- *
- * @throws \RuntimeException When using the deprecated 'charset' setting
*/
public function getConfigTreeBuilder()
{
@@ -36,27 +34,11 @@ public function getConfigTreeBuilder()
$rootNode
->children()
- ->scalarNode('charset')
- ->defaultNull()
- ->beforeNormalization()
- ->ifTrue(function($v) { return null !== $v; })
- ->then(function($v) {
- $message = 'The charset setting is deprecated. Just remove it from your configuration file.';
-
- if ('UTF-8' !== $v) {
- $message .= sprintf('You need to define a getCharset() method in your Application Kernel class that returns "%s".', $v);
- }
-
- throw new \RuntimeException($message);
- })
- ->end()
- ->end()
->scalarNode('secret')->end()
->scalarNode('http_method_override')
->info("Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests.")
->defaultTrue()
->end()
- ->scalarNode('trust_proxy_headers')->defaultFalse()->end() // @deprecated, to be removed in 2.3
->arrayNode('trusted_proxies')
->beforeNormalization()
->ifTrue(function($v) { return !is_array($v) && !is_null($v); })
@@ -201,16 +183,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
->info('session configuration')
->canBeUnset()
->children()
- ->booleanNode('auto_start')
- ->info('DEPRECATED! Session starts on demand')
- ->defaultFalse()
- ->beforeNormalization()
- ->ifTrue(function($v) { return null !== $v; })
- ->then(function($v) {
- throw new \RuntimeException('The auto_start setting is deprecated. Just remove it from your configuration file.');
- })
- ->end()
- ->end()
->scalarNode('storage_id')->defaultValue('session.storage.native')->end()
->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end()
->scalarNode('name')->end()
@@ -223,11 +195,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
->scalarNode('gc_probability')->end()
->scalarNode('gc_maxlifetime')->end()
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
- ->scalarNode('lifetime')->info('DEPRECATED! Please use: cookie_lifetime')->end()
- ->scalarNode('path')->info('DEPRECATED! Please use: cookie_path')->end()
- ->scalarNode('domain')->info('DEPRECATED! Please use: cookie_domain')->end()
- ->booleanNode('secure')->info('DEPRECATED! Please use: cookie_secure')->end()
- ->booleanNode('httponly')->info('DEPRECATED! Please use: cookie_httponly')->end()
->end()
->end()
->end()
View
11 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -69,10 +69,6 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('kernel.http_method_override', $config['http_method_override']);
$container->setParameter('kernel.trusted_proxies', $config['trusted_proxies']);
-
- // @deprecated, to be removed in 2.3
- $container->setParameter('kernel.trust_proxy_headers', $config['trust_proxy_headers']);
-
$container->setParameter('kernel.default_locale', $config['default_locale']);
if (!empty($config['test'])) {
@@ -312,13 +308,6 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
}
}
- //we deprecated session options without cookie_ prefix, but we are still supporting them,
- //Let's merge the ones that were supplied without prefix
- foreach (array('lifetime', 'path', 'domain', 'secure', 'httponly') as $key) {
- if (!isset($options['cookie_'.$key]) && isset($config[$key])) {
- $options['cookie_'.$key] = $config[$key];
- }
- }
$container->setParameter('session.storage.options', $options);
// session handler (the internal callback registered with PHP session management)
View
2 src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
@@ -43,8 +43,6 @@ public function boot()
{
if ($trustedProxies = $this->container->getParameter('kernel.trusted_proxies')) {
Request::setTrustedProxies($trustedProxies);
- } elseif ($this->container->getParameter('kernel.trust_proxy_headers')) {
- Request::trustProxyData(); // @deprecated, to be removed in 2.3
}
if ($this->container->getParameter('kernel.http_method_override')) {
View
83 src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
@@ -1,83 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Bundle\FrameworkBundle;
-
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel;
-
-/**
- * This HttpKernel is used to manage scope changes of the DI container.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- *
- * @deprecated This class is deprecated in 2.2 and will be removed in 2.3
- */
-class HttpKernel extends ContainerAwareHttpKernel
-{
- /**
- * Forwards the request to another controller.
- *
- * @param string $controller The controller name (a string like BlogBundle:Post:index)
- * @param array $attributes An array of request attributes
- * @param array $query An array of request query parameters
- *
- * @return Response A Response instance
- *
- * @deprecated in 2.2, will be removed in 2.3
- */
- public function forward($controller, array $attributes = array(), array $query = array())
- {
- trigger_error('forward() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- $attributes['_controller'] = $controller;
- $subRequest = $this->container->get('request')->duplicate($query, null, $attributes);
-
- return $this->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
- }
-
- /**
- * Renders a Controller and returns the Response content.
- *
- * Note that this method generates an esi:include tag only when both the standalone
- * option is set to true and the request has ESI capability (@see Symfony\Component\HttpKernel\HttpCache\ESI).
- *
- * Available options:
- *
- * * ignore_errors: true to return an empty string in case of an error
- * * alt: an alternative URI to execute in case of an error
- * * standalone: whether to generate an esi:include tag or not when ESI is supported
- * * comment: a comment to add when returning an esi:include tag
- *
- * @param string $uri A URI
- * @param array $options An array of options
- *
- * @return string The Response content
- *
- * @throws \RuntimeException
- * @throws \Exception
- *
- * @deprecated in 2.2, will be removed in 2.3 (use Symfony\Component\HttpKernel\Fragment\FragmentHandler::render() instead)
- */
- public function render($uri, array $options = array())
- {
- trigger_error('render() is deprecated since version 2.2 and will be removed in 2.3. Use Symfony\Component\HttpKernel\Fragment\FragmentHandler::render() instead.', E_USER_DEPRECATED);
-
- $options = $this->renderer->fixOptions($options);
-
- $strategy = isset($options['strategy']) ? $options['strategy'] : 'default';
- unset($options['strategy']);
-
- $this->container->get('fragment.handler')->render($uri, $strategy, $options);
- }
-}
View
11 src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
@@ -22,10 +22,7 @@
<xsd:element name="annotations" type="annotations" minOccurs="0" maxOccurs="1" />
</xsd:all>
- <!-- charset is deprecated and will be removed in 2.2 -->
- <xsd:attribute name="charset" type="xsd:string" />
<xsd:attribute name="http-method-override" type="xsd:boolean" />
- <xsd:attribute name="trust-proxy-headers" type="xsd:string" />
<xsd:attribute name="trusted-proxies" type="xsd:string" />
<xsd:attribute name="ide" type="xsd:string" />
<xsd:attribute name="secret" type="xsd:string" />
@@ -88,14 +85,6 @@
<xsd:attribute name="cookie-domain" type="xsd:string" />
<xsd:attribute name="cookie-secure" type="xsd:boolean" />
<xsd:attribute name="cookie-httponly" type="xsd:boolean" />
- <!-- deprecated attributes -->
- <xsd:attribute name="lifetime" type="xsd:string" />
- <xsd:attribute name="path" type="xsd:string" />
- <xsd:attribute name="domain" type="xsd:string" />
- <xsd:attribute name="secure" type="xsd:boolean" />
- <xsd:attribute name="httponly" type="xsd:boolean" />
- <xsd:attribute name="auto-start" type="xsd:boolean" />
- <!-- end of deprecated attributes -->
<xsd:attribute name="cache-limiter" type="xsd:string" />
<xsd:attribute name="gc-maxlifetime" type="xsd:string" />
<xsd:attribute name="gc-divisor" type="xsd:string" />
View
2 src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml
@@ -6,7 +6,7 @@
<parameters>
<parameter key="event_dispatcher.class">Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher</parameter>
- <parameter key="http_kernel.class">Symfony\Bundle\FrameworkBundle\HttpKernel</parameter>
+ <parameter key="http_kernel.class">Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel</parameter>
<parameter key="filesystem.class">Symfony\Component\Filesystem\Filesystem</parameter>
<parameter key="cache_warmer.class">Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate</parameter>
<parameter key="cache_clearer.class">Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer</parameter>
View
2 src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php
@@ -46,8 +46,6 @@ public function __construct(FragmentHandler $handler)
*/
public function render($uri, array $options = array())
{
- $options = $this->handler->fixOptions($options);
-
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
unset($options['strategy']);
View
2 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
@@ -87,9 +87,7 @@ public function testInvalidValueTrustedProxies()
protected static function getBundleDefaultConfig()
{
return array(
- 'charset' => null,
'http_method_override' => true,
- 'trust_proxy_headers' => false,
'trusted_proxies' => array(),
'ide' => null,
'default_locale' => 'en',
View
20 ...y/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php
@@ -1,20 +0,0 @@
-<?php
-
-$container->loadFromExtension('framework', array(
- 'secret' => 's3cr3t',
- 'session' => array(
- 'storage_id' => 'session.storage.native',
- 'handler_id' => 'session.handler.native_file',
- 'name' => '_SYMFONY',
- 'lifetime' => 2012,
- 'path' => '/sf2',
- 'domain' => 'sf2.example.com',
- 'secure' => false,
- 'httponly' => false,
- 'cookie_lifetime' => 86400,
- 'cookie_path' => '/',
- 'cookie_domain' => 'example.com',
- 'cookie_secure' => true,
- 'cookie_httponly' => true,
- ),
-));
View
17 ...undle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php
@@ -1,17 +0,0 @@
-<?php
-
-$container->loadFromExtension('framework', array(
- 'secret' => 's3cr3t',
- 'session' => array(
- 'storage_id' => 'session.storage.native',
- 'handler_id' => 'session.handler.native_file',
- 'name' => '_SYMFONY',
- 'lifetime' => 2012,
- 'path' => '/sf2',
- 'domain' => 'sf2.example.com',
- 'secure' => false,
- 'cookie_lifetime' => 86400,
- 'cookie_path' => '/',
- 'cookie_httponly' => true,
- ),
-));
View
25 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
@@ -5,7 +5,6 @@
'default_locale' => 'fr',
'form' => null,
'http_method_override' => false,
- 'trust_proxy_headers' => true,
'trusted_proxies' => array('127.0.0.1', '10.0.0.1'),
'csrf_protection' => array(
'enabled' => true,
@@ -23,18 +22,18 @@
'type' => 'xml',
),
'session' => array(
- 'storage_id' => 'session.storage.native',
- 'handler_id' => 'session.handler.native_file',
- 'name' => '_SYMFONY',
- 'lifetime' => 86400,
- 'path' => '/',
- 'domain' => 'example.com',
- 'secure' => true,
- 'httponly' => true,
- 'gc_maxlifetime' => 90000,
- 'gc_divisor' => 108,
- 'gc_probability' => 1,
- 'save_path' => '/path/to/sessions',
+ 'storage_id' => 'session.storage.native',
+ 'handler_id' => 'session.handler.native_file',
+ 'name' => '_SYMFONY',
+ 'cookie_lifetime' => 86400,
+ 'cookie_path' => '/',
+ 'cookie_domain' => 'example.com',
+ 'cookie_secure' => true,
+ 'cookie_httponly' => true,
+ 'gc_maxlifetime' => 90000,
+ 'gc_divisor' => 108,
+ 'gc_probability' => 1,
+ 'save_path' => '/path/to/sessions',
),
'templating' => array(
'assets_version' => 'SomeVersionScheme',
View
12 ...y/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml
@@ -1,12 +0,0 @@
-<?xml version="1.0" ?>
-
-<container xmlns="http://symfony.com/schema/dic/services"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:framework="http://symfony.com/schema/dic/symfony"
- xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
- http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
-
- <framework:config secret="s3cr3t">
- <framework:session storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" lifetime="2012" path="/sf2" domain="sf2.example.com" secure="false" httponly="false" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="true" />
- </framework:config>
-</container>
View
12 ...undle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml
@@ -1,12 +0,0 @@
-<?xml version="1.0" ?>
-
-<container xmlns="http://symfony.com/schema/dic/services"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:framework="http://symfony.com/schema/dic/symfony"
- xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
- http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
-
- <framework:config secret="s3cr3t">
- <framework:session storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" lifetime="2012" path="/sf2" domain="sf2.example.com" secure="false" httponly="false" cookie-lifetime="86400" cookie-path="/" cookie-httponly="true" />
- </framework:config>
-</container>
View
2 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
@@ -6,7 +6,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
- <framework:config secret="s3cr3t" ide="file%%link%%format" default-locale="fr" trust-proxy-headers="true" trusted-proxies="127.0.0.1, 10.0.0.1" http-method-override="false">
+ <framework:config secret="s3cr3t" ide="file%%link%%format" default-locale="fr" trusted-proxies="127.0.0.1, 10.0.0.1" http-method-override="false">
<framework:csrf-protection enabled="true" field-name="_csrf" />
<framework:form />
<framework:esi enabled="true" />
View
16 ...y/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml
@@ -1,16 +0,0 @@
-framework:
- secret: s3cr3t
- session:
- storage_id: session.storage.native
- handler_id: session.handler.native_file
- name: _SYMFONY
- lifetime: 2012
- path: /sf2
- domain: sf2.example.com
- secure: false
- httponly: false
- cookie_lifetime: 86400
- cookie_path: /
- cookie_domain: example.com
- cookie_secure: true
- cookie_httponly: true
View
14 ...undle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml
@@ -1,14 +0,0 @@
-framework:
- secret: s3cr3t
- session:
- storage_id: session.storage.native
- handler_id: session.handler.native_file
- name: _SYMFONY
- lifetime: 2012
- path: /sf2
- domain: sf2.example.com
- secure: false
- httponly: false
- cookie_lifetime: 86400
- cookie_path: /
- cookie_httponly: true
View
25 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
@@ -3,7 +3,6 @@ framework:
default_locale: fr
form: ~
http_method_override: false
- trust_proxy_headers: true
trusted_proxies: ['127.0.0.1', '10.0.0.1']
csrf_protection:
enabled: true
@@ -17,18 +16,18 @@ framework:
resource: %kernel.root_dir%/config/routing.xml
type: xml
session:
- storage_id: session.storage.native
- handler_id: session.handler.native_file
- name: _SYMFONY
- lifetime: 86400
- path: /
- domain: example.com
- secure: true
- httponly: true
- gc_probability: 1
- gc_divisor: 108
- gc_maxlifetime: 90000
- save_path: /path/to/sessions
+ storage_id: session.storage.native
+ handler_id: session.handler.native_file
+ name: _SYMFONY
+ cookie_lifetime: 86400
+ cookie_path: /
+ cookie_domain: example.com
+ cookie_secure: true
+ cookie_httponly: true
+ gc_probability: 1
+ gc_divisor: 108
+ gc_maxlifetime: 90000
+ save_path: /path/to/sessions
templating:
assets_version: SomeVersionScheme
assets_base_urls: http://cdn.example.com
View
31 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -37,7 +37,6 @@ public function testProxies()
{
$container = $this->createContainerFromFile('full');
- $this->assertTrue($container->getParameter('kernel.trust_proxy_headers'));
$this->assertEquals(array('127.0.0.1', '10.0.0.1'), $container->getParameter('kernel.trusted_proxies'));
}
@@ -112,36 +111,6 @@ public function testSession()
$this->assertEquals('/path/to/sessions', $container->getParameter('session.save_path'));
}
- public function testSessionDeprecatedMergeFull()
- {
- $container = $this->createContainerFromFile('deprecated_merge_full');
-
- $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
-
- $options = $container->getParameter('session.storage.options');
- $this->assertEquals('_SYMFONY', $options['name']);
- $this->assertEquals(86400, $options['cookie_lifetime']);
- $this->assertEquals('/', $options['cookie_path']);
- $this->assertEquals('example.com', $options['cookie_domain']);
- $this->assertTrue($options['cookie_secure']);
- $this->assertTrue($options['cookie_httponly']);
- }
-
- public function testSessionDeprecatedMergePartial()
- {
- $container = $this->createContainerFromFile('deprecated_merge_partial');
-
- $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
-
- $options = $container->getParameter('session.storage.options');
- $this->assertEquals('_SYMFONY', $options['name']);
- $this->assertEquals(86400, $options['cookie_lifetime']);
- $this->assertEquals('/', $options['cookie_path']);
- $this->assertEquals('sf2.example.com', $options['cookie_domain']);
- $this->assertFalse($options['cookie_secure']);
- $this->assertTrue($options['cookie_httponly']);
- }
-
public function testTemplating()
{
$container = $this->createContainerFromFile('full');
View
23 src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php
@@ -54,29 +54,6 @@ public function getTestsForRender()
'render'
)
),
- // deprecated in 2.2
- array(
- '{% render "foo" with {foo: 2} %}',
- new RenderNode(
- new \Twig_Node_Expression_Constant('foo', 1),
- new \Twig_Node_Expression_Array(array(), 1),
- 1,
- 'render'
- )
- ),
- // deprecated in 2.2
- array(
- '{% render "foo" with {foo: 2}, {foo: 1} %}',
- new RenderNode(
- new \Twig_Node_Expression_Constant('foo', 1),
- new \Twig_Node_Expression_Array(array(
- new \Twig_Node_Expression_Constant('foo', 1),
- new \Twig_Node_Expression_Constant('1', 1),
- ), 1),
- 1,
- 'render'
- )
- ),
);
}
}
View
9 src/Symfony/Bundle/TwigBundle/TokenParser/RenderTokenParser.php
@@ -31,15 +31,6 @@ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
- // attributes (not used anymore, kept for BC reasons)
- // @deprecated in 2.2 and will be removed in 2.3
- if ($this->parser->getStream()->test(\Twig_Token::NAME_TYPE, 'with')) {
- $this->parser->getStream()->next();
- $attributes = $this->parser->getExpressionParser()->parseExpression();
- } else {
- $attributes = new \Twig_Node_Expression_Array(array(), $token->getLine());
- }
-
// options
if ($this->parser->getStream()->test(\Twig_Token::PUNCTUATION_TYPE, ',')) {
$this->parser->getStream()->next();
View
82 src/Symfony/Component/Form/AbstractType.php
@@ -19,13 +19,6 @@
abstract class AbstractType implements FormTypeInterface
{
/**
- * @var array
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- private $extensions = array();
-
- /**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -51,50 +44,6 @@ public function finishView(FormView $view, FormInterface $form, array $options)
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
- $defaults = $this->getDefaultOptions(array());
- $allowedTypes = $this->getAllowedOptionValues(array());
-
- if (!empty($defaults)) {
- trigger_error('getDefaultOptions() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
-
- $resolver->setDefaults($defaults);
- }
-
- if (!empty($allowedTypes)) {
- trigger_error('getAllowedOptionValues() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
-
- $resolver->addAllowedValues($allowedTypes);
- }
- }
-
- /**
- * Returns the default options for this type.
- *
- * @param array $options Unsupported as of Symfony 2.1.
- *
- * @return array The default options
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- * Use {@link setDefaultOptions()} instead.
- */
- public function getDefaultOptions(array $options)
- {
- return array();
- }
-
- /**
- * Returns the allowed option values for each option (if any).
- *
- * @param array $options Unsupported as of Symfony 2.1.
- *
- * @return array The allowed option values
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- * Use {@link setDefaultOptions()} instead.
- */
- public function getAllowedOptionValues(array $options)
- {
- return array();
}
/**
@@ -104,35 +53,4 @@ public function getParent()
{
return 'form';
}
-
- /**
- * Sets the extensions for this type.
- *
- * @param FormTypeExtensionInterface[] $extensions An array of FormTypeExtensionInterface
- *
- * @throws Exception\UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- public function setExtensions(array $extensions)
- {
- trigger_error('setExtensions() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- $this->extensions = $extensions;
- }
-
- /**
- * Returns the extensions associated with this type.
- *
- * @return FormTypeExtensionInterface[] An array of FormTypeExtensionInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link ResolvedFormTypeInterface::getTypeExtensions()} instead.
- */
- public function getExtensions()
- {
- trigger_error('getExtensions() is deprecated since version 2.1 and will be removed in 2.3. Use ResolvedFormTypeInterface::getTypeExtensions instead.', E_USER_DEPRECATED);
-
- return $this->extensions;
- }
}
View
40 src/Symfony/Component/Form/AbstractTypeExtension.php
@@ -44,45 +44,5 @@ public function finishView(FormView $view, FormInterface $form, array $options)
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
- $defaults = $this->getDefaultOptions(array());
- $allowedTypes = $this->getAllowedOptionValues(array());
-
- if (!empty($defaults)) {
- trigger_error('getDefaultOptions() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
-
- $resolver->setDefaults($defaults);
- }
-
- if (!empty($allowedTypes)) {
- trigger_error('getAllowedOptionValues() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED);
-
- $resolver->addAllowedValues($allowedTypes);
- }
- }
-
- /**
- * Overrides the default options form the extended type.
- *
- * @return array
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- * Use {@link setDefaultOptions()} instead.
- */
- public function getDefaultOptions()
- {
- return array();
- }
-
- /**
- * Returns the allowed option values for each option (if any).
- *
- * @return array The allowed option values
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- * Use {@link setDefaultOptions()} instead.
- */
- public function getAllowedOptionValues()
- {
- return array();
}
}
View
44 src/Symfony/Component/Form/CallbackValidator.php
@@ -1,44 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Form;
-
-/**
- * Deprecated. You should use FormEvents::POST_BIND event listeners instead.
- *
- * @author Bernhard Schussek <bschussek@gmail.com>
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
-class CallbackValidator implements FormValidatorInterface
-{
- private $callback;
-
- /**
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- public function __construct($callback)
- {
- trigger_error('CallbackValidator is deprecated since version 2.1 and will be removed in 2.3. Use the FormEvents::POST_BIND event instead.', E_USER_DEPRECATED);
-
- $this->callback = $callback;
- }
-
- /**
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
- public function validate(FormInterface $form)
- {
- trigger_error('validate() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
-
- return call_user_func($this->callback, $form);
- }
-}
View
74 src/Symfony/Component/Form/Event/DataEvent.php
@@ -1,74 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Form\Event;
-
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\Form\FormInterface;
-use Symfony\Component\Form\FormEvent;
-
-/**
- * @author Bernhard Schussek <bschussek@gmail.com>
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against
- * {@link \Symfony\Component\Form\FormEvent} instead.
- */
-class DataEvent extends Event
-{
- private $form;
- protected $data;
-
- /**
- * Constructs an event.
- *
- * @param FormInterface $form The associated form
- * @param mixed $data The data
- */
- public function __construct(FormInterface $form, $data)
- {
- if (!$this instanceof FormEvent) {
- trigger_error(sprintf('%s is deprecated since version 2.1 and will be removed in 2.3. Code against \Symfony\Component\Form\FormEvent instead.', get_class($this)), E_USER_DEPRECATED);
- }
-
- $this->form = $form;
- $this->data = $data;
- }
-
- /**
- * Returns the form at the source of the event.
- *
- * @return FormInterface
- */
- public function getForm()
- {
- return $this->form;
- }
-
- /**
- * Returns the data associated with this event.
- *
- * @return mixed
- */
- public function getData()
- {
- return $this->data;
- }
-
- /**
- * Allows updating with some filtered data.
- *
- * @param mixed $data
- */
- public function setData($data)
- {
- $this->data = $data;
- }
-}
View
22 src/Symfony/Component/Form/Event/FilterDataEvent.php
@@ -1,22 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Form\Event;
-
-/**
- * @author Bernhard Schussek <bschussek@gmail.com>
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against
- * {@link \Symfony\Component\Form\FormEvent} instead.
- */
-class FilterDataEvent extends DataEvent
-{
-}
View
1 src/Symfony/Component/Form/Extension/Core/CoreExtension.php
@@ -24,7 +24,6 @@ class CoreExtension extends AbstractExtension
protected function loadTypes()
{
return array(
- new Type\FieldType(),
new Type\FormType(PropertyAccess::getPropertyAccessor()),
new Type\BirthdayType(),
new Type\CheckboxType(),
View
8 src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php
@@ -60,14 +60,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'checkbox';
View
8 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
@@ -214,14 +214,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'choice';
View
8 src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
@@ -287,14 +287,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'datetime';
View
8 src/Symfony/Component/Form/Extension/Core/Type/DateType.php
@@ -250,14 +250,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'date';
View
32 src/Symfony/Component/Form/Extension/Core/Type/FieldType.php
@@ -1,32 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Form\Extension\Core\Type;
-
-use Symfony\Component\Form\AbstractType;
-
-/**
- * Deprecated. You should extend FormType instead.
- *
- * @author Bernhard Schussek <bschussek@gmail.com>
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
-class FieldType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function getName()
- {
- return 'field';
- }
-}
View
8 src/Symfony/Component/Form/Extension/Core/Type/FileType.php
@@ -54,14 +54,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'file';
View
14 src/Symfony/Component/Form/Extension/Core/Type/FormType.php
@@ -45,8 +45,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->setDisabled($options['disabled'])
->setErrorBubbling($options['error_bubbling'])
->setEmptyData($options['empty_data'])
- // BC compatibility, when "property_path" could be false
- ->setPropertyPath(is_string($options['property_path']) ? $options['property_path'] : null)
+ ->setPropertyPath($options['property_path'])
->setMapped($options['mapped'])
->setByReference($options['by_reference'])
->setVirtual($options['virtual'])
@@ -56,10 +55,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->setDataMapper($options['compound'] ? new PropertyPathMapper($this->propertyAccessor) : null)
;
- if (false === $options['property_path']) {
- trigger_error('Setting "property_path" to "false" is deprecated since version 2.1 and will be removed in 2.3. Set "mapped" to "false" instead.', E_USER_DEPRECATED);
- }
-
if ($options['trim']) {
$builder->addEventSubscriber(new TrimListener());
}
@@ -200,11 +195,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
return $options['compound'];
};
- // BC clause: former property_path=false now equals mapped=false
- $mapped = function (Options $options) {
- return false !== $options['property_path'];
- };
-
// If data is given, the form is locked to that data
// (independent of its value)
$resolver->setOptional(array(
@@ -222,7 +212,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'max_length' => null,
'pattern' => null,
'property_path' => null,
- 'mapped' => $mapped,
+ 'mapped' => true,
'by_reference' => true,
'error_bubbling' => $errorBubbling,
'label' => null,
View
8 src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php
@@ -33,14 +33,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'hidden';
View
8 src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php
@@ -61,14 +61,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'integer';
View
8 src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php
@@ -62,14 +62,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'money';
View
8 src/Symfony/Component/Form/Extension/Core/Type/NumberType.php
@@ -59,14 +59,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'number';
View
8 src/Symfony/Component/Form/Extension/Core/Type/PercentType.php
@@ -48,14 +48,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'percent';
View
8 src/Symfony/Component/Form/Extension/Core/Type/TextType.php
@@ -29,14 +29,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'text';
View
8 src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
@@ -231,14 +231,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
/**
* {@inheritdoc}
*/
- public function getParent()
- {
- return 'field';
- }
-
- /**
- * {@inheritdoc}
- */
public function getName()
{
return 'time';
View
9 src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
@@ -53,11 +53,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
- // BC clause
- $constraints = function (Options $options) {
- return $options['validation_constraint'];
- };
-
// Make sure that validation groups end up as null, closure or array
$validationGroupsNormalizer = function (Options $options, $groups) {
if (empty($groups)) {
@@ -79,9 +74,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
$resolver->setDefaults(array(
'error_mapping' => array(),
'validation_groups' => null,
- // "validation_constraint" is deprecated. Use "constraints".
- 'validation_constraint' => null,
- 'constraints' => $constraints,
+ 'constraints' => null,
'cascade_validation' => false,
'invalid_message' => 'This value is not valid.',
'invalid_message_parameters' => array(),
View
8 src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
@@ -68,14 +68,6 @@ public function guessMaxLength($class, $property)
/**
* {@inheritDoc}
*/
- public function guessMinLength($class, $property)
- {
- trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
- }
-
- /**
- * {@inheritDoc}
- */
public function guessPattern($class, $property)
{
$guesser = $this;
View
229 src/Symfony/Component/Form/Form.php
@@ -16,7 +16,6 @@
use Symfony\Component\Form\Exception\AlreadyBoundException;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Util\FormUtil;
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\PropertyAccess\PropertyPath;
/**
@@ -202,27 +201,6 @@ public function getPropertyPath()
}
/**
- * Returns the types used by this form.
- *
- * @return FormTypeInterface[] An array of FormTypeInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::getType()} instead.
- */
- public function getTypes()
- {
- trigger_error('getTypes() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getType() instead.', E_USER_DEPRECATED);
-
- $types = array();
-
- for ($type = $this->config->getType(); null !== $type; $type = $type->getParent()) {
- array_unshift($types, $type->getInnerType());
- }
-
- return $types;
- }
-
- /**
* {@inheritdoc}
*/
public function isRequired()
@@ -273,21 +251,6 @@ public function getParent()
}
/**
- * Returns whether the form has a parent.
- *
- * @return Boolean
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getParent()} or inverse {@link isRoot()} instead.
- */
- public function hasParent()
- {
- trigger_error('hasParent() is deprecated since version 2.1 and will be removed in 2.3. Use getParent() or inverse isRoot() instead.', E_USER_DEPRECATED);
-
- return null !== $this->parent;
- }
-
- /**
* {@inheritdoc}
*/
public function getRoot()
@@ -304,40 +267,6 @@ public function isRoot()
}
/**
- * Returns whether the form has an attribute with the given name.
- *
- * @param string $name The name of the attribute.
- *
- * @return Boolean Whether the attribute exists.
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::hasAttribute()} instead.
- */
- public function hasAttribute($name)
- {
- trigger_error('hasAttribute() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::hasAttribute() instead.', E_USER_DEPRECATED);
-
- return $this->config->hasAttribute($name);
- }
-
- /**
- * Returns the value of the attributes with the given name.
- *
- * @param string $name The name of the attribute
- *
- * @return mixed The attribute value.
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::getAttribute()} instead.
- */
- public function getAttribute($name)
- {
- trigger_error('getAttribute() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getAttribute() instead.', E_USER_DEPRECATED);
-
- return $this->config->getAttribute($name);
- }
-
- /**
* {@inheritdoc}
*/
public function setData($modelData)
@@ -366,14 +295,9 @@ public function setData($modelData)
$dispatcher = $this->config->getEventDispatcher();
// Hook to change content of the data
- if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) {
+ if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA)) {
$event = new FormEvent($this, $modelData);
$dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event);
- // BC until 2.3
- if ($dispatcher->hasListeners(FormEvents::SET_DATA)) {
- trigger_error('The FormEvents::SET_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::PRE_SET_DATA event instead.', E_USER_DEPRECATED);
- }
- $dispatcher->dispatch(FormEvents::SET_DATA, $event);
$modelData = $event->getData();
}
@@ -473,21 +397,6 @@ public function getViewData()
}
/**
- * Alias of {@link getViewData()}.
- *
- * @return string
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getViewData()} instead.
- */
- public function getClientData()
- {
- trigger_error('getClientData() is deprecated since version 2.1 and will be removed in 2.3. Use getViewData() instead.', E_USER_DEPRECATED);
-
- return $this->getViewData();
- }
-
- /**
* {@inheritdoc}
*/
public function getExtraData()
@@ -532,14 +441,9 @@ public function bind($submittedData)
$dispatcher = $this->config->getEventDispatcher();
// Hook to change content of the data bound by the browser
- if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) {
+ if ($dispatcher->hasListeners(FormEvents::PRE_BIND)) {
$event = new FormEvent($this, $submittedData);
$dispatcher->dispatch(FormEvents::PRE_BIND, $event);
- // BC until 2.3
- if ($dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) {
- trigger_error('The FormEvents::BIND_CLIENT_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::PRE_BIND event instead.', E_USER_DEPRECATED);
- }
- $dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event);
$submittedData = $event->getData();
}
@@ -595,14 +499,9 @@ public function bind($submittedData)
// Hook to change content of the data into the normalized
// representation
- if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) {
+ if ($dispatcher->hasListeners(FormEvents::BIND)) {
$event = new FormEvent($this, $normData);
$dispatcher->dispatch(FormEvents::BIND, $event);
- // BC until 2.3
- if ($dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) {
- trigger_error('The FormEvents::BIND_NORM_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::BIND event instead.', E_USER_DEPRECATED);
- }
- $dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event);
$normData = $event->getData();
}
@@ -623,42 +522,10 @@ public function bind($submittedData)
$dispatcher->dispatch(FormEvents::POST_BIND, $event);
}
- set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC'));
- $validators = $this->config->getValidators();
- restore_error_handler();
-
- foreach ($validators as $validator) {
- trigger_error(sprintf('FormConfigInterface::getValidators() is deprecated since 2.1 and will be removed in 2.3. Convert your %s class to a listener on the FormEvents::POST_BIND event.', get_class($validator)), E_USER_DEPRECATED);
-
- $validator->validate($this);
- }
-
return $this;
}
/**
- * Binds a request to the form.
- *
- * If the request method is POST, PUT or GET, the data is bound to the form,
- * transformed and written into the form data (an object or an array).
- *
- * @param Request $request The request to bind to the form
- *
- * @return Form This form
- *
- * @throws FormException if the method of the request is not one of GET, POST or PUT
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link FormConfigInterface::bind()} instead.
- */
- public function bindRequest(Request $request)
- {
- trigger_error('bindRequest() is deprecated since version 2.1 and will be removed in 2.3. Use FormConfigInterface::bind() instead.', E_USER_DEPRECATED);
-
- return $this->bind($request);
- }
-
- /**
* {@inheritdoc}
*/
public function addError(FormError $error)
@@ -673,21 +540,6 @@ public function addError(FormError $error)
}
/**
- * Returns whether errors bubble up to the parent.
- *
- * @return Boolean
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::getErrorBubbling()} instead.
- */
- public function getErrorBubbling()
- {
- trigger_error('getErrorBubbling() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getErrorBubbling() instead.', E_USER_DEPRECATED);
-
- return $this->config->getErrorBubbling();
- }
-
- /**
* {@inheritdoc}
*/
public function isBound()
@@ -746,21 +598,6 @@ public function isValid()
}
/**
- * Returns whether there are errors associated with this form.
- *
- * @return Boolean
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Count
- * {@link getErrors()} instead.
- */
- public function hasErrors()
- {
- trigger_error('hasErrors() is deprecated since version 2.1 and will be removed in 2.3. Count getErrors() instead.', E_USER_DEPRECATED);
-
- return count($this->errors) > 0;
- }
-
- /**
* {@inheritdoc}
*/
public function getErrors()
@@ -797,36 +634,6 @@ public function getErrorsAsString($level = 0)
}
/**
- * Returns the model transformers of the form.
- *
- * @return DataTransformerInterface[] An array of DataTransformerInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::getModelTransformers()} instead.
- */
- public function getNormTransformers()
- {
- trigger_error('getNormTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getModelTransformers() instead.', E_USER_DEPRECATED);
-
- return $this->config->getModelTransformers();
- }
-
- /**
- * Returns the view transformers of the form.
- *
- * @return DataTransformerInterface[] An array of DataTransformerInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link getConfig()} and {@link FormConfigInterface::getViewTransformers()} instead.
- */
- public function getClientTransformers()
- {
- trigger_error('getClientTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getViewTransformers() instead.', E_USER_DEPRECATED);
-
- return $this->config->getViewTransformers();
- }
-
- /**
* {@inheritdoc}
*/
public function all()
@@ -835,36 +642,6 @@ public function all()
}
/**
- * Returns all children in this group.
- *
- * @return array
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link all()} instead.
- */
- public function getChildren()
- {
- trigger_error('getChildren() is deprecated since version 2.1 and will be removed in 2.3. Use all() instead.', E_USER_DEPRECATED);
-
- return $this->all();
- }
-
- /**
- * Returns whether the form has children.
- *
- * @return Boolean
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link count()} instead.
- */
- public function hasChildren()
- {
- trigger_error('hasChildren() is deprecated since version 2.1 and will be removed in 2.3. Use count() instead.', E_USER_DEPRECATED);
-
- return count($this->children) > 0;
- }
-
- /**
* {@inheritdoc}
*/
public function add($child, $type = null, array $options = array())
View
28 src/Symfony/Component/Form/FormBuilder.php
@@ -289,34 +289,6 @@ public function getIterator()
}
/**
- * Returns the types used by this builder.
- *
- * @return FormTypeInterface[] An array of FormTypeInterface
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link FormConfigInterface::getType()} instead.
- *
- * @throws BadMethodCallException If the builder was turned into a {@link FormConfigInterface}
- * via {@link getFormConfig()}.
- */
- public function getTypes()
- {
- trigger_error('getTypes() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getType() instead.', E_USER_DEPRECATED);
-
- if ($this->locked) {
- throw new BadMethodCallException('FormBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
- }
-
- $types = array();
-
- for ($type = $this->getType(); null !== $type; $type = $type->getParent()) {
- array_unshift($types, $type->getInnerType());
- }
-
- return $types;
- }
-
- /**
* Converts an unresolved child into a {@link FormBuilder} instance.
*
* @param string $name The name of the unresolved child.
View
38 src/Symfony/Component/Form/FormBuilderInterface.php
@@ -84,42 +84,4 @@ public function all();
* @return Form The form
*/
public function getForm();
-
- /**
- * Sets the parent builder.
- *
- * @param FormBuilderInterface $parent The parent builder
- *
- * @return FormBuilderInterface The builder object.
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. You
- * should not rely on the parent of a builder, because it is
- * likely that the parent is only set after turning the builder
- * into a form.
- */
- public function setParent(FormBuilderInterface $parent = null);
-
- /**
- * Returns the parent builder.
- *
- * @return FormBuilderInterface The parent builder
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. You
- * should not rely on the parent of a builder, because it is
- * likely that the parent is only set after turning the builder
- * into a form.
- */
- public function getParent();
-
- /**
- * Returns whether the builder has a parent.
- *
- * @return Boolean
- *
- * @deprecated Deprecated since version 2.2, to be removed in 2.3. You
- * should not rely on the parent of a builder, because it is
- * likely that the parent is only set after turning the builder
- * into a form.
- */
- public function hasParent();
}
View
188