This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Locale
Fabien Potencier 165b08986b merged branch mrtorrent/use_parse_error_code_in_stubnumberformatter (PR #2521)
Commits
-------

89cd64a Set error code when number cannot be parsed. Fixes #2389

Discussion
----------

Set error code when number cannot be parsed in StubNumberFormatter

The stub implementation of NumberFormatter never sets an error code and instead always returns the "no-error" code. This causes unexpected results when a transformer gives it bad arguments, such as transforming the input value to boolean false and causing exceptions further down the line, as in #2389.

Instead, it should set an error code when appropriate and return it when requested so that a TransformationFailedException can be raised and the input value left unaltered.

There may be other instances where an error should be set. This covers the common use case of non-numeric input.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389
2011-11-02 14:36:52 +01:00
..
Exception [Phpdoc] Cleaning/fixing 2011-04-23 15:18:47 +00:00
Resources [Locale] fixed CS 2011-06-24 01:49:48 +02:00
Stub Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
composer.json bumped Symfony version to 2.0.6-DEV 2011-11-02 14:18:45 +01:00
LICENSE added LICENSE files for the subtree repositories 2011-02-22 18:58:15 +01:00
Locale.php fixed CS 2011-06-08 12:16:48 +02:00