Commit Graph

52762 Commits

Author SHA1 Message Date
Fabien Potencier
61aa8fd67c bug #39608 [Messenger] Setup queues once in AMQP (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Setup queues once in AMQP

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

To ease the setup, this PR also merge setup of exchange AND delayExchange.

/cc @Nyholm

Commits
-------

c2e84c610a Setup queues once in AMQP
2021-01-01 10:47:19 +01:00
Fabien Potencier
0ecf95021c Bump license year 2021-01-01 10:27:30 +01:00
Fabien Potencier
782ed1019f Merge branch '5.2' into 5.x
* 5.2:
  Bump license year
  Bump license year
  Bump license year
  [Form] fix passing null $pattern to IntlDateFormatter
  [Notifier] Add missing LICENSE file
  Add reference link
  [Validator] Update Isin message to match the translation files.
  Update README.md
  Add AuthenticationTokenCreatedEvent to be propagated
2021-01-01 10:27:20 +01:00
Fabien Potencier
a459b44829 Bump license year 2021-01-01 10:27:05 +01:00
Fabien Potencier
2a1a4e7067 Merge branch '5.1' into 5.2
* 5.1:
  Bump license year
  Bump license year
  [Form] fix passing null $pattern to IntlDateFormatter
  Add reference link
  Update README.md
2021-01-01 10:26:45 +01:00
Fabien Potencier
46ea62297b Bump license year 2021-01-01 10:26:30 +01:00
Fabien Potencier
f4ca745086 Merge branch '4.4' into 5.1
* 4.4:
  Bump license year
  [Form] fix passing null $pattern to IntlDateFormatter
  Update README.md
2021-01-01 10:25:51 +01:00
Fabien Potencier
2c4337ae5b Bump license year 2021-01-01 10:24:35 +01:00
Grégoire Pineau
29c7bfa7d6 feature #39020 [PropertyInfo] Support multiple types for collection keys & values (Korbeil)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PropertyInfo] Support multiple types for collection keys & values

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

This PR is here to introduce multiple types for collection keys & values.
Today, we support types as following: `A|B|C` thanks to `getTypes` interface (in extractors) but we do not support union types in collection keys or values, such as `array<A|B|C>`. This PR will allow this.
In a next PR, we'll introduce an Extractor that will parse phpDoc in order to have union types in collection keys or values.

I tried to introduce as few depreciations as possible, we have only 2 of them here:
- `Type::getCollectionKeyType`
- `Type::getCollectionValueType`

Commits
-------

84dd1784cb Support multiple types for collection keys & values
2020-12-31 10:49:36 +01:00
Baptiste Leduc
84dd1784cb
Support multiple types for collection keys & values 2020-12-31 10:27:19 +01:00
Robin Chalas
e1e1defffa feature #39557 [Notifier] [BC BREAK] Final classes (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [BC BREAK] Final classes

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no, BC BREAK, but experimental <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | ---
| License       | MIT
| Doc PR        | ---

Commits
-------

733ba619a1 [Notifier] [BC BREAK] Final classes
2020-12-30 23:13:32 +01:00
Nicolas Grekas
841ec99831 bug #39653 [Form] fix passing null $pattern to IntlDateFormatter (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] fix passing null $pattern to IntlDateFormatter

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

Commits
-------

52360c1e4e [Form] fix passing null $pattern to IntlDateFormatter
2020-12-29 14:57:58 +01:00
Nicolas Grekas
52360c1e4e [Form] fix passing null $pattern to IntlDateFormatter 2020-12-29 14:49:19 +01:00
Nicolas Grekas
e905b8d8d8 minor #39644 [PhpUnitBridge] Modernize CoverageListener (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PhpUnitBridge] Modernize CoverageListener

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

This PR proposes to merge `CoverageListener`, `CoverageListenerForV7` and `CoverageListenerTrait` into a single class because we don't have to deal with multiple implementations anymore.

Additionally, I've removed compat code for PHPUnit < 7.5 and added type declarations where possible.

Commits
-------

eb1669069b [PhpUnitBridge] Modernize CoverageListener
2020-12-29 09:44:09 +01:00
Nicolas Grekas
b604fd7dd8 minor #39648 [Notifier] Add missing LICENSE file (OskarStark)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Add missing LICENSE file

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

Commits
-------

fbd1fe0fd6 [Notifier] Add missing LICENSE file
2020-12-29 09:43:11 +01:00
Oskar Stark
fbd1fe0fd6 [Notifier] Add missing LICENSE file 2020-12-29 09:21:34 +01:00
Oskar Stark
733ba619a1 [Notifier] [BC BREAK] Final classes 2020-12-29 09:18:10 +01:00
Fabien Potencier
ec9ed2ff34 feature #39592 [Notifier] [BC BREAK] Change constructor signature for Mattermost and Esendex transport (OskarStark)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [BC BREAK] Change constructor signature for Mattermost and Esendex transport

| Q             | A
| ------------- | ---
| Branch?       | 5.x, but BC BREAK for experimental bridge
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | ---
| License       | MIT
| Doc PR        | ---

Based on https://github.com/symfony/symfony/pull/39428#issue-535936925

cc @odolbeau as you provided the bridge

Commits
-------

c5b9acf5d5 [Notifier] [BC BREAK] Change constructor signature for Mattermost and Esendex transport
2020-12-29 08:45:31 +01:00
Oskar Stark
c5b9acf5d5 [Notifier] [BC BREAK] Change constructor signature for Mattermost and Esendex transport 2020-12-29 08:45:25 +01:00
Fabien Potencier
b42dd0bb4e Add reference link 2020-12-29 08:39:30 +01:00
Fabien Potencier
37aba3db51 bug #39637 [Security] Fix event propagation for AuthenticationTokenCreatedEvent when globally registered (scheb)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Fix event propagation for AuthenticationTokenCreatedEvent when globally registered

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

As promised, here's the follow-up to #39621, fixing `AuthenticationTokenCreatedEvent` to be propated from the global event dispatcher to firewall-specific event dispatchers.

The event was added in Symfony 5.2, therefore the separate PR targeting the 5.2 branch.

Commits
-------

68aaf4f916 Add AuthenticationTokenCreatedEvent to be propagated
2020-12-29 08:25:13 +01:00
Fabien Potencier
df5dcc34b3 feature #39643 [PhpUnitBridge] Remove obsolete polyfills (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[PhpUnitBridge] Remove obsolete polyfills

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

PhpUnitBridge 5.3 requires PHPUnit 7.5 or later. This PR proposes to remove all polyfilled methods that already exist in PHPUnit 7.5 because they're essentially dead code.

Commits
-------

90e0f5a97d [PhpUnitBridge] Remove obsolete polyfills.
2020-12-29 08:23:24 +01:00
Fabien Potencier
e7071bdcd4 bug #39647 [Validator] Update Isin message to match the translation files (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[Validator] Update Isin message to match the translation files

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

Commits
-------

add3cdd623 [Validator] Update Isin message to match the translation files.
2020-12-29 08:18:41 +01:00
Alexander M. Turek
40677a014e minor #39646 Update README.md (abdounikarim)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.

Discussion
----------

Update README.md

update readme semver link to use https

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

I just update semver link to use https instead of http. 😉

Commits
-------

9ee2dc6d66 Update README.md
2020-12-29 01:30:08 +01:00
Alexander M. Turek
add3cdd623 [Validator] Update Isin message to match the translation files. 2020-12-29 01:25:50 +01:00
Alexander M. Turek
eb1669069b [PhpUnitBridge] Modernize CoverageListener 2020-12-29 01:19:31 +01:00
Abdouni Abdelkarim
9ee2dc6d66
Update README.md
update semver link to use https
2020-12-29 01:17:49 +01:00
Alexander M. Turek
90e0f5a97d [PhpUnitBridge] Remove obsolete polyfills. 2020-12-28 23:22:29 +01:00
Nicolas Grekas
48803a9444 Merge branch '5.2' into 5.x
* 5.2:
  [ProxyManagerBridge] Fix tests
  [Messenger] Fix stopwach usage if it has been reset
2020-12-28 22:49:29 +01:00
Nicolas Grekas
c0d12ed98f Merge branch '5.1' into 5.2
* 5.1:
  [ProxyManagerBridge] Fix tests
  [Messenger] Fix stopwach usage if it has been reset
2020-12-28 22:49:17 +01:00
Nicolas Grekas
1c91f55482 Merge branch '4.4' into 5.1
* 4.4:
  [ProxyManagerBridge] Fix tests
  [Messenger] Fix stopwach usage if it has been reset
2020-12-28 22:49:04 +01:00
Nicolas Grekas
cd0db690f8 [ProxyManagerBridge] Fix tests 2020-12-28 22:45:17 +01:00
Christian Scheb
68aaf4f916 Add AuthenticationTokenCreatedEvent to be propagated 2020-12-28 12:33:27 +01:00
Fabien Potencier
bbe1bb77ef bug #39598 [Messenger] Fix stopwach usage if it has been reset (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix stopwach usage if it has been reset

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

I'm slowly migrating an application to messenger (from swarrot) and I
hit a strange bug. My message was well processeed **BUT** retry!

It comes from two things

* I manually reset the application (via the service resetter, to keep a
low memory usage)
* symfony/messenger try to collect some information, but since the
stopwatch has been reset, an exception occurs and the message has been
retried

So this patch avoid throwing an exception when everything works well

<details>

<summary>the trace:</summary>

```

18:45:41 INFO      [messenger] Message AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage handled by AppBundle\Crawler\Messenger\MessageHandler\CrawlSitemapMessageHa
ndler::__invoke
[
  "message" => AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage^ {
    -crawlId: "885d23a7-8ad5-4935-a2b3-1c114ac76ded"
  },
  "class" => "AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage",
  "handler" => "AppBundle\Crawler\Messenger\MessageHandler\CrawlSitemapMessageHandler::__invoke"
]
18:45:41 ERROR     [messenger] Error thrown while handling message AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage. Sending for retry #1 using 1000 ms delay. Erro
r: "Event ""Symfony\Component\Messenger\Middleware\HandleMessageMiddleware" on "messenger.bus.default"" is not started."
[
  "message" => AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage^ {
    -crawlId: "885d23a7-8ad5-4935-a2b3-1c114ac76ded"
  },
  "class" => "AppBundle\Crawler\Messenger\Message\CrawlSitemapMessage",
  "retryCount" => 1,
  "delay" => 1000,
  "error" => "Event ""Symfony\Component\Messenger\Middleware\HandleMessageMiddleware" on "messenger.bus.default"" is not started.",
  "exception" => LogicException {
    #message: "Event ""Symfony\Component\Messenger\Middleware\HandleMessageMiddleware" on "messenger.bus.default"" is not started."
    #code: 0
    #file: "./vendor/symfony/symfony/src/Symfony/Component/Stopwatch/Section.php"
    #line: 142
    trace: {
      ./vendor/symfony/symfony/src/Symfony/Component/Stopwatch/Section.php:142 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Stopwatch/Stopwatch.php:126 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php:75 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php:83 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php:74 { …}
      ./src/Middleware/ResetApplicationMiddlerwareMiddleware.php:14 {
        AppBundle\Middleware\ResetApplicationMiddlerwareMiddleware->handle(Envelope $envelope, StackInterface $stack): Envelope^
        ›     echo "couocu";
        ›     return $stack->next()->handle($envelope, $stack);
        › }
      }
      ./vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Messenger/DoctrinePingConnectionMiddleware.php:34 { …}
      ./vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Messenger/AbstractDoctrineMiddleware.php:45 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/FailedMessageProcessingMiddleware.php:34 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/DispatchAfterCurrentBusMiddleware.php:68 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/RejectRedeliveredMessageMiddleware.php:48 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/AddBusNameStampMiddleware.php:37 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php:43 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/MessageBus.php:80 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/TraceableMessageBus.php:41 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/RoutableMessageBus.php:54 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Worker.php:114 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Worker.php:77 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php:198 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:255 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:989 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:290 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:82 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:166 { …}
      ./bin/console:29 { …}
    }
  }
]

```

</details>

Commits
-------

bf4b0cc022 [Messenger] Fix stopwach usage if it has been reset
2020-12-28 11:10:10 +01:00
Nicolas Grekas
b69538ee8a Merge branch '5.2' into 5.x
* 5.2:
  [FrameworkBundle][RateLimiter] Update typos in config
  Handle ValueErrors triggered by ext-uuid on PHP 8
  Add test case to ensure all security events are propagated
2020-12-28 10:56:53 +01:00
Grégoire Pineau
bf4b0cc022 [Messenger] Fix stopwach usage if it has been reset 2020-12-28 10:51:48 +01:00
Nicolas Grekas
68c6027a21 Merge branch '5.1' into 5.2
* 5.1:
  Handle ValueErrors triggered by ext-uuid on PHP 8
  Add test case to ensure all security events are propagated
2020-12-28 10:48:24 +01:00
Nyholm
2a807f9e29
bug #39636 [Uid] Handle ValueErrors triggered by ext-uuid on PHP 8 (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[Uid] Handle ValueErrors triggered by ext-uuid on PHP 8

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

Follows symfony/polyfill#318.

On PHP 8, the UUID extension triggers `ValueErrors` if we pass an invalid UUID to one of the `uuid_*` functions. This PR handles those errors so that the component behaves the same on PHP 7 and 8.

Commits
-------

5305170e54 Handle ValueErrors triggered by ext-uuid on PHP 8
2020-12-28 09:18:54 +01:00
Fabien Potencier
b6fdd6dd3f feature #39606 [Notifier] [Slack] Validate token syntax (OskarStark)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [Slack] Validate token syntax

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

This PR follows https://github.com/symfony/symfony/issues/39560

@odolbeau @malteschlueter @norkunas @fabpot can you confirm all your tokens start with `xox`?

_From the Slack documentation:_
* Bot user token strings begin with `xoxb-`
* User token strings begin with `xoxp-`
* Workspace access token strings begin with `xoxa-2`

Commits
-------

59f29c592b [Notifier] [Slack] Validate token syntax
2020-12-28 09:15:22 +01:00
Oskar Stark
59f29c592b [Notifier] [Slack] Validate token syntax 2020-12-28 09:15:15 +01:00
Wouter de Jong
4fc2d90884 minor #39635 [FrameworkBundle][RateLimiter] Update typos in config (Nyholm)
This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[FrameworkBundle][RateLimiter] Update typos in config

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

This is just a super minor

Commits
-------

1b4ab3e3a2 [FrameworkBundle][RateLimiter] Update typos in config
2020-12-28 00:13:50 +01:00
Nyholm
1b4ab3e3a2 [FrameworkBundle][RateLimiter] Update typos in config 2020-12-28 00:13:43 +01:00
Wouter de Jong
3c50aac95b minor #39630 [Security] Add test to ensure all security events are propagated (scheb)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Add test to ensure all security events are propagated

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

Follow-up to #39621. As requested by @wouterj I'm adding a dedicated test case to ensure the security events are propagated from global to firewall-level event dispatcher.

I'll file another PR to add `AuthenticationTokenCreatedEvent` as soon as this has been merged and copied to the 5.2 branch, that I need to target for the `AuthenticationTokenCreatedEvent` change.

Happy holidays!

Commits
-------

e78adf7604 Add test case to ensure all security events are propagated
2020-12-28 00:10:29 +01:00
Alexander M. Turek
5305170e54 Handle ValueErrors triggered by ext-uuid on PHP 8 2020-12-27 21:49:37 +01:00
Alexander M. Turek
4a053e5fed Merge branch '5.2' into 5.x
* 5.2:
  CS: Apply ternary_to_null_coalescing fixer
2020-12-27 14:21:48 +01:00
Alexander M. Turek
6bf07f2bc9 Merge branch '5.1' into 5.2
* 5.1:
  CS: Apply ternary_to_null_coalescing fixer
2020-12-27 14:15:00 +01:00
Alexander M. Turek
eb4b003bc1 Merge branch '4.4' into 5.1
* 4.4:
  CS: Apply ternary_to_null_coalescing fixer
2020-12-27 14:04:50 +01:00
Alexander M. Turek
fc794e5964 minor #39632 CS: Apply ternary_to_null_coalescing fixer (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

CS: Apply ternary_to_null_coalescing fixer

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

Since we don't need to support PHP 5 anymore, we can upgrade our older code to use the null coalescing operator and enforce its usage through our PHP CS Fixer configuration. I think, the usage of that operator improves the readability of our codebase at lot.

Note that the changes in this PR are (with the exception of `.php_cs.dist`) completely automated. You should get the same results by running the following command (and reverting the changes to PhpUnitBridge afterwards).

```sh
php-cs-fixer fix --rules='{"ternary_to_null_coalescing":true}' src
```

Commits
-------

07c4773d98 CS: Apply ternary_to_null_coalescing fixer
2020-12-27 13:58:34 +01:00
Christian Scheb
e78adf7604 Add test case to ensure all security events are propagated 2020-12-27 11:30:54 +01:00
Alexander M. Turek
07c4773d98 CS: Apply ternary_to_null_coalescing fixer 2020-12-27 00:49:32 +01:00