symfony/.git
3 months agoAlias master to dev-master in composer.json master
Fabien Potencier [Tue, 6 Oct 2020 14:44:56 +0000 (16:44 +0200)]
Alias master to dev-master in composer.json

3 months agoRemove branch aliases in composer.json
Fabien Potencier [Tue, 6 Oct 2020 09:56:52 +0000 (11:56 +0200)]
Remove branch aliases in composer.json

3 months agoRemove branch alias
Fabien Potencier [Tue, 6 Oct 2020 08:18:00 +0000 (10:18 +0200)]
Remove branch alias

3 months agoMerge branch '5.1' into 5.x
Fabien Potencier [Tue, 6 Oct 2020 08:08:38 +0000 (10:08 +0200)]
Merge branch '5.1' into 5.x

* 5.1:
  Move to the new default 5.x branch
  Use PHPUnit 9.4 to run the test suite.
  Fix type annotation

3 months agoMerge branch '4.4' into 5.1
Fabien Potencier [Tue, 6 Oct 2020 08:08:25 +0000 (10:08 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  Move to the new default 5.x branch
  Use PHPUnit 9.4 to run the test suite.
  Fix type annotation

3 months agoMerge branch '3.4' into 4.4
Fabien Potencier [Tue, 6 Oct 2020 08:07:23 +0000 (10:07 +0200)]
Merge branch '3.4' into 4.4

* 3.4:
  Move to the new default 5.x branch
  Use PHPUnit 9.4 to run the test suite.
  Fix type annotation

3 months agominor #38425 Move to the new default 5.x branch (fabpot)
Fabien Potencier [Tue, 6 Oct 2020 08:06:52 +0000 (10:06 +0200)]
minor #38425 Move to the new default 5.x branch (fabpot)

This PR was merged into the 3.4 branch.

Discussion
----------

Move to the new default 5.x branch

| 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 #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

25e5fa6611 Move to the new default 5.x branch

3 months agoMove to the new default 5.x branch
Fabien Potencier [Tue, 6 Oct 2020 07:11:09 +0000 (09:11 +0200)]
Move to the new default 5.x branch

3 months agofeature #38393 [FrameworkBundle] Add option --as-tree to translation:update command...
Fabien Potencier [Tue, 6 Oct 2020 05:39:06 +0000 (07:39 +0200)]
feature #38393 [FrameworkBundle] Add option --as-tree to translation:update command (jschaedl)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] Add option --as-tree to translation:update command

| Q             | A
| ------------- | ---
| Branch?       | master<!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #38344  <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | tbd. <!-- required for new features -->

Before:

```
$ bin/console translation:update --domain messages --output-format=yml --force en

# messages.yaml
app.backend.title: __app.backend.title
app.backend.content: __app.backend.content
```

After:

```
$ bin/console translation:update --domain messages --output-format=yml --force --as-tree=3 en

# messages.yaml
app:
    backend:
        title: __app.backend.title
        content: __app.backend.content
```

Commits
-------

62cb77a6cd [FrameworkBundle] Add option --as-tree to translation:update command

3 months ago[FrameworkBundle] Add option --as-tree to translation:update command
Jan Schädlich [Sat, 3 Oct 2020 10:49:09 +0000 (12:49 +0200)]
[FrameworkBundle] Add option --as-tree to translation:update command

3 months agobug #38419 [DoctrineBridge] fix and replace namespace to Uid (maxhelias)
Fabien Potencier [Tue, 6 Oct 2020 05:35:17 +0000 (07:35 +0200)]
bug #38419 [DoctrineBridge] fix and replace namespace to Uid (maxhelias)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[DoctrineBridge] fix and replace namespace to Uid

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | https://github.com/symfony/symfony/pull/37678#discussion_r499709057 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | ... <!-- required for new features -->

This post should also be corrected: https://symfony.com/blog/new-in-symfony-5-2-doctrine-types-for-uuid-and-ulid cc @javiereguiluz

Commits
-------

28d1169714 [DoctrineBridge] fix and replace namespace to Uid

3 months agofeature #38410 [Validator] Migrate File and Image constraints to attributes (derrabus)
Fabien Potencier [Tue, 6 Oct 2020 05:32:58 +0000 (07:32 +0200)]
feature #38410 [Validator] Migrate File and Image constraints to attributes (derrabus)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Validator] Migrate File and Image constraints to attributes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #38096
| License       | MIT
| Doc PR        | TODO with symfony/symfony-docs#14305

I have migrated a lot of the constraints already and am preparing a big PR with them at the moment. I decided to pull this part out because it might raise some discussion.

This PR enables the `File` and `Image` constraints to be used as attributes. Especially the constructor signature of the `Image` constraint has grown pretty large this way. This by itself should be a big problem, if we don't expect the constructor to be called with ordered parameters by userland code. But it shows that the constraints have grown a bit too large. We might want to consider to split it.

Commits
-------

d8c186938e [Validator] Migrate File and Image constraints to attributes.

3 months ago[DoctrineBridge] fix and replace namespace to Uid
Maxime Hélias [Mon, 5 Oct 2020 16:19:36 +0000 (18:19 +0200)]
[DoctrineBridge] fix and replace namespace to Uid

3 months agobug #38418 [HttpClient] minor fixes in RetryableHttpClient (nicolas-grekas)
Fabien Potencier [Mon, 5 Oct 2020 17:15:39 +0000 (19:15 +0200)]
bug #38418 [HttpClient] minor fixes in RetryableHttpClient (nicolas-grekas)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] minor fixes in RetryableHttpClient

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

Commits
-------

495562836a [HttpClient] minor fixes in RetryableHttpClient

3 months agofeature #38253 [Cache] Allow ISO 8601 time intervals to specify default lifetime...
Fabien Potencier [Mon, 5 Oct 2020 17:14:35 +0000 (19:14 +0200)]
feature #38253 [Cache] Allow ISO 8601 time intervals to specify default lifetime (lstrojny)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Cache] Allow ISO 8601 time intervals to specify default lifetime

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

`Psr\Cache\CacheItemInterface::expiresAfter()` takes `DateInterval` for expiration but Symfony’s cache config only takes an integer. Time intervals are a bit better to read so this adds the capability.

Commits
-------

a2508ac3e7 [Cache] Allow ISO 8601 time intervals to specify default lifetime

3 months ago[HttpClient] minor fixes in RetryableHttpClient
Nicolas Grekas [Mon, 5 Oct 2020 15:52:56 +0000 (17:52 +0200)]
[HttpClient] minor fixes in RetryableHttpClient

3 months agoBump Symfony version to 5.2.0
Fabien Potencier [Mon, 5 Oct 2020 14:44:01 +0000 (16:44 +0200)]
Bump Symfony version to 5.2.0

3 months agoMerge pull request #38417 from fabpot/release-5.2.0-BETA1 v5.2.0-BETA1
Fabien Potencier [Mon, 5 Oct 2020 14:37:17 +0000 (16:37 +0200)]
Merge pull request #38417 from fabpot/release-5.2.0-BETA1

released v5.2.0-BETA1

3 months agoUpdate VERSION for 5.2.0-BETA1
Fabien Potencier [Mon, 5 Oct 2020 14:36:53 +0000 (16:36 +0200)]
Update VERSION for 5.2.0-BETA1

3 months agoUpdate CHANGELOG for 5.2.0-BETA1
Fabien Potencier [Mon, 5 Oct 2020 14:36:41 +0000 (16:36 +0200)]
Update CHANGELOG for 5.2.0-BETA1

3 months ago[Cache] Allow ISO 8601 time intervals to specify default lifetime
Lars Strojny [Mon, 21 Sep 2020 08:53:55 +0000 (10:53 +0200)]
[Cache] Allow ISO 8601 time intervals to specify default lifetime

3 months agominor #38413 [HttpClient] change piority of RetryableHttpClient (jderusse)
Nicolas Grekas [Mon, 5 Oct 2020 08:23:57 +0000 (10:23 +0200)]
minor #38413 [HttpClient] change piority of RetryableHttpClient (jderusse)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] change piority of RetryableHttpClient

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

This make the RetryableHttpClient decorated the TraceableHttpClient.
User will be able to check content of each sub-request

Commits
-------

9568d437f9 Change priority of RetryableHttpClient

3 months agoChange priority of RetryableHttpClient
Jérémy Derussé [Sun, 4 Oct 2020 20:31:30 +0000 (22:31 +0200)]
Change priority of RetryableHttpClient

3 months agominor #38411 Use PHPUnit 9.4 to run the test suite (derrabus)
Fabien Potencier [Mon, 5 Oct 2020 06:28:29 +0000 (08:28 +0200)]
minor #38411 Use PHPUnit 9.4 to run the test suite (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

Use PHPUnit 9.4 to run the test suite

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

Commits
-------

de6a852b46 Use PHPUnit 9.4 to run the test suite.

3 months agoUse PHPUnit 9.4 to run the test suite.
Alexander M. Turek [Sun, 4 Oct 2020 19:57:32 +0000 (21:57 +0200)]
Use PHPUnit 9.4 to run the test suite.

3 months ago[Validator] Migrate File and Image constraints to attributes.
Alexander M. Turek [Sun, 4 Oct 2020 18:20:54 +0000 (20:20 +0200)]
[Validator] Migrate File and Image constraints to attributes.

3 months agominor #38408 Fix type annotation in ExpressionLanguage\Token (m-vo)
Fabien Potencier [Sun, 4 Oct 2020 16:40:24 +0000 (18:40 +0200)]
minor #38408 Fix type annotation in ExpressionLanguage\Token (m-vo)

This PR was merged into the 3.4 branch.

Discussion
----------

Fix type annotation in ExpressionLanguage\Token

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

The expected argument `$type` should be a string - the strict comparison would always fail with the current annotated types (`array|int`).

See the constructor + constants for reference:
https://github.com/symfony/symfony/blob/7db7dcc431cfafff38123e835ca6754980f5dab6/src/Symfony/Component/ExpressionLanguage/Token.php#L33

https://github.com/symfony/symfony/blob/7db7dcc431cfafff38123e835ca6754980f5dab6/src/Symfony/Component/ExpressionLanguage/Token.php#L25-L30

Commits
-------

bfde15b728 Fix type annotation

3 months agoMerge branch '5.1'
Fabien Potencier [Sun, 4 Oct 2020 16:36:01 +0000 (18:36 +0200)]
Merge branch '5.1'

* 5.1:
  Change test

3 months agoMerge branch '4.4' into 5.1
Fabien Potencier [Sun, 4 Oct 2020 16:35:53 +0000 (18:35 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  Change test

3 months agoMerge branch '3.4' into 4.4
Fabien Potencier [Sun, 4 Oct 2020 16:35:43 +0000 (18:35 +0200)]
Merge branch '3.4' into 4.4

* 3.4:
  Change test

3 months agoChange test
Fabien Potencier [Sun, 4 Oct 2020 16:34:28 +0000 (18:34 +0200)]
Change test

3 months agoMerge branch '5.1'
Fabien Potencier [Sun, 4 Oct 2020 16:29:51 +0000 (18:29 +0200)]
Merge branch '5.1'

* 5.1:
  Added Stopwatch example to the README
  Bump Symfony version to 5.1.8
  Update VERSION for 5.1.7
  Update CHANGELOG for 5.1.7
  Bump Symfony version to 4.4.16
  Update VERSION for 4.4.15
  Update CHANGELOG for 4.4.15

3 months agoMerge branch '4.4' into 5.1
Fabien Potencier [Sun, 4 Oct 2020 16:29:28 +0000 (18:29 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  Added Stopwatch example to the README
  Bump Symfony version to 4.4.16
  Update VERSION for 4.4.15
  Update CHANGELOG for 4.4.15

3 months agominor #38409 [Stopwatch] Added example to the README (wouterj)
Fabien Potencier [Sun, 4 Oct 2020 15:43:30 +0000 (17:43 +0200)]
minor #38409 [Stopwatch] Added example to the README (wouterj)

This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Added example to the README

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14333

Commits
-------

e2461c90d2 Added Stopwatch example to the README

3 months agoAdded Stopwatch example to the README
Wouter de Jong [Sun, 4 Oct 2020 12:01:13 +0000 (14:01 +0200)]
Added Stopwatch example to the README

3 months agoFix type annotation
M. Vondano [Sun, 4 Oct 2020 10:25:24 +0000 (12:25 +0200)]
Fix type annotation

3 months agofeature #38382 [Validator] Use comparison constraints as attributes (derrabus)
Fabien Potencier [Sun, 4 Oct 2020 08:54:16 +0000 (10:54 +0200)]
feature #38382 [Validator] Use comparison constraints as attributes (derrabus)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Validator] Use comparison constraints as attributes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | #38096
| License       | MIT
| Doc PR        | TODO, let's add it to symfony/symfony-docs#14305

This PR enables all child classes of `AbstractComparison` to be used as attributes.

Some of those constraints used a trait called `NumberConstraintTrait` for a shared implementation. After my changes, that trait did not fit well anymore, so I've added a new `ZeroComparisonConstraintTrait` as a replacement. Although I don't expect `NumberConstraintTrait` to provide much value outside of the Symfony codebase, I think we cannot safely change it because it was not labelled as `@internal`. This is basically why I went for the deprecation.

Commits
-------

b5bdf8288f [Validator] Use comparison constraints as attributes.

3 months agofeature #38369 [HttpFoundation] Expired cookies string representation consistency...
Fabien Potencier [Sun, 4 Oct 2020 08:45:41 +0000 (10:45 +0200)]
feature #38369 [HttpFoundation] Expired cookies string representation consistency & tests (iquito)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Expired cookies string representation consistency & tests

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

These changes add consistent behavior when converting expired cookies back and forth from string representation into `Symfony\Component\HttpFoundation\Cookie` instances in `Cookie::fromString`:

- When `Max-Age` is zero and `expires` is in the past, the `expires` date is kept as is (previous behavior: `expires` is overwritten with current timestamp because it is reset to current timestamp + `Max-Age`)
- When `Max-Age` is zero and `expires` is in the future, expires is reset to current timestamp, as `Max-Age` is the preferred "source of truth" (same as previous behavior)
- Add tests for how the Cookie class handles `Max-Age` in a cookie string and how `expires` and `Max-Age` interact
- Extract helper function `expiresTimestamp` so converting to a unix timestamp can be reused in `Cookie::fromString`

This is more a new feature than a bug fix in my mind, therefore I would include it in 5.1+.

Commits
-------

4f5d5eceb0 [HttpFoundation] Expired cookies string representation consistency & tests

3 months ago[HttpFoundation] Expired cookies string representation consistency & tests
Andreas [Thu, 1 Oct 2020 11:38:00 +0000 (13:38 +0200)]
[HttpFoundation] Expired cookies string representation consistency & tests

3 months agofeature #38407 [Mime] Prefer .jpg instead of .jpeg (fabpot)
Fabien Potencier [Sun, 4 Oct 2020 08:37:55 +0000 (10:37 +0200)]
feature #38407 [Mime] Prefer .jpg instead of .jpeg (fabpot)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Mime] Prefer .jpg instead of .jpeg

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #38364 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        |

Commits
-------

89adb2133b [Mime] Prefer .jpg instead of .jpeg

3 months ago[Mime] Prefer .jpg instead of .jpeg
Fabien Potencier [Sun, 4 Oct 2020 08:29:39 +0000 (10:29 +0200)]
[Mime] Prefer .jpg instead of .jpeg

3 months agoBump Symfony version to 5.1.8
Fabien Potencier [Sun, 4 Oct 2020 08:00:52 +0000 (10:00 +0200)]
Bump Symfony version to 5.1.8

3 months agoMerge pull request #38406 from fabpot/release-5.1.7 v5.1.7
Fabien Potencier [Sun, 4 Oct 2020 07:57:45 +0000 (09:57 +0200)]
Merge pull request #38406 from fabpot/release-5.1.7

released v5.1.7

3 months agoUpdate VERSION for 5.1.7
Fabien Potencier [Sun, 4 Oct 2020 07:57:28 +0000 (09:57 +0200)]
Update VERSION for 5.1.7

3 months agoUpdate CHANGELOG for 5.1.7
Fabien Potencier [Sun, 4 Oct 2020 07:57:11 +0000 (09:57 +0200)]
Update CHANGELOG for 5.1.7

3 months agoBump Symfony version to 4.4.16
Fabien Potencier [Sun, 4 Oct 2020 07:55:30 +0000 (09:55 +0200)]
Bump Symfony version to 4.4.16

3 months agoMerge pull request #38405 from fabpot/release-4.4.15 v4.4.15
Fabien Potencier [Sun, 4 Oct 2020 07:48:33 +0000 (09:48 +0200)]
Merge pull request #38405 from fabpot/release-4.4.15

released v4.4.15

3 months agoUpdate VERSION for 4.4.15
Fabien Potencier [Sun, 4 Oct 2020 07:48:13 +0000 (09:48 +0200)]
Update VERSION for 4.4.15

3 months agofeature #36479 [Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section...
Fabien Potencier [Sun, 4 Oct 2020 07:43:38 +0000 (09:43 +0200)]
feature #36479 [Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler (jschaedl)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler

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

This is the first iteration of adding a profiler panel for the new Notifier component:

WebProfiler Toolbar:
![Screenshot 2020-10-02 at 10 26 35](https://user-images.githubusercontent.com/1880467/94903474-28bece00-049a-11eb-945c-d6ce047b35e8.png)

WebProfiler Notifier Panel:

![Screenshot 2020-10-02 at 10 28 19](https://user-images.githubusercontent.com/1880467/94903594-5277f500-049a-11eb-8c1e-27e6ec87a51c.png)
![Screenshot 2020-10-02 at 10 28 29](https://user-images.githubusercontent.com/1880467/94903591-51df5e80-049a-11eb-935a-9ba130ef69f0.png)
![Screenshot 2020-10-02 at 10 28 35](https://user-images.githubusercontent.com/1880467/94903589-5146c800-049a-11eb-8a69-28d362ef6640.png)
![Screenshot 2020-10-02 at 10 28 42](https://user-images.githubusercontent.com/1880467/94903586-50159b00-049a-11eb-97bd-382a823087a6.png)

An example project can to test the new profiler panel can be found here: https://github.com/jschaedl/notifier-profiler-integration

Commits
-------

f39e74ba9f [Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler

3 months ago[Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler
Jan Schädlich [Sun, 23 Feb 2020 07:47:25 +0000 (08:47 +0100)]
[Notifier][WebProfilerBundle][FrameworkBundle] Add notifier section to profiler

3 months agoUpdate CHANGELOG for 4.4.15
Fabien Potencier [Sun, 4 Oct 2020 07:20:11 +0000 (09:20 +0200)]
Update CHANGELOG for 4.4.15

3 months agoMerge branch '5.1'
Fabien Potencier [Sun, 4 Oct 2020 07:09:29 +0000 (09:09 +0200)]
Merge branch '5.1'

* 5.1:
  Update security.he.xlf

3 months agoMerge branch '4.4' into 5.1
Fabien Potencier [Sun, 4 Oct 2020 07:09:21 +0000 (09:09 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  Update security.he.xlf

3 months agoMerge branch '3.4' into 4.4
Fabien Potencier [Sun, 4 Oct 2020 07:09:09 +0000 (09:09 +0200)]
Merge branch '3.4' into 4.4

* 3.4:
  Update security.he.xlf

3 months agoMerge branch '5.1'
Fabien Potencier [Sun, 4 Oct 2020 07:09:00 +0000 (09:09 +0200)]
Merge branch '5.1'

* 5.1:
  Handle consecutive supports() calls in the RememberMeAuthenticator

3 months agofeature #38395 [lock] Prevent user serializing the key when store does not support...
Fabien Potencier [Sun, 4 Oct 2020 07:08:28 +0000 (09:08 +0200)]
feature #38395 [lock] Prevent user serializing the key when store does not support it. (jderusse)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[lock] Prevent user serializing the key when store does not support it.

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

Some store relies on connection with the running process. ie. kernel relaease flock/semaphore, or zookeeper neeeds a connection to the database.

When the users tries to serialize the key to send it to another process, they are not aware that they lose the lock.

This PR throws an exception in that situation.

Commits
-------

1ec0630262 Prevent user serializing the key

3 months agominor #38403 Remove array return type from Request::toArray() (GrahamCampbell)
Fabien Potencier [Sun, 4 Oct 2020 07:07:32 +0000 (09:07 +0200)]
minor #38403 Remove array return type from Request::toArray() (GrahamCampbell)

This PR was merged into the 5.2-dev branch.

Discussion
----------

Remove array return type from Request::toArray()

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

Laravel already extends Symfony's `Request` class and defines it's own `toArray` method. https://github.com/symfony/symfony/pull/38224 added a new `toArray` method to this class with a different signature to the one that is in Laravel, causing fatal errors (https://github.com/laravel/framework/issues/34660). I think the best course of action here is to remove the return type for now, and only add it in Symfony 6. This will allow Symfony 6.0 and Laravel 11 to synchronize adding the return type.

Older versions of Laravel can't just change their signature to add an array return type to them, because that would be a breaking change for Laravel users extending Laravel's request class. I'm thinking, in particular, API packages and the like, or just straight up application code.

Commits
-------

8b291a49a6 Remove array return type from Request::toArray()

3 months agominor #38402 Update security.he.xlf (ben29)
Fabien Potencier [Sun, 4 Oct 2020 07:06:41 +0000 (09:06 +0200)]
minor #38402 Update security.he.xlf (ben29)

This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

Update security.he.xlf

Update Hebrew translation

Commits
-------

8d4c2f052d Update security.he.xlf

3 months agoUpdate security.he.xlf
Ben Hakim [Sat, 3 Oct 2020 21:49:48 +0000 (00:49 +0300)]
Update security.he.xlf

3 months agobug #38396 Handle consecutive supports() calls in the RememberMeAuthenticator (wouterj)
Fabien Potencier [Sun, 4 Oct 2020 07:05:27 +0000 (09:05 +0200)]
bug #38396 Handle consecutive supports() calls in the RememberMeAuthenticator (wouterj)

This PR was merged into the 5.1 branch.

Discussion
----------

Handle consecutive supports() calls in the RememberMeAuthenticator

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

If I read the issue correctly, the problem is not so much that `autoLogin()` is called in supports, but that it is called multiple times in the same request (in lazy firewalls). This is fixed by this issue.

@qurben or @fancyweb do you have an application with this error, and can you please test the patch in this PR? Please let me know if this actually fixed the issue. (if you can't, I'll create a small demo app to test this one)

Commits
-------

e0d1867b54 Handle consecutive supports() calls in the RememberMeAuthenticator

3 months agominor #38404 [HttpClient] Minor fix of type and message in ExponentialBackOff (bohanyang)
Fabien Potencier [Sun, 4 Oct 2020 07:03:11 +0000 (09:03 +0200)]
minor #38404 [HttpClient] Minor fix of type and message in ExponentialBackOff (bohanyang)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] Minor fix of type and message in ExponentialBackOff

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

Make the type consistent and fix an error message

Commits
-------

6149a0c04b [HttpClient] Minor fix of type and message in ExponentialBackOff

3 months agominor #38397 [Console] Remove "php" invokation from help messages. (rodrigoaguilera)
Fabien Potencier [Sun, 4 Oct 2020 07:01:38 +0000 (09:01 +0200)]
minor #38397 [Console] Remove "php" invokation from help messages. (rodrigoaguilera)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Remove "php" invokation from help messages.

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

Discusstion started here:
https://github.com/symfony/symfony/pull/38349

I was a bit puzzled to find that the help for the list and help commands suggests that you call the console application by prefixing it with `php myconsoleapp`.

As suggested in the PR above I am removing the `php ` prefix from the help.

I am providing a script with a shebang like the first example suggested in the following link:
https://symfony.com/doc/current/components/console.html
Eventually I want to distribute my console app as docker image so there is no need for php installed or the users even knowing is written in php.
The script name is easy to override by just setting a different value to `$_SERVER['PHP_SELF']` but this php prefix is hardcoded into the help strings for the the two default commands available.

Slightly related to #38347 as I am trying to improve the console help output.

Commits
-------

e036c30e7a [Console] Remove "php" invokation from help messages.

3 months ago[HttpClient] Minor fix of type and message in ExponentialBackOff
Bohan Yang [Sun, 4 Oct 2020 02:23:35 +0000 (10:23 +0800)]
[HttpClient] Minor fix of type and message in ExponentialBackOff

3 months agoRemove array return type from Request::toArray()
Graham Campbell [Sat, 3 Oct 2020 22:39:59 +0000 (23:39 +0100)]
Remove array return type from Request::toArray()

3 months ago[Console] Remove "php" invokation from help messages.
Rodrigo Aguilera [Sat, 3 Oct 2020 13:57:06 +0000 (15:57 +0200)]
[Console] Remove "php" invokation from help messages.

3 months agoMerge branch '5.1'
Fabien Potencier [Sat, 3 Oct 2020 13:58:25 +0000 (15:58 +0200)]
Merge branch '5.1'

* 5.1:
  Fix tests
  [Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter
  [Serializer][Minor] Fix exception message

3 months agoMerge branch '4.4' into 5.1
Fabien Potencier [Sat, 3 Oct 2020 13:58:17 +0000 (15:58 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  Fix tests
  [Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter
  [Serializer][Minor] Fix exception message

3 months agoHandle consecutive supports() calls in the RememberMeAuthenticator
Wouter de Jong [Sat, 3 Oct 2020 13:02:03 +0000 (15:02 +0200)]
Handle consecutive supports() calls in the RememberMeAuthenticator

3 months agoPrevent user serializing the key
Jérémy Derussé [Sat, 3 Oct 2020 11:52:44 +0000 (13:52 +0200)]
Prevent user serializing the key

3 months agofeature #38307 [Form] Implement Twig helpers to get field variables (tgalopin)
Fabien Potencier [Sat, 3 Oct 2020 09:48:50 +0000 (11:48 +0200)]
feature #38307 [Form] Implement Twig helpers to get field variables (tgalopin)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Form] Implement Twig helpers to get field variables

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14308

Designing Symfony Forms has always been difficult, especially for developers not comfortable with Symfony or Twig. The reason behind this difficulty is that the current `form_*` helper functions, while providing a way to quickly render a form, are hiding the generated HTML behind a notation specific to Symfony.

HTML standards introduced many new attributes since the Form component was created, from new constraints to how should inputs be displayed, treated by screen readers, etc.

I propose to introduce a series of new Twig functions to help create more flexible forms without the hurdle of having to use `form_*` functions. I called these methods `field_*` because they aim at rendering only the tiny bits of strings necessary to map forms to the Symfony backend.

The functions introduced are:

* `field_name` returns the name of the given field
* `field_value` returns the current value of the given field
* `field_label` returns the label of the given field, translated if possible
* `field_help` returns the help of the given field, translated if possible
* `field_errors` returns an iterator of strings for each of the errors of the given field
* `field_choices` returns an iterator of choices (the structure depending on whether the field uses or doesn't use optgroup) with translated labels if possible as keys and values as values

A quick example of usage of these functions could be the following:

``` twig
<input
    name="{{ field_name(form.username) }}"
    value="{{ field_value(form.username) }}"
    placeholder="{{ field_label(form.username) }}"
    class="form-control"
/>

<select name="{{ field_name(form.country) }}" class="form-control">
    <option value="">{{ field_label(form.country) }}</option>

    {% for label, value in field_choices(form.country) %}
        <option value="{{ value }}">{{ label }}</option>
    {% endfor %}
</select>

<select name="{{ field_name(form.stockStatus) }}" class="form-control">
    <option value="">{{ field_label(form.stockStatus) }}</option>

    {% for groupLabel, groupChoices in field_choices(form.stockStatus) %}
        <optgroup label="{{ groupLabel }}">
            {% for label, value in groupChoices %}
                <option value="{{ value }}">{{ label }}</option>
            {% endfor %}
        </optgroup>
    {% endfor %}
</select>

{% for error in field_errors(form.country) %}
    <div class="text-danger mb-2">
        {{ error }}
    </div>
{% endfor %}
```

There are several advantages to using these functions instead of their `form_*` equivalents:

* they are much easier to use for developers not knowing Symfony: they rely on native HTML with bits of logic inside, instead of relying on specific tools needing to be configured to display proper HTML
* they allow for better integration with CSS frameworks or Javascript libraries as adding a new HTML attribute is trivial (no need to look at the documentation)
* they are easier to use in contexts where one would like to customize the rendering of a input in details: having the label as placeholder, displaying a select empty field, ...

The `form_*` functions are still usable of course, but I'd argue this technique is actually easier to read and understand.

Commits
-------

3941d70928 [Form] Implement Twig helpers to get field variables

3 months agoFix tests
Fabien Potencier [Sat, 3 Oct 2020 06:31:32 +0000 (08:31 +0200)]
Fix tests

3 months agobug #36291 [Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter ...
Fabien Potencier [Sat, 3 Oct 2020 06:30:09 +0000 (08:30 +0200)]
bug #36291 [Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter (Jontsa)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter

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

Updates `Symfony\Component\Lock\Store\StoreFactory` to accept same DSN syntax as `Symfony\Component\Cache\Adapter\AbstractAdapter` which is used to create Redis class instance.

Commits
-------

4ebbe3d86b [Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter

3 months ago[Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter
Joni Halme [Tue, 31 Mar 2020 17:28:05 +0000 (20:28 +0300)]
[Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter

3 months agofeature #38177 [Security] Magic login link authentication (weaverryan)
Fabien Potencier [Sat, 3 Oct 2020 06:23:42 +0000 (08:23 +0200)]
feature #38177 [Security] Magic login link authentication (weaverryan)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Security] Magic login link authentication

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

Hi!

This adds a Slack-style "magic link" login authenticator to the new login system: (A) enter your email into a form, (B) receive an email with a link in it (C) click that link and you are authenticated!

For most users, implementing this would require:

A) Create a [controller](https://github.com/weaverryan/symfony-magic-login-link-example/blob/master/src/Controller/MagicLinkLoginController.php) with the "enter your email" form and a route for the "check" functionality (similar to `form_login`)
B) Activate in `security.yaml`:

```yml
security:
    enable_authenticator_manager: true
    # ...
    firewalls:
        # ...
        main:
            # ...
            login_link:
                check_route: 'magic_link_verify'
                # this is an important and powerful option
                # An array of properties on your User that are used to sign the link.
                # If any of these change, all existing links will become invalid
                # tl;dr If you want the modification of ANY field to invalidate ALL existing magic links immediately,
                # then you can add it to this list. You could even add a "lastLoginLinkSentAt" to invalid
                # all existing login links when a new one is sent.
                signature_properties: [id, password, email]

                # optional - by default, links can be reused but have a 10 minute lifetime
                #max_uses: 3
                #used_link_cache: cache.app
```

Done! This will generate a URL that looks something like this:

> https://127.0.0.1:9033/login/verify?user=weaverryan@gmail.com&expires=1601342578&hash=YzE1ZDJlYjM3YTMyMjgwZDdkYzg2ZjFlMjZhN2E5ZWRmMzk3NjAxNjRjYThiMjMzNmIxYzAzYzQ4NmQ2Zjk4NA%3D%3D

We would implement a Maker command this config + login/controller. The implementation is done via a "signed URL" and an optional cache pool to "expire" links. The hash of the signed URL can contain any user fields you want, which give you a powerful mechanism to invalidate magic tokens on user data changes. See `signature_properties` above.

#### Security notes:

There is a LOT of variability about how secure these need to be:

* A) Many/most implementation only allow links to be used ONE time. That is *possible* with this implementation, but is not the *default*. You CAN add a `max_uses` config which stores the expired links in a cache so they cannot be re-used. However, to make this work, you need to do more work by adding some "page" between the link the users clicks and *actually* using the login link. Why? Because unless you do this, email clients may follow the link to "preview" it and will "consume" the link.

* B) Many implementations will invalidate all other login links for a user when a new one is created. We do *not* do that, but that IS possible (and we could even generate the code for it) by adding a `lastLoginLinkSentAt` field to `User` and including this in `signature_properties`.

* C) We *do* invalidate all links if the user's email address is changed (assuming the `email` is included in `signature_properties`, which it should be). You can also invalidate on password change or whatever you want.

* D) Some implementations add a "state" so that you can only use the link on the same device that created it. That is, in many cases, quite annoying. We do not currently support that, but we could in the future (and the user could add it themselves).

Thanks!

#### TODOS:

* [x] A) more tests: functional (?) traits
* [ ] B) documentation
* [ ] C) MakerBundle PR
* [ ] D) Make sure we have what we need to allow that "in between" page
* [ ] E) Create a new cache pool instead of relying on cache.app?

Commits
-------

a8afe109d8 [Security] Magic login link authentication

3 months ago[Security] Magic login link authentication
Ryan Weaver [Sat, 12 Sep 2020 20:03:47 +0000 (16:03 -0400)]
[Security] Magic login link authentication

3 months agofeature #38224 [HttpFoundation] Add Request::toArray() for JSON content (Nyholm)
Fabien Potencier [Sat, 3 Oct 2020 06:14:02 +0000 (08:14 +0200)]
feature #38224 [HttpFoundation] Add Request::toArray() for JSON content (Nyholm)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Add Request::toArray() for JSON content

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

The past few months I've been working more and more with javascript and APIs. I've written controllers that parse json from the request body. I've found myself copying code between projects so I looked at the possibility to add this code to the `Request` class itself.

### Usage

```http
POST /add-user
Content-Type: application/json

{"name": "Tobias", "email": "tobias.nyholm@gmail.com"}
```

```php
use Symfony\Component\HttpFoundation\Exception\JsonException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;

class MyController
    // ...
    public function addUser(Request $request): JsonResponse
    {
        try {
            $data = $request->toArray();
        } catch (JsonException $e) {
            return new JsonResponse(['message'=>'Request does not contain valid json'], 415);
        }

        $command = new AddUser($data['email'] ?? '', $data['name'] ?? '');

        try {
            $this->commandBus->dispatch($command);
        } catch (ValidationFailedException $e) {
            return new JsonResponse(['message' => 'Unexpected JSON body'], 400);
        }

        return new JsonResponse(['message' => 'User successfully added']);
    }
}
```
----------

I've searched but I have not found that this has been proposed before.. With is strange.. ¯\\_(ツ)_/¯

Commits
-------

83c1a2666d [HttpFoundation] Add Request::toArray() for JSON content

3 months ago[HttpFoundation] Add Request::toArray() for JSON content
Nyholm [Thu, 17 Sep 2020 14:41:40 +0000 (16:41 +0200)]
[HttpFoundation] Add Request::toArray() for JSON content

3 months agoFix CS
Fabien Potencier [Sat, 3 Oct 2020 06:07:27 +0000 (08:07 +0200)]
Fix CS

3 months agobug #38385 [PropertyInfo] Fix failure over array<string,mixed> PhpDoc type (romaricdr...
Fabien Potencier [Sat, 3 Oct 2020 06:03:47 +0000 (08:03 +0200)]
bug #38385 [PropertyInfo] Fix failure over array<string,mixed> PhpDoc type (romaricdrigon)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] Fix failure over array<string,mixed> PhpDoc type

| Q             | A
| ------------- | ---
| Branch?       | master (issue introduced in master)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | /
| License       | MIT
| Doc PR        | /

**Background**

Since a few days ago ([this commit](https://github.com/symfony/symfony/commit/80e5a7fbd80ef04fced05bb3d4bcb8816fa897be)), PropertyInfo 5.2 component supports array PhpDoc types, such as `array<string,string>`.
While testing SF 5.2 over my project, it was failing over:
```php
class SomeDoctrineEntityProxy implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * @var array<string, mixed> default values of properties to be lazy loaded, with keys being the property names
     *
     * @see \Doctrine\Common\Proxy\Proxy::__getLazyProperties
     */
    public static $lazyPropertiesDefaults = array();
}
```

Upon investigation, it appears `array<string,mixed>` is causing the issue: `mixed` type is not handled.

**Expected behavior**

PropertyInfo component should not guess anything for `mixed` type (return `NULL`), but it should not throw any exception.

**Comment about my fix**

I added a test case (`arrayOfMixed`) you can use to reproduce the issue.
Since array PhpDoc types were not tested at all, I also added a test case over `array<string,string>`.

Commits
-------

590177ff8e [PropertyInfo] Fix failure over array<string,mixed> PhpDoc type

3 months agobug #38390 [Serializer][Minor] Fix circular reference exception message (bad limit...
Fabien Potencier [Sat, 3 Oct 2020 06:01:52 +0000 (08:01 +0200)]
bug #38390 [Serializer][Minor] Fix circular reference exception message (bad limit displayed) (l-vo)

This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer][Minor] Fix circular reference exception message (bad limit displayed)

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

Commits
-------

36ce9029f7 [Serializer][Minor] Fix exception message

3 months agobug #38391 [Security] Fixed undefined property in Firewall\ExceptionListener (yceruto)
Fabien Potencier [Sat, 3 Oct 2020 06:00:23 +0000 (08:00 +0200)]
bug #38391 [Security] Fixed undefined property in Firewall\ExceptionListener (yceruto)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Fixed undefined property in Firewall\ExceptionListener

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

When there is no entry point configuration:
```
Notice: Undefined property:
Symfony\Component\Security\Http\Firewall\ExceptionListener::$providerKey
```

/cc @wouterj

Commits
-------

3d83f94a89 Fixed undefined property in Firewall\ExceptionListener

3 months agoFixed undefined property in Firewall\ExceptionListener
Yonel Ceruto [Fri, 2 Oct 2020 21:21:50 +0000 (17:21 -0400)]
Fixed undefined property in Firewall\ExceptionListener

3 months ago[Serializer][Minor] Fix exception message
Laurent VOULLEMIER [Fri, 2 Oct 2020 20:12:42 +0000 (22:12 +0200)]
[Serializer][Minor] Fix exception message

Wrong circular reference limit displayed.

3 months ago[PropertyInfo] Fix failure over array<string,mixed> PhpDoc type
Romaric Drigon [Fri, 2 Oct 2020 12:56:13 +0000 (14:56 +0200)]
[PropertyInfo] Fix failure over array<string,mixed> PhpDoc type

3 months agoMerge branch '5.1'
Nicolas Grekas [Fri, 2 Oct 2020 14:25:10 +0000 (16:25 +0200)]
Merge branch '5.1'

* 5.1:
  [HttpClient] Always "buffer" empty responses

3 months agoMerge branch '4.4' into 5.1
Nicolas Grekas [Fri, 2 Oct 2020 14:24:03 +0000 (16:24 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  [HttpClient] Always "buffer" empty responses

3 months ago[HttpClient] fix last fix
Nicolas Grekas [Fri, 2 Oct 2020 14:15:25 +0000 (16:15 +0200)]
[HttpClient] fix last fix

3 months ago[HttpClient] Fix dealing with empty responses in AsyncResponse
Nicolas Grekas [Fri, 2 Oct 2020 14:11:08 +0000 (16:11 +0200)]
[HttpClient] Fix dealing with empty responses in AsyncResponse

3 months agobug #38378 [HttpClient] Fix exception triggered with AsyncResponse (jderusse)
Nicolas Grekas [Fri, 2 Oct 2020 13:57:56 +0000 (15:57 +0200)]
bug #38378 [HttpClient] Fix exception triggered with AsyncResponse (jderusse)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] Fix exception triggered with AsyncResponse

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/38289#issuecomment-702573975
| License       | MIT
| Doc PR        | /

When a request is replayed with the AsyncResponse and the 2nd request failed, users get an exception even when they pass `$throw=false`.

In fact, there are 2 exceptions:

1. Cannot get the content of the response twice: buffering is disabled.

https://github.com/symfony/symfony/blob/73ca97c97ab4c4fc9a7bca5fb4339fca22e0cfa1/src/Symfony/Component/HttpClient/Response/CommonResponseTrait.php#L51-L68

Because CommonResponseTrait::$content is null and `self::stream` yield only the LastChunk. The content is stays null

2. HTTP/2 429  returned for "https://httpbin.org/status/429"

https://github.com/symfony/symfony/blob/73ca97c97ab4c4fc9a7bca5fb4339fca22e0cfa1/src/Symfony/Component/HttpClient/Response/AsyncResponse.php#L209-L225

Because on the second request passthru is null, it didn't disable the the exception thrown on destruct for the wrapped response.
This

Commits
-------

3aedb51dd8 [HttpClient] Fix exception triggered with AsyncResponse

3 months ago[HttpClient] Fix exception triggered with AsyncResponse
Jérémy Derussé [Fri, 2 Oct 2020 09:04:50 +0000 (11:04 +0200)]
[HttpClient] Fix exception triggered with AsyncResponse

3 months agobug #38388 [HttpClient] Always "buffer" empty responses (nicolas-grekas)
Nicolas Grekas [Fri, 2 Oct 2020 13:47:43 +0000 (15:47 +0200)]
bug #38388 [HttpClient] Always "buffer" empty responses (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Always "buffer" empty responses

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

Commits
-------

03d60fce47 [HttpClient] Always "buffer" empty responses

3 months ago[HttpClient] Always "buffer" empty responses
Nicolas Grekas [Fri, 2 Oct 2020 13:32:43 +0000 (15:32 +0200)]
[HttpClient] Always "buffer" empty responses

3 months agofeature #38323 [Mime] Allow multiple parts with the same name in FormDataPart (HypeMC)
Fabien Potencier [Fri, 2 Oct 2020 13:33:43 +0000 (15:33 +0200)]
feature #38323 [Mime] Allow multiple parts with the same name in FormDataPart (HypeMC)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Mime] Allow multiple parts with the same name in FormDataPart

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

Added the possibility to choose whether multiple parts with the same name should be suffixed or not:

```php
$f1 = new FormDataPart([
    'foo' => [
        'one',
        'two',
    ],
]);

var_dump($f1->toString());
```

```
Content-Type: multipart/form-data; boundary=6rqazwiG

--6rqazwiG
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo[0]"

one
--6rqazwiG
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo[1]"

two
--6rqazwiG--
```

```php
$f1 = new FormDataPart([
    ['foo' => 'one'],
    ['foo' => 'two'],
]);

var_dump($f1->toString());
```

```
Content-Type: multipart/form-data; boundary=xxW9dGzq

--xxW9dGzq
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo"

one
--xxW9dGzq
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo"

two
--xxW9dGzq--
```

Only applies to numeric keys:

```php
$f1 = new FormDataPart([
    'foo' => [
        'a' => 'one',
        'b' => 'two',
    ],
], true);

var_dump($f1->toString());
```

```
Content-Type: multipart/form-data; boundary=W6qkqgrD

--W6qkqgrD
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo[a]"

one
--W6qkqgrD
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Disposition: form-data; name="foo[b]"

two
--W6qkqgrD--
```

Commits
-------

1f7f2c6ddc Allow multiple parts with the same name in FormDataPart

3 months ago[Validator] Use comparison constraints as attributes.
Alexander M. Turek [Tue, 29 Sep 2020 20:47:47 +0000 (22:47 +0200)]
[Validator] Use comparison constraints as attributes.

3 months agoMerge branch '5.1'
Nicolas Grekas [Fri, 2 Oct 2020 13:09:26 +0000 (15:09 +0200)]
Merge branch '5.1'

* 5.1:
  [5.1] Ignore more deprecations for Mockery mocks
  [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener
  disallow FrameworkBundle 4.4+
  propagate validation groups to subforms
  [Form] [Validator] Add failing testcase to demonstrate group sequence issue

3 months agominor #38386 [5.1] Ignore more deprecations for Mockery mocks (fancyweb)
Nicolas Grekas [Fri, 2 Oct 2020 13:08:52 +0000 (15:08 +0200)]
minor #38386 [5.1] Ignore more deprecations for Mockery mocks (fancyweb)

This PR was merged into the 5.1 branch.

Discussion
----------

[5.1] Ignore more deprecations for Mockery mocks

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

Continuation of https://github.com/symfony/symfony/pull/38377 on 5.1.

Commits
-------

58e6cb1ddc [5.1] Ignore more deprecations for Mockery mocks

3 months ago[5.1] Ignore more deprecations for Mockery mocks
Thomas Calvet [Fri, 2 Oct 2020 13:05:43 +0000 (15:05 +0200)]
[5.1] Ignore more deprecations for Mockery mocks

3 months agobug #38384 [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener...
Nicolas Grekas [Fri, 2 Oct 2020 12:58:44 +0000 (14:58 +0200)]
bug #38384 [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener (fancyweb)

This PR was merged into the 5.1 branch.

Discussion
----------

[PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener

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

https://github.com/symfony/symfony/pull/38031 caused an unwanted regression: if the frame `class` matches `SymfonyTestsListenerFor` it used to always return, now it continues so the `originClass` and `originMethod` properties are set. Therefore, the deprecation is considered as coming from the test listener. It ends up in the "legacy" group and muted because the test listeners contains the word "Legacy" in their namespaces.

Example test:
```php
<?php

namespace App\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher;

final class FooTest extends TestCase
{
    public function test(): void
    {
        // ExtractingEventDispatcher is @internal
        new class extends ExtractingEventDispatcher {};

        $this->assertTrue(true);
    }
}
```

On 4.4:
```
Other deprecation notices (1)

  1x: The "Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher" class is considered internal. It may change without further notice. You should not use it from "Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher@anonymous".
```

On 5.1:
```
Legacy deprecation notices (1)
```

Commits
-------

1ba06a0f86 [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener

3 months agoMerge branch '4.4' into 5.1
Nicolas Grekas [Fri, 2 Oct 2020 12:58:01 +0000 (14:58 +0200)]
Merge branch '4.4' into 5.1

* 4.4:
  disallow FrameworkBundle 4.4+
  propagate validation groups to subforms
  [Form] [Validator] Add failing testcase to demonstrate group sequence issue

3 months ago[PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener
Thomas Calvet [Fri, 2 Oct 2020 12:43:26 +0000 (14:43 +0200)]
[PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener