diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index f93dd7dce56eb..dde5c1439f202 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -12,7 +12,6 @@ namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor; use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index b8251ce816125..135ea5757858c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -437,15 +437,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode) ->end() ->scalarNode('translation_domain')->defaultValue('validators')->end() ->booleanNode('strict_email')->defaultFalse()->end() - ->enumNode('api') - ->info('Deprecated since version 2.7, to be removed in 3.0') - ->values(array('2.4', '2.5', '2.5-bc', 'auto')) - ->beforeNormalization() - // XML/YAML parse as numbers, not as strings - ->ifTrue(function ($v) { return is_scalar($v); }) - ->then(function ($v) { return (string) $v; }) - ->end() - ->end() ->end() ->end() ->end() diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php index 9c5f9c1fec2cf..07410afc5aa6b 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php @@ -72,15 +72,12 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface */ const ROUND_HALF_DOWN = \NumberFormatter::ROUND_HALFDOWN; - /** - * @deprecated since version 2.7, will be replaced by a $scale private property in 3.0. - */ - protected $precision; - protected $grouping; protected $roundingMode; + private $scale; + public function __construct($scale = null, $grouping = false, $roundingMode = self::ROUND_HALF_UP) { if (null === $grouping) { @@ -91,7 +88,7 @@ public function __construct($scale = null, $grouping = false, $roundingMode = se $roundingMode = self::ROUND_HALF_UP; } - $this->precision = $scale; + $this->scale = $scale; $this->grouping = $grouping; $this->roundingMode = $roundingMode; } @@ -211,8 +208,8 @@ protected function getNumberFormatter() { $formatter = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL); - if (null !== $this->precision) { - $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->precision); + if (null !== $this->scale) { + $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->scale); $formatter->setAttribute(\NumberFormatter::ROUNDING_MODE, $this->roundingMode); } @@ -230,9 +227,9 @@ protected function getNumberFormatter() */ private function round($number) { - if (null !== $this->precision && null !== $this->roundingMode) { + if (null !== $this->scale && null !== $this->roundingMode) { // shift number to maintain the correct scale during rounding - $roundingCoef = pow(10, $this->precision); + $roundingCoef = pow(10, $this->scale); $number *= $roundingCoef; switch ($this->roundingMode) { diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index 6c22265d0a663..981fc6eb550ca 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -283,11 +283,7 @@ private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $ $pattern = $formatter->getPattern(); $timezone = $formatter->getTimezoneId(); - if ($setTimeZone = PHP_VERSION_ID >= 50500 || method_exists($formatter, 'setTimeZone')) { - $formatter->setTimeZone('UTC'); - } else { - $formatter->setTimeZoneId('UTC'); - } + $formatter->setTimeZone('UTC'); if (preg_match($regex, $pattern, $matches)) { $formatter->setPattern($matches[0]); @@ -301,11 +297,7 @@ private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $ $formatter->setPattern($pattern); } - if ($setTimeZone) { - $formatter->setTimeZone($timezone); - } else { - $formatter->setTimeZoneId($timezone); - } + $formatter->setTimeZone($timezone); return $timestamps; } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php b/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php index b91df89370398..5a3765f71cfc1 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php @@ -14,7 +14,6 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\DataTransformer\IntegerToLocalizedStringTransformer; -use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class IntegerType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php index ab8d00487e3d9..a75483e6c36e0 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php @@ -16,7 +16,6 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer; use Symfony\Component\Form\FormView; -use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class MoneyType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php b/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php index 61ab9c1443672..ae49053e5514e 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php @@ -14,7 +14,6 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer; -use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class NumberType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php b/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php index b330e3283fc6e..46d29e284ec09 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php @@ -14,7 +14,6 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer; -use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; class PercentType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index 760a772031315..e6ca8d47fdd14 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -171,7 +171,7 @@ public function configureOptions(OptionsResolver $resolver) return $options['widget'] !== 'single_text'; }; - $placeholder = $placeholderDefault = function (Options $options) { + $placeholderDefault = function (Options $options) { return $options['required'] ? null : ''; }; @@ -219,7 +219,7 @@ public function configureOptions(OptionsResolver $resolver) 'with_seconds' => false, 'model_timezone' => null, 'view_timezone' => null, - 'placeholder' => $placeholder, + 'placeholder' => $placeholderDefault, 'html5' => true, // Don't modify \DateTime classes by reference, we treat // them like immutable value objects diff --git a/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php b/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php index bd84e672e7a33..8484c75520f62 100644 --- a/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php +++ b/src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php @@ -25,9 +25,7 @@ class DependencyInjectionExtension implements FormExtensionInterface private $guesser; private $guesserLoaded = false; - public function __construct(ContainerInterface $container, - array $typeServiceIds, array $typeExtensionServiceIds, - array $guesserServiceIds) + public function __construct(ContainerInterface $container, array $typeServiceIds, array $typeExtensionServiceIds, array $guesserServiceIds) { $this->container = $container; $this->typeServiceIds = $typeServiceIds; diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index f0e2704880e51..35fb035cf8004 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -20,7 +20,6 @@ use Symfony\Component\Form\Util\FormUtil; use Symfony\Component\Form\Util\InheritDataAwareIterator; use Symfony\Component\Form\Util\OrderedHashMap; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\PropertyAccess\PropertyPath; /** @@ -506,10 +505,6 @@ public function handleRequest($request = null) */ public function submit($submittedData, $clearMissing = true) { - if ($submittedData instanceof Request) { - @trigger_error('Passing a Symfony\Component\HttpFoundation\Request object to the '.__CLASS__.'::bind and '.__METHOD__.' methods is deprecated since 2.3 and will be removed in 3.0. Use the '.__CLASS__.'::handleRequest method instead. If you want to test whether the form was submitted separately, you can use the '.__CLASS__.'::isSubmitted method.', E_USER_DEPRECATED); - } - if ($this->submitted) { throw new AlreadySubmittedException('A form can only be submitted once'); } diff --git a/src/Symfony/Component/Form/FormTypeExtensionInterface.php b/src/Symfony/Component/Form/FormTypeExtensionInterface.php index deb87de79b57f..a8a01f5073a4b 100644 --- a/src/Symfony/Component/Form/FormTypeExtensionInterface.php +++ b/src/Symfony/Component/Form/FormTypeExtensionInterface.php @@ -63,7 +63,6 @@ public function finishView(FormView $view, FormInterface $form, array $options); * Configures the options for this type. * * @param OptionsResolver $resolver The resolver for the options. - * */ public function configureOptions(OptionsResolver $resolver); diff --git a/src/Symfony/Component/Form/ResolvedFormType.php b/src/Symfony/Component/Form/ResolvedFormType.php index 2bc1b4e7b4e60..02b101d390fa4 100644 --- a/src/Symfony/Component/Form/ResolvedFormType.php +++ b/src/Symfony/Component/Form/ResolvedFormType.php @@ -11,10 +11,8 @@ namespace Symfony\Component\Form; -use Symfony\Component\Form\Exception\InvalidArgumentException; use Symfony\Component\Form\Exception\UnexpectedTypeException; use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Component\Form\Util\StringUtil; use Symfony\Component\OptionsResolver\OptionsResolver; /** diff --git a/src/Symfony/Component/Templating/Loader/CacheLoader.php b/src/Symfony/Component/Templating/Loader/CacheLoader.php index d94e27ce75eb2..85a129a2d4200 100644 --- a/src/Symfony/Component/Templating/Loader/CacheLoader.php +++ b/src/Symfony/Component/Templating/Loader/CacheLoader.php @@ -58,9 +58,6 @@ public function load(TemplateReferenceInterface $template) if (is_file($path)) { if (null !== $this->logger) { $this->logger->debug('Fetching template from cache.', array('name' => $template->get('name'))); - } elseif (null !== $this->debugger) { - // just for BC, to be removed in 3.0 - $this->debugger->log(sprintf('Fetching template "%s" from cache.', $template->get('name'))); } return new FileStorage($path); @@ -80,9 +77,6 @@ public function load(TemplateReferenceInterface $template) if (null !== $this->logger) { $this->logger->debug('Storing template in cache.', array('name' => $template->get('name'))); - } elseif (null !== $this->debugger) { - // just for BC, to be removed in 3.0 - $this->debugger->log(sprintf('Storing template "%s" in cache.', $template->get('name'))); } return new FileStorage($path); diff --git a/src/Symfony/Component/Validator/Constraints/Callback.php b/src/Symfony/Component/Validator/Constraints/Callback.php index c95c34d4c3f21..52be37eeeeff8 100644 --- a/src/Symfony/Component/Validator/Constraints/Callback.php +++ b/src/Symfony/Component/Validator/Constraints/Callback.php @@ -39,9 +39,7 @@ public function __construct($options = null) } if (is_array($options) && !isset($options['callback']) && !isset($options['groups'])) { - if (is_callable($options) || !$options) { - $options = array('callback' => $options); - } + $options = array('callback' => $options); } parent::__construct($options); diff --git a/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php b/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php index 044f7ce91fe0e..81f5643007fd6 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Validator\Context; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Mapping\ClassMetadataInterface; +use Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Mapping\MetadataInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; @@ -267,7 +267,7 @@ public function getValue(); * Returns the metadata for the currently validated value. * * With the core implementation, this method returns a - * {@link Mapping\ClassMetadata} instance if the current value is an object, + * {@link Mapping\ClassMetadataInterface} instance if the current value is an object, * a {@link Mapping\PropertyMetadata} instance if the current value is * the value of a property and a {@link Mapping\GetterMetadata} instance if * the validated value is the result of a getter method. @@ -292,7 +292,7 @@ public function getGroup(); * Returns the class name of the current node. * * If the metadata of the current node does not implement - * {@link ClassMetadataInterface} or if no metadata is available for the + * {@link Mapping\ClassMetadataInterface} or if no metadata is available for the * current node, this method returns null. * * @return string|null The class name or null, if no class name could be found. diff --git a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php index 32df7d159efb7..e7f558f294d26 100644 --- a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php @@ -14,9 +14,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\Constraints\Valid; -use Symfony\Component\Validator\Exception\BadMethodCallException; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\ValidationVisitorInterface; /** * A generic container of {@link Constraint} objects. @@ -115,7 +113,7 @@ public function __clone() * $traverse property of that constraint, the traversal strategy * will be set to one of the following: * - * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled + * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled * - {@link TraversalStrategy::NONE} if $traverse is disabled * * @param Constraint $constraint The constraint to add @@ -139,7 +137,6 @@ public function addConstraint(Constraint $constraint) $this->cascadingStrategy = CascadingStrategy::CASCADE; if ($constraint->traverse) { - // Traverse unless the value is not traversable $this->traversalStrategy = TraversalStrategy::IMPLICIT; } else { $this->traversalStrategy = TraversalStrategy::NONE; diff --git a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php index 084db389284da..edeed3749ee94 100644 --- a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php @@ -13,7 +13,6 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\ValidationVisitorInterface; /** * Stores all metadata needed for validating a class property. diff --git a/src/Symfony/Component/Validator/Mapping/MetadataInterface.php b/src/Symfony/Component/Validator/Mapping/MetadataInterface.php index 70173c434076f..450b83e9a3c30 100644 --- a/src/Symfony/Component/Validator/Mapping/MetadataInterface.php +++ b/src/Symfony/Component/Validator/Mapping/MetadataInterface.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ValidationVisitorInterface; /** * A container for validation metadata. diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index d61471349379b..fc3abd342355f 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -19,7 +19,6 @@ use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Context\ExecutionContextFactory; -use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Mapping\Cache\CacheInterface; use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; diff --git a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php index 5c5ff592236a9..918c8be392dfb 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php +++ b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator; use Doctrine\Common\Annotations\Reader; -use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Mapping\Cache\CacheInterface; use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index 2f72e3387afa8..a5c42e5dda2d2 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -38,6 +38,7 @@ "symfony/yaml": "", "symfony/config": "", "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/property-access": "For using the Expression validator", "symfony/expression-language": "For using the Expression validator" }, "autoload": {