Commit Graph

37969 Commits

Author SHA1 Message Date
Nicolas Grekas 8e9aafc84f bug #35125 [Translator] fix performance issue in MessageCatalogue and catalogue operations (ArtemBrovko)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] fix performance issue in MessageCatalogue and catalogue operations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In our project we use lots of catalogue operations during importing of translations to our system and we ran into performance issue. Code profiler showed lots or `array_replace` calls in  [MessageCatalogue::add](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L128) method. This method is actually called by [MessageCatalogue::set](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/MessageCatalogue.php#L70), which is quite an overkill, because `MessageCatalogue::set` is meant to set only one translation at a time. Method was reworked. `MergeOperation` and `TargetOperation` was reworked as well to use this improved `MessageCatalogue::set` method instead of constructing array with only one translation and passing it to `MessageCatalogue::add` method.

Table shows execution time before and after

|  | Time in seconds (avg. of 10 executions)
----------- | ------
Before | 50
After | 8

Looks like 4.* and 5.* versions can also be improved by the same changes.
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

5179af4796 [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2019-12-31 15:31:48 +01:00
Nicolas Grekas c9767520d5 minor #35141 [Console][FormatterHelper] Use helper strlen statically and remove duplicated code (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][FormatterHelper] Use helper strlen statically and remove duplicated code

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

All those helpers methods are static and are accessed with `self::` everywhere else. They are not an extension point.

Commits
-------

f0d227db2f [Console][FormatterHelper] Use helper strlen statically and remove duplicated code
2019-12-31 15:27:06 +01:00
Thomas Calvet f0d227db2f [Console][FormatterHelper] Use helper strlen statically and remove duplicated code 2019-12-29 18:51:53 +01:00
Artem Brovko 5179af4796 [Translator] Performance improvement in MessageCatalogue and catalogue operations. 2019-12-28 16:59:49 +02:00
Nicolas Grekas 7aba9cf753 minor #35122 [Translation] Add missing use statement (odolbeau)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] Add missing use statement

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

Add missing use for `Data` class used in PHPDoc
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Translation/DataCollector/TranslationDataCollector.php#L64

Commits
-------

6fd266dba6 Add missing use statement
2019-12-28 14:49:39 +01:00
Olivier Dolbeau 6fd266dba6 Add missing use statement 2019-12-27 12:18:21 +01:00
Fabien Potencier cee47cec05 bug #35103 [Translation] Use `locale_parse` for computing fallback locales (alanpoulain)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] Use `locale_parse` for computing fallback locales

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

As done in this PR https://github.com/symfony/symfony/pull/24157 for the `Intl` component, the `Translation` component should use `locale_parse` as well when available.

It will allow to manage [BCP 47](https://tools.ietf.org/html/bcp47) locales, which is why it is considered a bugfix ([locale_set_default](https://www.php.net/manual/en/locale.setdefault.php) is using BCP 47 compliant locale).

As done with the forementioned PR, there is also a fallback to make it work with `-`.

Sadly, I think it will create some conflicts when merging it upstream since the modified code has changed little by little.

Commits
-------

3657c0e664 Use locale_parse for computing fallback locales
2019-12-27 09:11:50 +01:00
Fabien Potencier be40f32798 minor #35016 [Profiler] wording (noniagriconomie)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #35016).

Discussion
----------

[Profiler] wording

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | none
| License       | MIT
| Doc PR        | none

Small wording improvement

Commits
-------

e7c9a28a03 [Profiler] wording
2019-12-27 08:51:10 +01:00
noniagriconomie e7c9a28a03 [Profiler] wording 2019-12-27 08:51:03 +01:00
Nicolas Grekas d6a3138a40 minor #35075 X-Accel Nginx URL updated (shahariaazam)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

X-Accel Nginx URL updated

Obsolete URL has been updated

Commits
-------

4557221597 X-Accel Nginx URL updated
2019-12-26 09:05:47 +01:00
Shaharia Azam 4557221597 X-Accel Nginx URL updated
Obsolete URL has been updated
2019-12-26 09:05:33 +01:00
Nicolas Grekas 0102ff42b6 minor #35064 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale (Islam93)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale

… (Taiwan) ("zh_TW") locale

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30197
| License       | MIT

Hi
This is my first PR to the Symfony project
I saw this issue in issues list with "good first issue" mark and decided to try
I am not a native speaker of Chinese, but I ordered a translation at a translation agency. Hope it should be better than by google translator

Commits
-------

36f07b7e09 ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale
2019-12-26 09:01:29 +01:00
Islam93 36f07b7e09 ticket-30197 [Validator] Add the missing translations for the Chinese (Taiwan) ("zh_TW") locale 2019-12-26 09:01:24 +01:00
Nicolas Grekas 412fcf5463 minor #35056 Fixed test added in #35022 (GrahamCampbell)
This PR was merged into the 3.4 branch.

Discussion
----------

Fixed test added in #35022

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.3, 4.4 or 5.0 for bug fixes <!-- see below -->
| Bug fix?      | yes/no
| New feature?  | yes/no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

6eeec7c270 Fixed test added in #35022
2019-12-26 08:58:50 +01:00
Graham Campbell 6eeec7c270 Fixed test added in #35022 2019-12-26 08:58:28 +01:00
Robin Chalas 1908434f72 bug #35094 [Console] Fix filtering out identical alternatives when there is a command loader (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix filtering out identical alternatives when there is a command loader

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/35089
| License       | MIT
| Doc PR        | -

CommandLoader commands needs to be loaded to resolve their names and filter them.

Commits
-------

589e93e3b7 [Console] Fix filtering out identical alternatives when there is a command loader
2019-12-24 21:01:36 +01:00
Alan Poulain 3657c0e664
Use locale_parse for computing fallback locales 2019-12-24 19:50:33 +01:00
Thomas Calvet 589e93e3b7 [Console] Fix filtering out identical alternatives when there is a command loader 2019-12-24 12:07:31 +01:00
Nicolas Grekas 135c6f7d9d bug #35039 [DI] skip looking for config class when the extension class is anonymous (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] skip looking for config class when the extension class is anonymous

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34613
| License       | MIT
| Doc PR        | -

Commits
-------

1c7eda4649 [DI] skip looking for config class when the extension class is anonymous
2019-12-19 16:52:25 +01:00
Nicolas Grekas 939d3bf1f3 bug #35049 [ProxyManager] fix generating proxies for root-namespaced classes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManager] fix generating proxies for root-namespaced classes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34863
| License       | MIT
| Doc PR        | -

Commits
-------

a47ae10a9d [ProxyManager] fix generating proxies for root-namespaced classes
2019-12-19 16:51:02 +01:00
Nicolas Grekas a47ae10a9d [ProxyManager] fix generating proxies for root-namespaced classes 2019-12-19 15:39:15 +01:00
Nicolas Grekas 1c7eda4649 [DI] skip looking for config class when the extension class is anonymous 2019-12-19 11:27:02 +01:00
Nicolas Grekas f11a282e42 minor #35036 [HttpFoundation] Remove obsolete reference (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Remove obsolete reference

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

5e9fa9d75e Fix typo
2019-12-19 10:53:30 +01:00
Fabien Potencier 5e9fa9d75e Fix typo 2019-12-19 10:48:27 +01:00
Nicolas Grekas b38aad5a39 bug #35022 [Dotenv] FIX missing getenv (mccullagh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] FIX missing getenv

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no>
| Tickets       | Fix #34598
| License       | MIT
| Doc PR        |  -

Revert one line to use getenv because not all environment variables are populated in $_ENV[]

Commits
-------

9c5754acaa [Dotenv] FIX missing getenv
2019-12-18 22:43:02 +01:00
Alexander McCullagh 9c5754acaa [Dotenv] FIX missing getenv 2019-12-18 16:41:13 +01:00
Nicolas Grekas e85acddc9a bug #35010 [VarDumper] ignore failing __debugInfo() (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ignore failing __debugInfo()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34993
| License       | MIT
| Doc PR        | -

Commits
-------

eb2eb76d0e [VarDumper] ignore failing __debugInfo()
2019-12-18 14:29:30 +01:00
Nicolas Grekas b47f1af6c2 minor #35020 [HttpFoundation] use utf8mb4_bin to align code with documentation (bendavies)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] use utf8mb4_bin to align code with documentation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This aligns the code with [the documentation](https://symfony.com/doc/3.4/doctrine/pdo_session_storage.html#mysql), which says to use `utf8mb4` for the character set when using mysql.

Commits
-------

3739ec9f29 use utf8mb4_bin to align code with documentation
2019-12-18 13:05:47 +01:00
Ben Davies 3739ec9f29 use utf8mb4_bin to align code with documentation 2019-12-18 10:25:03 +00:00
Nicolas Grekas eb2eb76d0e [VarDumper] ignore failing __debugInfo() 2019-12-17 16:56:06 +01:00
Nicolas Grekas ae9c41cb16 bug #35000 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33928
| License       | MIT
| Doc PR        | -

Replaces / finishes https://github.com/symfony/symfony/pull/33911

Commits
-------

f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
2019-12-17 11:19:24 +01:00
fancyweb f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
Co-authored-by: Mikhail Fesenko <m.fesenko@corp.vk.com>
2019-12-17 09:06:44 +01:00
Nicolas Grekas 9d0a705981 Ignore deprecations about doctrine/persistence coming from doctrine/orm 2019-12-16 13:38:17 +01:00
Nicolas Grekas cfd4194e20 minor #34990 Use `::class` constants instead of `__NAMESPACE__` when possible (fre5h)
This PR was merged into the 3.4 branch.

Discussion
----------

Use `::class` constants instead of `__NAMESPACE__` when possible

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Related to #34987
| License       | MIT
| Doc PR        | no

Form component has a lot of built-in form types. Some of them were implemented from the very beginning. In most of them there is a such method

```php
    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return __NAMESPACE__.'\TextType';
    }
```

This `getParent()` method was refactored in Symfony 2.8. The upgrade instructions are given here https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form

I think the `__NAMESPACE__.'\TextType';` expression was used because Symfony 2.8 was using `"php": ">=5.3.9"`, and the constant `::class` was added only in PHP 5.5

Now this line can be refactored into
```php
    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return TextType::class;
    }
```

For example new form types, that were added later, already using the `::class` constant.
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/ColorType.php#L23
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/TelType.php#L23

So, in this pull request I propose to refactor all old form types to use `::class` constant. It will give a benefit during the future refactoring, because IDE or static analysers will find all usages of parent class. Unlike the `__NAMESPACE__.'\TextType';` line, which doesn't show the real link to the class for IDE or static analysers, and it could complicate finding all usages of parent class.

Commits
-------

32bf50abca Use `::class` constants instead of `__NAMESPACE__` when possible
2019-12-16 11:55:12 +01:00
Artem Henvald 32bf50abca Use `::class` constants instead of `__NAMESPACE__` when possible 2019-12-16 11:25:54 +01:00
Christian Flothmann a073606ea8 bug #29839 [Validator] fix comparisons with null values at property paths (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] fix comparisons with null values at property paths

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

Commits
-------

ffa5db74c1 fix comparisons with null values at property paths
2019-12-16 09:55:48 +01:00
Robin Chalas ab8841e248 minor #34991 CS for AccessDecisionManager (aschempp)
This PR was merged into the 3.4 branch.

Discussion
----------

CS for AccessDecisionManager

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #34548
| License       | MIT
| Doc PR        | -

As discussed in #34548 with @nicolas-grekas here's a CS change for the `AccessDecisionManager`

Commits
-------

b3742ec493 CS
2019-12-16 00:50:24 +01:00
Andreas Schempp b3742ec493 CS 2019-12-15 22:30:08 +01:00
Fabien Potencier 658c714f77 bug #34900 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] Fixed submitting invalid ids when using queries with limit

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #31559 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | ~
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

09bb1e49d8 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit
2019-12-15 14:49:19 +01:00
Fabien Potencier 8f42a7679d bug #34791 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #34791).

Discussion
----------

[Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

When trying to read from an uninitialized property in PHP 7.4, a `TypeError` is generated, see https://wiki.php.net/rfc/typed_properties_v2#uninitialized_and_unset_properties. This PR fixes the issue.

Commits
-------

1ed8e42d15 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer
2019-12-15 14:47:04 +01:00
Valentin Udaltsov 1ed8e42d15 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer 2019-12-15 14:46:58 +01:00
Fabien Potencier 00c775e271 bug #34915 [FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser (mvorisek)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser

| Q             | A
| ------------- | ---
| Branch?       | 3.4 - <5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | Fix invalid Windows path normalization

All versions of Symfony until 5.0 (which does no longer do extra file path normalization) normalize Windows paths wrongly.

See https://github.com/PrestaShop/PrestaShop/issues/16736 and https://bugs.php.net/bug.php?id=78939

Currently this issue can be observed when Symfony is run by NTS PHP only, but once the PHP issue will be fixed, this issue will probably affects all Windows users when absolute template name is passed to Symfony templating.

Commits
-------

130df8ca8c Fix invalid Windows path normalization
2019-12-15 14:43:43 +01:00
Nicolas Grekas 2ecdc3ac36 minor #34966 [DI] Improve performance of processDefinition (Stefan Kruppa)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Improve performance of processDefinition

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | kind of
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        |

Saves some time during container compilation by instantiating the reflection class only once. In my case this speeds up container compilation in dev mode by ~10% (saves almost 100k calls to `getReflectionClass`).

Tests still run locally and my compiled container was identical pre and post change, but I found this improvement by Blackfire profiling and am not familiar with the surrounding code, so it would be great if someone could doublecheck if the change causes problems.

Commits
-------

41b56eac29 [DI] Improve performance of processDefinition
2019-12-15 11:05:21 +01:00
Nicolas Grekas 28bf18089a minor #34976 Fix regex lookahead syntax in ApplicationTest (guilliamxavier)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix regex lookahead syntax in ApplicationTest

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no (test fix)
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

`(?>!1)` is actually an atomic group for literal `!1`.
`(?!1)` is a negative lookahead assertion for literal `1`.

Commits
-------

cf1d7b2ed1 Fix regex lookahead syntax in ApplicationTest
2019-12-15 10:58:22 +01:00
Nicolas Grekas 2b40bb4f4e bug #34981 stop using deprecated Doctrine persistence classes (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

stop using deprecated Doctrine persistence classes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

4db5f022a1 stop using deprecated Doctrine persistence classes
2019-12-15 10:51:14 +01:00
Christian Flothmann 4db5f022a1 stop using deprecated Doctrine persistence classes 2019-12-15 08:53:25 +01:00
Guilliam Xavier cf1d7b2ed1
Fix regex lookahead syntax in ApplicationTest 2019-12-13 21:47:04 +01:00
Nicolas Grekas 30e6ddf262 minor #34973 [SecurityBundle][FirewallMap] Remove unused property (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle][FirewallMap] Remove unused property

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | -

This property is unused. It was removed in https://github.com/symfony/symfony/pull/22943. It was likely reintroduced in a merge commit. It is still on master.

Commits
-------

0904e57b85 [SecurityBundle][FirewallMap] Remove unused property
2019-12-13 19:28:13 +01:00
Thomas Calvet 0904e57b85 [SecurityBundle][FirewallMap] Remove unused property 2019-12-13 17:57:31 +01:00
Nicolas Grekas e04331657f bug #34904 [Validator][ConstraintValidator] Safe fail on invalid timezones (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator][ConstraintValidator] Safe fail on invalid timezones

Co-authored-by: Scott Dawson <scott@loyaltycorp.com.au>

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33901
| License       | MIT
| Doc PR        |

Alternative to https://github.com/symfony/symfony/pull/33902.

I will explain why I think it is better this way:

1. We set the timezone with the setter because it's 100% safe, it never fails. It fall backs to the default timezone if the provided timezone is not supported (as if we passed null, so the same behavior that always existed). We are therefore compatible with all edge cases.
2. We don't validate the timezone with `\DateTimeZone::listIdentifiers()`. It only returns full identifiers like "Europe/Paris" but it doesn't take into account "numeric" identifiers such as "+08:00" which are perfectly valid. I added a test case to ensure we stay valid with this case. + some invalid identifiers for the native `\IntlDateFormatter` are valid with the polyfill that uses `\DateTimeZone` (eg : `X`). I don't think we can validate anything safely that will work reliably on both implementations.

Commits
-------

3b1b994cb3 [Validator][ConstraintValidator] Safe fail on invalid timezones
2019-12-13 13:34:40 +01:00