Commit Graph

51253 Commits

Author SHA1 Message Date
Wouter de Jong
0f947b2e84 Allow null and DateTime objects to be used as signatureProperties
Returning DateTime objects seems like a common use-case to automatically expire
all login links when one is used or to only allow the login link to be used
once.
2020-10-10 15:09:30 +02:00
Fabien Potencier
0000dfe573 feature #38484 [Messenger] Add DelayStamp::delayFor() and DelayStamp::delayUntil() (Nyholm)
This PR was squashed before being merged into the 5.x branch.

Discussion
----------

[Messenger] Add DelayStamp::delayFor() and DelayStamp::delayUntil()

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #38141
| License       | MIT
| Doc PR        |

This PR will revert the work by @Toflar in https://github.com/symfony/symfony/pull/38141. He added some helper methods and I want to add a generic factory method that adds a DateInterval.

This PR will also close #38480 and fix #38459. It is also related to a comment in https://github.com/symfony/symfony/pull/36512#issuecomment-675462871 that was liked by a few people.

Maybe adding both `DelayStamp::delayFor(\DateInterval)` and `DelayStamp::delayUntil(\DateTimeInterface)` is overkill. But this covers all the bases and I hope that it will be the last change to this small class.

Commits
-------

c5de1eb53c [Messenger] Add DelayStamp::delayFor() and DelayStamp::delayUntil()
2020-10-08 18:18:58 +02:00
Nyholm
c5de1eb53c [Messenger] Add DelayStamp::delayFor() and DelayStamp::delayUntil() 2020-10-08 18:18:51 +02:00
Fabien Potencier
0137609eaf minor #38474 [Notifier] Introduce NullMessage and remove transport setter in MessageInterface (jschaedl)
This PR was merged into the 5.x branch.

Discussion
----------

[Notifier] Introduce NullMessage and remove transport setter in MessageInterface

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- 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 -->

Follow-up PR of https://github.com/symfony/symfony/pull/36479

Commits
-------

5701e89960 Introduce NullMessage and remove transport setter in MessageInterface
2020-10-08 08:41:23 +02:00
Fabien Potencier
a6b6dbb839 bug #38476 [HttpClient] Fix missing abstract arg (jderusse)
This PR was merged into the 5.x branch.

Discussion
----------

[HttpClient] Fix missing abstract arg

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

Fix missing abstract argument and add tests

Commits
-------

7cdabd66fc Fix missing abstract arg
2020-10-08 08:38:22 +02:00
Jérémy Derussé
7cdabd66fc
Fix missing abstract arg 2020-10-07 23:58:16 +02:00
Jan Schädlich
5701e89960 Introduce NullMessage and remove transport setter in MessageInterface 2020-10-07 22:09:56 +02:00
Fabien Potencier
559ebe35fe feature #37733 [PhpUnitBridge] Add ability to set a baseline for deprecation testing (alexpott)
This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead.

Discussion
----------

[PhpUnitBridge] Add ability to set a baseline for deprecation testing

| 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       | Fix #37715, #34496
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This PR allows you set new options for `SYMFONY_DEPRECATIONS_HELPER` env var:
* `generateBaseline` - if this is set to TRUE any deprecations that occur will be written to the file defined in the `baselineFile` option
* `baselineFile` a path to a file that contains a json encoded array of deprecations that will be skipped.

### Questions
* If you set `generateBaseline` without also setting `baselineFile` an exception is thrown. We could use a default filename if one is not provided (like PHPStan).
* How much error checking should we do around the `baselineFile` variable - should we check if it is readable or should we rely on `file_get_contents`()?

### Still @todo
Add proper end-to-end testing using a .phpt test

Commits
-------

483236f34a [PhpUnitBridge] Add ability to set a baseline for deprecation testing
2020-10-07 13:07:15 +02:00
Alex Pott
483236f34a [PhpUnitBridge] Add ability to set a baseline for deprecation testing 2020-10-07 13:07:08 +02:00
Fabien Potencier
414a5abe78 bug #38453 [lock] Mark Key unserializable whith PgsqlStore (jderusse)
This PR was merged into the 5.x branch.

Discussion
----------

[lock] Mark Key unserializable whith PgsqlStore

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

Marks key unserializable #38395 with the new PgsqlStore #38346

Commits
-------

eb934e9015 Mark Key unserializable whith PgsqlStore
2020-10-07 11:11:18 +02:00
Nicolas Grekas
61dcfe3419 bug #38452 [SecurityBundle] Make user lazy loading working without user provider (tyx)
This PR was merged into the 5.x branch.

Discussion
----------

[SecurityBundle] Make user lazy loading working without user provider

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| 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 #38429  <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

Make user lazy loading in security working again without user provider.

Commits
-------

df9e8486f5 Make user lazy loading working without user provider
2020-10-07 11:09:23 +02:00
Nicolas Grekas
4c3442691e bug #38455 [Form] Fix field_value Twig helper for multiple choices (tgalopin)
This PR was merged into the 5.x branch.

Discussion
----------

[Form] Fix field_value Twig helper for multiple choices

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

Add the possibility to retrieve an array value from a FormView (in the case of multiple choices).

Commits
-------

7b414a96df [Form] Fix field_value Twig helper
2020-10-07 10:57:21 +02:00
Titouan Galopin
7b414a96df [Form] Fix field_value Twig helper 2020-10-07 10:52:31 +02:00
Timothée Barray
df9e8486f5
Make user lazy loading working without user provider 2020-10-07 10:42:01 +02:00
Jérémy Derussé
eb934e9015
Mark Key unserializable whith PgsqlStore 2020-10-07 10:29:02 +02:00
Fabien Potencier
494ef421c5 feature #38434 [HttpClient] Add jitter to RetryBackoff (jderusse)
This PR was merged into the 5.x branch.

Discussion
----------

[HttpClient] Add jitter to RetryBackoff

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

From the idea https://twitter.com/mtdowling/status/1313205613158043648 this PR adds a new `jitter` parameter to the ExponentialBackOff implementation.

jitter is a percentage (float between 0 and 1) of randomness to apply to the computed delay.
ie. if the initial delay is 1000ms, and jitter=0.2, the finale delay will be an number between 800 and 1200 (1000 +/- 20%)

Commits
-------

ace731437e Add jitter to RetryBackof
2020-10-07 08:15:11 +02:00
Fabien Potencier
5cc4bc9e32 feature #38346 [lock] Add store dedicated to postgresql (jderusse)
This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead.

Discussion
----------

[lock] Add store dedicated to postgresql

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

This PR adds 2 new Stores to the Lock component:
- PostgreSql
- InMemory (see the WHY below)

Difference with PDO:
- This store use the Advisory Locks provided natively by postgresql
- Don't need to create/maintain a table
- Native support for Blocking locks
- Native support for Shared locks

By design the lock is linked to the connection with the database, which imply:
- the lock can't be serialized and passed to another process (ie. store lock in session). Which is also the case for FlockStore, SemaphoreStore and ZookeeperStore
- if the connection is cut, the process may not be aware that it loose the lock (think a very long process without performing any request)
- the PostgreSqlStore couldn't rely on the database only to acquire a lock, because all store sharing the same connection won't be concurrent each other. That's why, I added the InMemory store that prevent concurrency within the same process.

Commits
-------

3d114be680 [lock] Add store dedicated to postgresql
2020-10-07 08:05:21 +02:00
Jérémy Derussé
3d114be680 [lock] Add store dedicated to postgresql 2020-10-07 08:05:14 +02:00
Fabien Potencier
b0ae228152 feature #38424 [Translation] Rename Translatable class to TranslatableMessage (natewiebe13)
This PR was submitted for the master branch but it was merged into the 5.x branch instead.

Discussion
----------

[Translation] Rename Translatable class to TranslatableMessage

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

This PR is in anticipation of #38342 passing. We'll need to also update the docs and the blog post here: https://symfony.com/blog/new-in-symfony-5-2-translatable-objects

One extra note not discussed in the issue thread is the increase in the class name length shouldn't really be a problem as `t()` is likely to be used more often.

Commits
-------

0d4e25f4a6 Rename Translatable class to TranslatableMessage
2020-10-07 07:51:08 +02:00
Nate Wiebe
0d4e25f4a6 Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
Jérémy Derussé
ace731437e
Add jitter to RetryBackof 2020-10-06 23:46:00 +02:00
Nicolas Grekas
ca220a1992 minor #38443 [String][AsciiSlugger] Fix typo (ErnadoO)
This PR was submitted for the master branch but it was merged into the 5.x branch instead.

Discussion
----------

[String][AsciiSlugger] Fix typo

| Q             | A
| ------------- | ---
| Branch?       | master<!-- see below -->
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |  -
| License       | MIT
| Doc PR        | -

I guess there was a little mistake on PR https://github.com/symfony/symfony/pull/38198 : In exception message it should be `$symbolsMap` instead of `$symbolMap`

;)

Commits
-------

614b8d68a8 [String][AsciiSlugger] Fix typo
2020-10-06 19:37:43 +02:00
Erwan
614b8d68a8 [String][AsciiSlugger] Fix typo 2020-10-06 19:37:38 +02:00
Nicolas Grekas
5c3ba3ab78 minor #38394 [FrameworkBundle] Add check for installed yaml component (jschaedl)
This PR was submitted for the master branch but it was squashed and merged into the 5.x branch instead.

Discussion
----------

[FrameworkBundle] Add check for installed yaml component

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 #38301 <!-- 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 -->
<!--
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/releases):
 - 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.
-->

**Todo:**

- [ ] add tests

Commits
-------

f174ad2ee0 [FrameworkBundle] Add check for installed yaml component
2020-10-06 18:28:05 +02:00
Jan Schädlich
f174ad2ee0 [FrameworkBundle] Add check for installed yaml component 2020-10-06 18:27:41 +02:00
Nicolas Grekas
96a725f965 Merge branch '5.1' into 5.x
* 5.1:
  [gha] Fix leftover
2020-10-06 18:09:43 +02:00
Nicolas Grekas
2b206ff4b2 Merge branch '4.4' into 5.1
* 4.4:
  [gha] Fix leftover
2020-10-06 18:09:38 +02:00
Nicolas Grekas
6d5a803624 [gha] Fix leftover 2020-10-06 18:09:33 +02:00
Nicolas Grekas
6066462be2 Merge branch '5.1' into 5.x
* 5.1:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:53:16 +02:00
Nicolas Grekas
3e492d6e5d Merge branch '4.4' into 5.1
* 4.4:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:50:31 +02:00
Nicolas Grekas
55396f90a3 Merge branch '3.4' into 4.4
* 3.4:
  Update versions in composer.json
2020-10-06 17:45:41 +02:00
Nicolas Grekas
3ca2d806b0 minor #38439 Update versions in composer.json (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Update versions in composer.json

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

Should make the CI green.

Commits
-------

8f714a2fd6 Update versions in composer.json
2020-10-06 17:41:25 +02:00
Nicolas Grekas
8f714a2fd6 Update versions in composer.json 2020-10-06 17:25:25 +02:00
Fabien Potencier
87f328428e bug #38433 [Mime] Fix serialization of RawMessage (gilbertsoft)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Mime] Fix serialization of RawMessage

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | Fix #38430, Related #33394 <!-- 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 -->

The serialization of RawMessage is currently broken if using a generator for message like done by `Symfony\Component\Mailer\SentMessage` see 5f1c3a7972/src/Symfony/Component/Mailer/SentMessage.php (L45)
This patch converts the message to a string so further serialization can be done.

This patch probably also solves #33394.

<!--
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/releases):
 - 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 5.x.
-->

Commits
-------

fd99eb26d8 [Mime] Fix serialization of RawMessage
2020-10-06 16:40:04 +02:00
Gilbertsoft
fd99eb26d8 [Mime] Fix serialization of RawMessage 2020-10-06 16:40:02 +02:00
Nicolas Grekas
11c4f28137 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 14:00:29 +02:00
Nicolas Grekas
9f2a66871c Merge branch '4.4' into 5.1
* 4.4:
  fix merge
2020-10-06 13:57:58 +02:00
Nicolas Grekas
2f7751f0df fix merge 2020-10-06 13:56:58 +02:00
Nicolas Grekas
097c8c6f27 Merge branch '4.4' into 5.1
* 4.4:
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 13:49:34 +02:00
Nicolas Grekas
0c3447f94c Merge branch '3.4' into 4.4
* 3.4:
  [appveyor] fix checking for the .x branch
2020-10-06 13:43:00 +02:00
Nicolas Grekas
f4a1885b8d [appveyor] fix checking for the .x branch 2020-10-06 13:42:19 +02:00
Nicolas Grekas
e553f424d0 Merge branch '3.4' into 4.4
* 3.4:
  Remove "branch-alias", populate "version"
2020-10-06 13:41:17 +02:00
Nicolas Grekas
b715f462b3 minor #38431 Remove "branch-alias", populate "version" (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove "branch-alias", populate "version"

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

Commits
-------

9d40c796c4 Remove "branch-alias", populate "version"
2020-10-06 13:32:04 +02:00
Nicolas Grekas
9d40c796c4 Remove "branch-alias", populate "version" 2020-10-06 13:22:52 +02:00
Nicolas Grekas
1428e6dff9 bug #38422 [SecurityGuard] Implement PostAuthenticationGuardToken::getFirewallName() (derrabus)
This PR was submitted for the master branch but it was merged into the 5.x branch instead.

Discussion
----------

[SecurityGuard] Implement PostAuthenticationGuardToken::getFirewallName()

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

Commits
-------

66fbf0a671 [SecurityGuard] Implement PostAuthenticationGuardToken::getFirewallName().
2020-10-06 11:21:18 +02:00
Alexander M. Turek
66fbf0a671 [SecurityGuard] Implement PostAuthenticationGuardToken::getFirewallName(). 2020-10-06 11:21:13 +02:00
Fabien Potencier
8df5aad90a 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
2020-10-06 10:08:38 +02:00
Fabien Potencier
da99063ccd 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
2020-10-06 10:08:25 +02:00
Fabien Potencier
b47ba231ef 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
2020-10-06 10:07:23 +02:00
Fabien Potencier
40dc7e6278 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
2020-10-06 10:06:52 +02:00