Commit Graph

44232 Commits

Author SHA1 Message Date
Tobias Nyholm
20f9a5bbb0
Fixed syntax in comment 2019-12-13 20:25:45 +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
Grégoire Pineau
be2eb6fcc7 [Messenger][AMQP] Use delivery_mode=2 by default 2019-12-13 14:40:46 +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
Stefan Kruppa
41b56eac29 [DI] Improve performance of processDefinition 2019-12-13 12:59:23 +01:00
Nicolas Grekas
96f04d9b32 Fix leftover from doctrine/persistence < 1.3 2019-12-12 16:05:14 +01:00
Nicolas Grekas
72a2aff829 bug #34955 Require doctrine/persistence ^1.3 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Require doctrine/persistence ^1.3

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

This is the only way to remove direct deprecations triggered by doctrine/persistence ^1.3.
Requires v1.3.0 to be tagged before the next bug fix release.
/cc @alcaeus

The only deprecations that remain are triggered by the ORM now.

Commits
-------

ce5dcb96c1 Require doctrine/persistence ^1.3
2019-12-12 15:55:06 +01:00
Nicolas Grekas
ce5dcb96c1 Require doctrine/persistence ^1.3 2019-12-12 15:53:41 +01:00
Nicolas Grekas
80d15cdcf9 Merge branch '3.4' into 4.3
* 3.4:
  Add missing annotation
2019-12-12 14:34:31 +01:00
Nicolas Grekas
4ec093abc8 Add missing annotation 2019-12-12 14:33:51 +01:00
Nicolas Grekas
7d88be8978 Fix merge 2019-12-12 14:16:57 +01:00
Nicolas Grekas
ad4b5fd653 Fix merge 2019-12-12 13:43:22 +01:00
Nicolas Grekas
72936e457f Merge branch '3.4' into 4.3
* 3.4:
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [Translation] fix memoryleak in PhpFileLoader
2019-12-12 13:39:14 +01:00
Nicolas Grekas
cff8b25a5a minor #34949 [DoctrineBridge] try to fix deprecations from doctrine/persistence (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] try to fix deprecations from doctrine/persistence

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

Follows https://github.com/doctrine/persistence/pull/71
But the BC layer is not working yet, as highlighted by the `XXX` in the attached patch.
At least for the corresponding interfaces, doctrine/persistence should always alias the legacy name to the new one.

/cc @greg0ire @alcaeus FYI

Commits
-------

53a4711520 [DoctrineBridge] try to fix deprecations from doctrine/persistence
2019-12-12 13:20:08 +01:00
Nicolas Grekas
53a4711520 [DoctrineBridge] try to fix deprecations from doctrine/persistence 2019-12-12 13:13:32 +01:00
Nicolas Grekas
d294085689 bug #34923 [DI] Fix support for immutable setters in CallTrait (Lctrs)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Fix support for immutable setters in CallTrait

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

Commits
-------

90ace51328 [DI] Add support for immutable setters in CallTrait
2019-12-11 13:26:30 +01:00
Lctrs
90ace51328 [DI] Add support for immutable setters in CallTrait 2019-12-11 13:18:17 +01:00
Fabien Potencier
349ea047e6 bug #34918 [Translation] fix memoryleak in PhpFileLoader (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] fix memoryleak in PhpFileLoader

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

This happens when running the test suite with opcache disabled (as it is the case by default since `opcache.enable_cli=0`).
Doing this "require" in a loop (for each test case) compiles the file at each iteration and doesn't reclaim memory (there is no garbage collector for opcodes).

Commits
-------

5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader
2019-12-11 01:14:09 +01:00
Fabien Potencier
ebadf51543 bug #34920 [Routing] fix memoryleak when loading compiled routes (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix memoryleak when loading compiled routes

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

Same as #34918 for Routing. That's the last significant memory hog I've identified.

Commits
-------

85371a174e [Routing] fix memoryleak when loading compiled routes
2019-12-11 01:13:19 +01:00
Nicolas Grekas
3df1d1efe0 bug #34787 [Cache] Propagate expiry when syncing items in ChainAdapter (trvrnrth)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] Propagate expiry when syncing items in ChainAdapter

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

If a lower adapter provides item metadata, propagate the expiry time when syncing the item to upper ones.

Commits
-------

77138acea6 [Cache] Propagate expiry when syncing items in ChainAdapter
2019-12-10 17:56:02 +01:00
Trevor North
77138acea6 [Cache] Propagate expiry when syncing items in ChainAdapter
If a lower adapter provides item metadata, propagate the expiry time when
syncing the item to upper ones.
2019-12-10 17:45:08 +01:00
Nicolas Grekas
5da657bcf3 Merge branch '3.4' into 4.3
* 3.4:
  Fix CS
2019-12-10 16:11:12 +01:00
Nicolas Grekas
c90cf3301a Fix CS 2019-12-10 16:06:53 +01:00
Nicolas Grekas
85371a174e [Routing] fix memoryleak when loading compiled routes 2019-12-10 15:07:26 +01:00
Michael Voříšek
130df8ca8c Fix invalid Windows path normalization 2019-12-10 14:02:44 +01:00
Nicolas Grekas
5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader 2019-12-10 13:51:10 +01:00
Nicolas Grekas
7f2d9c2b1e Merge branch '3.4' into 4.3
* 3.4:
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [MonologBridge] Fix debug processor datetime type
2019-12-10 11:30:59 +01:00
Nicolas Grekas
5aff4a66f1 bug #34896 [Cache] fix memory leak when using PhpFilesAdapter (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix memory leak when using PhpFilesAdapter

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

Similar to #34839 but for `PhpFilesAdapter`, as the "appendOnly" mode is a v4-only feature.

Commits
-------

0b46226648 [Cache] fix memory leak when using PhpFilesAdapter
2019-12-10 11:24:37 +01:00
Nicolas Grekas
0b46226648 [Cache] fix memory leak when using PhpFilesAdapter 2019-12-10 11:09:22 +01:00
Nicolas Grekas
42712ee006 bug #34438 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given

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

This is really nit-picking: The conservative, safe default for `Cache-Control` is `private, no-cache` which means the response must not be served from cache unless it has been validated.

If `Last-Modified` or `Expires` are present, we can relax `no-cache` to be `must-revalidate`, which means that _once the response has become stale_, it must be revalidated.

An `ETag` alone does not give the response a lifetime, so IMO sticking with `no-cache` in this case would be more consistent.

Commits
-------

1b1002b426 [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
2019-12-10 10:07:44 +01:00
Nicolas Grekas
035d8a3925 bug #34449 [Yaml] Implement multiline string as scalar block for tagged values (natepage)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Yaml] Implement multiline string as scalar block for tagged values

| 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 #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT

At the moment you can parse a tagged value defined as a scalar block. But you can't actually dump a multiline string as scalar block when using a tagged value.

This PR implements the multiline string as scalar block for tagged values as well.

Commits
-------

84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values
2019-12-10 09:51:28 +01:00
natepage
84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values 2019-12-10 09:51:22 +01:00
Matthias Pigulla
1b1002b426 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given 2019-12-10 09:49:31 +01:00
Thomas Calvet
3b1b994cb3 [Validator][ConstraintValidator] Safe fail on invalid timezones
Co-authored-by: Scott Dawson <scott@loyaltycorp.com.au>
2019-12-10 09:48:07 +01:00
Nicolas Grekas
8aefe97a89 bug #34601 [MonologBridge] Fix debug processor datetime type (mRoca)
This PR was merged into the 3.4 branch.

Discussion
----------

[MonologBridge] Fix debug processor datetime type

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

This PR fixes an eventual `Call to a member function getTimestamp() on string` if any Processor transforms the `datetime` value, and uses the same record conditions as in the [ConsoleFormatter](https://github.com/symfony/monolog-bridge/blob/master/Formatter/ConsoleFormatter.php#L118 )

Commits
-------

ffe3f10780 [MonologBridge] Fix debug processor datetime type
2019-12-10 09:37:56 +01:00
Nicolas Grekas
35b1328cc2 minor #34780 [CI] Replace php7.4snapshot with php7.4 in Travis configuration (fre5h)
This PR was merged into the 3.4 branch.

Discussion
----------

[CI] Replace php7.4snapshot with php7.4 in Travis configuration

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

There is a php7.4 already supported on Travis CI. This pull request replaces previous `7.4snapshot` with `7.4` in Travis config.

Commits
-------

4d3b73e688 [CI] Replace php7.4snapshot with php7.4 in Travis configuration
2019-12-10 09:34:02 +01:00
Nicolas Grekas
cd433461cf minor #34723 [FrameworkBundle] Use UserInterface to @return in getUser method (Arman-Hosseini)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Use UserInterface to @return in getUser method

| 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 -->
| License       | MIT
<!--
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
-------

9f1ebd7fb9 [FrameworkBundle] Use UserInterface to @return in getUser method
2019-12-10 09:25:53 +01:00
Arman Hosseini
9f1ebd7fb9 [FrameworkBundle] Use UserInterface to @return in getUser method 2019-12-10 09:25:47 +01:00
Artem Henvald
4d3b73e688 [CI] Replace php7.4snapshot with php7.4 in Travis configuration 2019-12-10 09:22:46 +01:00
Nicolas Grekas
2eacbc5b54 bug #34842 [ExpressionLanguage] Process division by zero (tigr1991)
This PR was merged into the 3.4 branch.

Discussion
----------

[ExpressionLanguage] Process division by zero

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

To be able to catch the error in expression like ` 1 / 0`

**Before PR:**
```
try {
    1 / 0;
} catch (\Throwable $e) {
    // It won't be caught anyway
    // PHP Warning:  Division by zero in...
}

try {
    1 % 0;
} catch (\Throwable $e) {
    // It will be caught since PHP7
    // \DivisionByZeroError with message `Modulo by zero`
}
```
**After PR:**
```
try {
    1 / 0;
} catch (\Throwable $e) {
    // It will be caught
    // \DivisionByZeroError with message `Division by zero`
}

try {
    1 % 0;
} catch (\Throwable $e) {
    // It will be caught
    // \DivisionByZeroError with message `Modulo by zero`
}
```

Commits
-------

02ab72ab30 [ExpressionLanguage][Node][BinaryNode] Process division by zero
2019-12-10 09:19:19 +01:00
Ivan
02ab72ab30 [ExpressionLanguage][Node][BinaryNode] Process division by zero 2019-12-10 09:18:51 +01:00
Nicolas Grekas
429b18e28e minor #34895 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime

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

Since we format the \DateTimeImmutable with the "e" character, it uses this timezone identifier and do not consider the passed one. See https://www.php.net/manual/en/datetime.construct.php:

> The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).

Commits
-------

03dbcf8794 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
2019-12-10 09:11:51 +01:00
Nicolas Grekas
56bfbd8377 bug #34902 [PropertyAccess] forward caught exception (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] forward caught exception

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

Commits
-------

98e18d33df forward caught exception
2019-12-10 09:05:46 +01:00
Jules Pietri
09bb1e49d8 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit 2019-12-09 22:44:57 +01:00
Christian Flothmann
98e18d33df forward caught exception 2019-12-09 21:23:16 +01:00
Christian Flothmann
bf877b811c bug #34888 [TwigBundle] add tags before processing them (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] add tags before processing them

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

Commits
-------

e1145a78b5 add tags before processing them
2019-12-09 17:39:04 +01:00
Maxime Steinhausser
8eb29a7b73 [FrameworkBundle] Add info & example to auto_mapping config 2019-12-09 15:21:32 +01:00
Thomas Calvet
03dbcf8794 [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime 2019-12-09 14:42:15 +01:00
Christian Flothmann
e1145a78b5 add tags before processing them 2019-12-09 10:36:27 +01:00