Commit Graph

21604 Commits

Author SHA1 Message Date
Nicolas Grekas
e23eb56ffe [Locale] Fix Intl requirement 2015-08-01 18:50:08 +02:00
Fabien Potencier
a4100f95e7 bug #13828 [Validator] Improve Iban Validation (afurculita)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Improve Iban Validation

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/13802
| License       | MIT
| Doc PR        |

This PR adds 2 more checks for better IBAN validation: the validation of the country code (represented by the first 2 letters) and the format validation according to the country format regex based on http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf.

Commits
-------

07b38de Better Iban Validation
2015-08-01 14:02:04 +02:00
Nicolas Grekas
07fb308225 [Locale] Add missing @group legacy annotations 2015-08-01 11:35:48 +02:00
Alexandru Furculita
07b38dea1f Better Iban Validation
Added more country-based tests, added new error type

The error type `NOT_SUPPORTED_COUNTRY_CODE_ERROR` has been added for the
IBANs from unsupported countries, for which we don't have defined a
format. We will not check anymore if a country code against the Intl
component.
The tests have been completed with more tests for each contry we have
formats defined.

The  4 character length check and the case check has been removed. The message code constants

`TOO_SHORT_ERROR` and `INVALID_CASE_ERROR` has been deprecated
2015-08-01 12:20:04 +03:00
Nicolas Grekas
3d7d378cbc Merge branch '2.3' into 2.7
* 2.3:
  Fix security-acl deps
  Fix doctrine mapping validation type error
  Remove skipping of tests based on ICU data version whenever possible
  Fix the handling of null as locale in the stub intl classes
  do not dump leading backslashes in class names
  Skip ::class constant
  [Config] type specific check for emptiness

Conflicts:
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php
	src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php
	src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
	src/Symfony/Component/Locale/Tests/LocaleTest.php
	src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php
	src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
2015-08-01 11:05:17 +02:00
Nicolas Grekas
1270e72560 Fix security-acl deps 2015-08-01 10:11:30 +02:00
Fabien Potencier
2966cd2b89 minor #15412 Remove skipping of tests based on ICU data version whenever possible (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Remove skipping of tests based on ICU data version whenever possible

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Many tests being skipped based on the ICU data version don't actually need it. They might be testing code paths not relying on Intl, or not performing assertions on the values depending on the ICU data and so not dependant on the exact ICU version being used.

this is somewhat related to https://github.com/symfony/symfony/issues/14259 as it allows to reduce the number of tests not running on Travis.

Commits
-------

7994513 Remove skipping of tests based on ICU data version whenever possible
2015-08-01 09:51:56 +02:00
Fabien Potencier
f1fa4238b7 bug #15380 do not dump leading backslashes in class names (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

do not dump leading backslashes in class names

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15001
| License       | MIT
| Doc PR        |

Commits
-------

ad6cb10 do not dump leading backslashes in class names
2015-08-01 09:45:23 +02:00
Fabien Potencier
3b6d2a3fa3 bug #15376 [ClassMapGenerator] Skip ::class constant (WouterJ)
This PR was merged into the 2.3 branch.

Discussion
----------

[ClassMapGenerator] Skip ::class constant

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15351
| License       | MIT
| Doc PR        | -

Commits
-------

a336f0e Skip ::class constant
2015-08-01 09:35:45 +02:00
Fabien Potencier
4c649dcb26 bug #15389 [securityBundle] Compare roles strictly when computing inherited roles (bokonet)
This PR was merged into the 2.7 branch.

Discussion
----------

[securityBundle] Compare roles strictly when computing inherited roles

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15377
| License       | MIT
| Doc PR        |

Commits
-------

5179acc fix issue #15377
2015-08-01 08:58:26 +02:00
Fabien Potencier
9293c439a5 bug #15170 [Config] type specific check for emptiness (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Config] type specific check for emptiness

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13736
| License       | MIT
| Doc PR        |

Commits
-------

0199fbf [Config] type specific check for emptiness
2015-08-01 08:17:42 +02:00
Fabien Potencier
85c10991d3 bug #15411 Fix the handling of null as locale in the stub intl classes (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix the handling of null as locale in the stub intl classes

The Intl extension accepts null as locale in formatters and the collator and will use the default locale in such case. Given that the stub implementation considers that the default locale is always 'en', it should be supported here too instead of forcing libraries to pass the default locale explicitly. For instance, ``Twig_Extensions_Extension_Intl`` relies on the fact that ``null`` as locale uses the default one: https://github.com/twigphp/Twig-extensions/pull/94

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony-demo/pull/123
| License       | MIT
| Doc PR        | n/a

Commits
-------

d6db6ad Fix the handling of null as locale in the stub intl classes
2015-08-01 08:11:19 +02:00
Fabien Potencier
79b5baf42f minor #15420 Fix doctrine mapping validation type error (luxifer)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix doctrine mapping validation type error

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The error tell to implement the service `doctrine.orm.<em_name>.metadata_driver`, but this extensions check for the existence of the `doctrine.orm.<em_name>_metadata_driver` where `<em_name>` the entity manager name.

Commits
-------

2c9b1db Fix doctrine mapping validation type error
2015-08-01 08:04:58 +02:00
Fabien Potencier
9058904d2b minor #15417 [Debug] cleanup ExceptionHandlerTest (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] cleanup ExceptionHandlerTest

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

51bacc6 [Debug] cleanup ExceptionHandlerTest
2015-08-01 07:54:51 +02:00
Nicolas Grekas
51bacc6d41 [Debug] cleanup ExceptionHandlerTest 2015-07-31 17:18:52 +02:00
Fabien Potencier
15d6b8aceb bumped Symfony version to 2.7.4 2015-07-31 15:51:28 +02:00
Fabien Potencier
a9af4708b4 updated VERSION for 2.7.3 2015-07-31 15:24:45 +02:00
Fabien Potencier
cdda482a3d updated CHANGELOG for 2.7.3 2015-07-31 15:24:38 +02:00
Fabien Potencier
c7ca0b3629 Merge branch '2.3' into 2.7
* 2.3:
  Fix the return value on error for intl methods returning arrays
2015-07-31 15:24:29 +02:00
Florent Viel
2c9b1db05a Fix doctrine mapping validation type error
The error tell to implement the service `doctrine.orm.<em_name>.metadata_driver`, but this extensions check for the existence of the `doctrine.orm.<em_name>_metadata_driver` where `<em_name>` the entity manager name.
2015-07-31 15:18:55 +02:00
Fabien Potencier
8d025cbc91 fixed typo in translation keys 2015-07-31 08:49:15 +02:00
Christophe Coevoet
7994513e04 Remove skipping of tests based on ICU data version whenever possible
Many tests being skipped based on the ICU data version don't actually
need it. They might be testing code paths not relying on Intl, or not
performing assertions on the values depending on the ICU data and so not
dependant on the exact ICU version being used.
2015-07-30 18:05:29 +02:00
Fabien Potencier
0fd11d9631 bug #15413 Fix the return value on error for intl methods returning arrays (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix the return value on error for intl methods returning arrays

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

When the resource is missing, an empty array should be returned rather than null to respect the interface saying an array is always returned.

Commits
-------

801e5e2 Fix the return value on error for intl methods returning arrays
2015-07-30 17:28:54 +02:00
Christophe Coevoet
801e5e2805 Fix the return value on error for intl methods returning arrays
When the resource is missing, an empty array should be returned rather
than null to respect the interface saying an array is always returned.
2015-07-30 16:28:34 +02:00
Christophe Coevoet
d6db6ad7f7 Fix the handling of null as locale in the stub intl classes
The Intl extension accepts null as locale in formatters and the
collator and will use the default locale in such case. Given that the
stub implementation considers that the default locale is always 'en', it
should be supported here too instead of forcing libraries to pass the
default locale explicitly.
2015-07-30 14:20:01 +02:00
Nicolas Grekas
bf8a923199 Merge branch '2.3' into 2.7
* 2.3:
  Fix merge
  Fix missing _route parameter notice in RouterListener logging case

Conflicts:
	src/Symfony/Component/HttpKernel/EventListener/RouterListener.php
2015-07-30 09:39:20 +02:00
Nicolas Grekas
6b02601e7b Fix merge 2015-07-30 09:37:09 +02:00
Fabien Potencier
004c1fdf2a bug #15392 Fix missing _route parameter notice in RouterListener logging case (Haehnchen)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #15392).

Discussion
----------

Fix missing _route parameter notice in RouterListener logging case

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | na
| License       | MIT
| Doc PR        | na

`\Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest` missed test cases in logging condition. So if we provide routing matches without a `_route` parameter `notice` messages are thrown. In this case i added a check and use `n/a` for empty route names as this is also shown in profiler if it not exists.

Commits
-------

0ce91a6 Fix missing _route parameter notice in RouterListener logging case
2015-07-29 09:47:07 +02:00
Daniel Espendiller
0ce91a6019 Fix missing _route parameter notice in RouterListener logging case 2015-07-29 09:46:44 +02:00
Fabien Potencier
342c4b5fd1 bug #15390 [php7] Fix for substr() always returning a string (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[php7] Fix for substr() always returning a string

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14086
| License       | MIT
| Doc PR        | -

The remaining failures will stop once https://bugs.php.net/bug.php?id=70159 is fixed ([patch pending](a28115ccdb)).

Commits
-------

d6dfe98 [php7] Fix for substr() always returning a string
2015-07-29 08:44:12 +02:00
Christian Flothmann
ad6cb10e63 do not dump leading backslashes in class names 2015-07-28 20:25:33 +02:00
Nicolas Grekas
d6dfe9871c [php7] Fix for substr() always returning a string 2015-07-28 17:18:12 +02:00
bokonet
5179acc29b fix issue #15377 2015-07-28 16:52:34 +02:00
Nicolas Grekas
c37387dc02 Merge branch '2.3' into 2.7
* 2.3:
  [php7] Fix for substr() always returning a string
  [Security] Do not save the target path in the session for a stateless firewall
  [DependencyInjection] fixed FrozenParameterBag and improved Parameter…

Conflicts:
	src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
	src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
2015-07-28 16:07:07 +02:00
Fabien Potencier
ccf52ecd6e bug #15386 [php7] Fix for substr() always returning a string (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[php7] Fix for substr() always returning a string

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14086
| License       | MIT
| Doc PR        | -

This should be the last required fix for PHP7 support.

The patch in the debug component is a workaround for a bug in PHP7 (http://3v4l.org/8rm9B) that is going to be fixed soon (@jpauli power).

Commits
-------

77ee866 [php7] Fix for substr() always returning a string
2015-07-28 15:07:31 +02:00
Nicolas Grekas
77ee866dd8 [php7] Fix for substr() always returning a string 2015-07-28 14:38:40 +02:00
WouterJ
a336f0e98e Skip ::class constant 2015-07-27 20:12:35 +02:00
Fabien Potencier
633d0d835c bug #15355 [Security] Do not save the target path in the session for a stateless firewall (lyrixx)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15355).

Discussion
----------

[Security] Do not save the target path in the session for a stateless firewall

| Q             | A
| ------------- | ---
| Bug fix?      | partially
| New feature?  | partially
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | -
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Note: I think this PR can be merged into 2.3 because it's like a bug fix

Commits
-------

3358253 [Security] Do not save the target path in the session for a stateless firewall
2015-07-26 20:14:14 +02:00
Grégoire Pineau
335825363d [Security] Do not save the target path in the session for a stateless firewall 2015-07-26 20:14:09 +02:00
Fabien Potencier
0252e4e2e4 bug #15306 [HttpKernel] [HttpCache] Fix deprecated error in HttpCache#getSurrogate (m14t)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #15306).

Discussion
----------

[HttpKernel] [HttpCache] Fix deprecated error in HttpCache#getSurrogate

| Q             | A
| ------------- | ---
| Bug fix?      | yes? - I could not find an open issue, but it does appear to be a but to throw a `E_USER_DEPRECATED` when calling a non-depreciated method.
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no - but related to
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Currently calls to `HttpCache#getEsi` correctly trigger a `E_USER_DEPRECATED` error and inform the user that they should instead use `HttpCache#getSurrogate`.

Unfortunately `HttpCache#getSurrogate` currently calls `$this->getEsi();` which will result in the `E_USER_DEPRECATED` still being triggered.

This pull request simply moves the logic that was previously in `getEsi` to `getSurrogate`, and leaves `getEsi` as a wrapper around `getSurrogate` with the addition of also triggering this warning.

This pull request also effects the 2.7 branch.

Commits
-------

32d964b Fix calls to HttpCache#getSurrogate triggering E_USER_DEPRECATED errors.
2015-07-26 20:11:56 +02:00
Matt Farmer
32d964ba39 Fix calls to HttpCache#getSurrogate triggering E_USER_DEPRECATED errors. 2015-07-26 20:11:55 +02:00
Fabien Potencier
f1ebfd7b47 minor #15172 [DependencyInjection] fixed FrozenParameterBag and improved Parameter… (Tomaz Ahlin)
This PR was squashed before being merged into the 2.3 branch (closes #15172).

Discussion
----------

[DependencyInjection] fixed FrozenParameterBag and improved Parameter…

The ParameterBagInterface was missing some @throws annotations, so the FrozenParameterBag class was a violation of Liskov subtitution principle. Also the ParameterBagInterface was missing the remove method.

(Optionally the ParameterBagInterface can be later split into two smaller interfaces, because the FrozenParameterBag shouldn't have the add, remove methods in the first place.)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

I have also fixed removing elements from FrozenParameterBag, as introduced by @satahippy
https://github.com/symfony/DependencyInjection/pull/8

Commits
-------

3ad0794 [DependencyInjection] fixed FrozenParameterBag and improved Parameter…
2015-07-26 20:10:55 +02:00
Tomaz Ahlin
3ad0794aa1 [DependencyInjection] fixed FrozenParameterBag and improved Parameter… 2015-07-26 20:10:26 +02:00
Fabien Potencier
cd8ccffbad Merge branch '2.6' into 2.7
* 2.6:
  [Yaml] throw a ParseException on invalid data type
  #15331 add infos about deprecated classes to UPGRADE-3.0
  [Security] removed useless else condition in SwitchUserListener class.
  [travis] Tests deps=low with PHP 5.6
  [Console] Fix console output with closed stdout
2015-07-26 11:08:49 +02:00
Fabien Potencier
939c305374 Merge branch '2.3' into 2.6
* 2.3:
  #15331 add infos about deprecated classes to UPGRADE-3.0
  [Security] removed useless else condition in SwitchUserListener class.
  [travis] Tests deps=low with PHP 5.6
  [Console] Fix console output with closed stdout
2015-07-26 11:08:40 +02:00
Fabien Potencier
9943fd1b64 minor #15332 [travis] Tests deps=low with PHP 5.6 (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Tests deps=low with PHP 5.6

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I noticed that testing deps=low with the lowest supported PHP skips some tests/features.
I propose to merge the 5.6 and deps=low lines of the test matrix in order to both fix this issue and remove one line in the matrix (thus making tests a bit lighter/faster on travis).

Commits
-------

d3874ec [travis] Tests deps=low with PHP 5.6
2015-07-26 11:04:17 +02:00
Fabien Potencier
0198784c58 minor #15357 #15331 add infos about deprecated classes to UPGRADE-3.0 (vincentaubert)
This PR was merged into the 2.3 branch.

Discussion
----------

#15331 add infos about deprecated classes to UPGRADE-3.0

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15331
| License       | MIT
| Doc PR        |

Commits
-------

e391446 #15331 add infos about deprecated classes to UPGRADE-3.0
2015-07-26 11:02:50 +02:00
Fabien Potencier
6bb0c4898e bug #15369 [TwigBridge] type-dependent path discovery (marcosdsanchez, xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] type-dependent path discovery

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15340
| License       | MIT
| Doc PR        |

With the introduction of the `AbstractFileExtractor` in Symfony 2.7, the
`extract()` method in the `TwigExtractor` class does not necessarily
deal with `SplFileInfo` instances from the Finder component, but also
receives `\SplFileInfo` objects initialized by the base extractor class.

Commits
-------

1e15761 [TwigBridge] type-dependent path discovery
2bf78e5 Resources as string have the same problem
aa7cbbd Introduce failing test case when a SplFileInfo object is passed to the extract() method in the TwigExtractor.
2015-07-26 11:01:14 +02:00
Fabien Potencier
e338281601 bug #15361 [Yaml] throw a ParseException on invalid data type (xabbuh)
This PR was submitted for the 2.8 branch but it was merged into the 2.6 branch instead (closes #15361).

Discussion
----------

[Yaml] throw a ParseException on invalid data type

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15234
| License       | MIT
| Doc PR        |

Without this check, PHP would trigger a warning when an array was passed
to `trim()`. The parser must throw a `ParseException` instance on a
malformed YAML string instead.

Commits
-------

adc6b30 [Yaml] throw a ParseException on invalid data type
2015-07-26 10:59:42 +02:00
Christian Flothmann
adc6b3067d [Yaml] throw a ParseException on invalid data type
Without this check, PHP would trigger a warning when an array was passed
to `trim()`. The parser must throw a `ParseException` instance on a
malformed YAML string instead.
2015-07-26 10:59:42 +02:00