Commit Graph

45001 Commits

Author SHA1 Message Date
Nicolas Grekas
0272b8d341 [travis] Fix build-packages script 2019-10-07 14:36:18 +02:00
Nicolas Grekas
62216ea677 minor #33770 Add types to constructors and private/final/internal methods (Batch III) (derrabus)
This PR was squashed before being merged into the 4.4 branch (closes #33770).

Discussion
----------

Add types to constructors and private/final/internal methods (Batch III)

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

Followup to #33709, this time with:
* Validator
* VarDumper
* Workflow
* Yaml
* all bridges
* all bundles

That should be the final batch. 😃

Commits
-------

6493902287 Add types to constructors and private/final/internal methods (Batch III)
2019-10-07 13:33:36 +02:00
Alexander M. Turek
6493902287 Add types to constructors and private/final/internal methods (Batch III) 2019-10-07 13:33:25 +02:00
Nicolas Grekas
199881477e feature #33743 [HttpClient] Async HTTPlug client (Nyholm)
This PR was squashed before being merged into the 4.4 branch (closes #33743).

Discussion
----------

[HttpClient] Async HTTPlug client

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #33710, Fix #32142
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12389

This PR removes `HttplugClient`'s dependency on `Psr18Client`. It will also add an `HttplugPromise` to make sure we sure we respect the Httplug's `HttpAsyncClient` interface.

It implements `HttpAsyncClient::sendAsyncRequest()` and provides two extensions:
- `HttplugPromise::cancel()` allows cancelling a promise (and the underlying response)
- `HttplugClient::wait()` allows to tick the promise pool, with configurable timeouts.

Commits
-------

4fd593f869 [HttpClient] Async HTTPlug client
2019-10-07 13:22:04 +02:00
Nyholm
4fd593f869 [HttpClient] Async HTTPlug client 2019-10-07 13:21:57 +02:00
Nicolas Grekas
ce7c0b4590 feature #33856 [Messenger] Allow to configure the db index on Redis transport (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Allow to configure the db index on Redis transport

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

Quite useful for testing.

Commits
-------

115a9bbeda [Messenger] Allow to configure the db index on Redis transport
2019-10-07 13:15:42 +02:00
Robin Chalas
115a9bbeda [Messenger] Allow to configure the db index on Redis transport 2019-10-07 13:15:32 +02:00
Pierre Gasté
d49a7387de [Mailer] added ReplyTo option for PostmarkApiTransport 2019-10-07 13:09:42 +02:00
Nicolas Grekas
38ec2f3398 minor #33882 [VarDumper] Made all casters final (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Made all casters final

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

Commits
-------

3044a91838 [VarDumper] Made all casters final
2019-10-07 13:08:27 +02:00
Nicolas Grekas
bee005687a bug #33871 [HttpClient] bugfix exploding values of headers (michaljusiega)
This PR was squashed before being merged into the 4.3 branch (closes #33871).

Discussion
----------

[HttpClient] bugfix exploding values of headers

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

I tried to use CachingHttpClient yesterday and I received an error.

```
explode() expects parameter 2 to be string, array given
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:200
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:131
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\HttpClientTrait.php:45
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\CurlHttpClient.php:105
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpClientKernel.php:54
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\SubRequestHandler.php:85
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:477
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:450
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:347
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpKernel\HttpCache\HttpCache.php:222
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\CachingHttpClient.php:96
 C:\PROJEKTY\PHPStorm\symfony\src\Symfony\Component\HttpClient\Tests\CachingHttpClientTest.php:34

```
This PR fix this.

Commits
-------

5cd8895c67 [HttpClient] bugfix exploding values of headers
2019-10-07 12:52:41 +02:00
Michał Jusięga
5cd8895c67 [HttpClient] bugfix exploding values of headers 2019-10-07 12:52:05 +02:00
Grégoire Pineau
3044a91838 [VarDumper] Made all casters final 2019-10-07 11:43:45 +02:00
Nicolas Grekas
b43f25555f feature #33881 [VarDumper] Added a support for casting Ramsey/Uuid (lyrixx)
This PR was squashed before being merged into the 4.4 branch (closes #33881).

Discussion
----------

[VarDumper] Added a support for casting Ramsey/Uuid

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

I worked on a project using ramsey/uuid and I noticed a dumped uuid does
not contain the uuid. So here we go :)

(Note: don't get me wrong, I still do not recommend this lib)

---

Before / After:
![Before / After](https://user-images.githubusercontent.com/408368/66298080-49892d80-e8f1-11e9-969f-95ae5169adb1.png)

Commits
-------

99247bbd47 [VarDumper] Added a support for casting Ramsey/Uuid
2019-10-07 11:31:57 +02:00
Grégoire Pineau
99247bbd47 [VarDumper] Added a support for casting Ramsey/Uuid 2019-10-07 11:31:51 +02:00
Christian Flothmann
7432601b8e bug #33834 [Validator] Fix ValidValidator group cascading usage (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fix ValidValidator group cascading usage

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

`$this->context->getGroup()` returns `string` or `null`.

`ContextualValidatorInterface::validate()` 3rd argument accepts an array but it must not contain `null` (its contract doesn't allow it). If it does, it will fail in `RecursiveContextualValidator::validateInGroup()` for example because of the `string` scalar type on the `$group` argument. (on 4.4)

Note that in our "common" usage of the `Valid` constraint, the group in its validator will never be `null` because this constraint has a special treatment. However, if this validator is reused in a custom way, it can fail.

Commits
-------

72684b001c [Validator] Fix ValidValidator group cascading usage
2019-10-07 11:27:57 +02:00
Nicolas Grekas
4364850371 minor #33866 [Intl] Update the ICU data to 65.1 (4.4 branch) (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] Update the ICU data to 65.1 (4.4 branch)

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

Commits
-------

5b2da724d7 [Intl] Update the ICU data to 65.1 (4.4 branch)
2019-10-07 10:53:37 +02:00
Nicolas Grekas
718fb38db0 minor #33877 Remove useless testCanCheckIfTerminalIsInteractive test case (ostrolucky)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove useless testCanCheckIfTerminalIsInteractive test case

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

This test case does not work for following reasons:
1. `$inputStream` is `NULL`. `posix_isatty` happily swallows null and returns `true`. Test would have to use [CommandTester::setInputs](ac4e9b0b26/src/Symfony/Component/Console/Tester/CommandTester.php (L66)) or call `$tester->getInput()->setStream()` to fix this
1. Even if 1. is fixed, there are no internal `posix_isatty` calls going on. [ApplicationTester calls setInteractive only when such option is passed](b0a3208588/src/Symfony/Component/Console/Tester/ApplicationTester.php (L66)), otherwise it will never be marked as interactive

Commits
-------

a84e4e021a Remove useless testCanCheckIfTerminalIsInteractive test case
2019-10-07 10:40:10 +02:00
Nicolas Grekas
54ba699eb6 minor #33880 [Validator] add notice in UPGRADE file for new Range constraint option (dmaicher)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] add notice in UPGRADE file for new Range constraint option

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

There is a change in behavior as mentioned in https://github.com/symfony/symfony/issues/33700 that causes small issues on one of my apps. I only noticed it because of a test fail.

Instead of reverting this nice feature I propose to document it in the UPGRADE file so that people are aware of it.

Commits
-------

d4ab35cfab [Validator] add notice in UPGRADE file for new Range constraint option
2019-10-07 10:30:17 +02:00
David Maicher
d4ab35cfab [Validator] add notice in UPGRADE file for new Range constraint option 2019-10-07 09:03:17 +02:00
Gabriel Ostrolucký
a84e4e021a
Remove useless testCanCheckIfTerminalIsInteractive test case 2019-10-06 21:52:09 +02:00
Nicolas Grekas
b92d944e6c bug #33863 [Routing] gracefully handle docref_root ini setting (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] gracefully handle docref_root ini setting

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

Commits
-------

4d5530f8a4 [Routing] gracefully handle docref_root ini setting
2019-10-05 13:36:02 +02:00
Fabien Potencier
3a66d59326 feature #33861 [CssSelector] Support *:only-of-type (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

[CssSelector] Support *:only-of-type

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

Before, this pseudo class selector only worked when the element was specified, i.e. `p:only-of-type` would select all paragraphs which are the only child of its parent.

Now, `*:only-of-type` is also supported to select any single child.

Commits
-------

eae2ebc0d7 [CssSelector] Support *:only-of-type pseudo class selector
2019-10-05 09:08:54 +02:00
Fabien Potencier
14ccaf503e minor #33844 [Validator] Add the missing translations for the Thai ("th") locale (Atthaphon Urairat)
This PR was squashed before being merged into the 3.4 branch (closes #33844).

Discussion
----------

[Validator] Add the missing translations for the Thai ("th") locale

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

I have added the missing translations for the Thai.
Also fixed a typo on trans-unit id=54.

Commits
-------

2315be85d8 [Validator] Add the missing translations for the Thai (\"th\") locale
2019-10-05 09:00:03 +02:00
Atthaphon Urairat
2315be85d8 [Validator] Add the missing translations for the Thai (\"th\") locale 2019-10-05 08:59:57 +02:00
Jakub Zalas
eae2ebc0d7
[CssSelector] Support *:only-of-type pseudo class selector 2019-10-05 08:26:35 +02:00
Jakub Zalas
5b2da724d7
[Intl] Update the ICU data to 65.1 (4.4 branch) 2019-10-05 00:14:06 +02:00
Nicolas Grekas
2044ba8e97 Merge branch '4.3' into 4.4
* 4.3:
  [Intl] Update the ICU data to 65.1 (4.3 branch)
  Replace deprecated calls in tests
  [Intl] Update the ICU data to 65.1
  Delete 5_Security_issue.md
  [DI] Whitelist validator.auto_mapper in UnusedTagsPass
  [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method
  [Cache] give 100ms before starting the expiration countdown
  [Cache] fix logger usage in CacheTrait::doGet()
  [VarDumper] fix dumping uninitialized SplFileInfo
  Added missing translations.
  Fixed invalid changelog 4.0.0 for VarDumper
  Fixed invalid VarDumper upgrade doc.
  [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
  Don't let falsey usernames slip through
2019-10-04 23:43:27 +02:00
Nicolas Grekas
2e92ffe9d8 minor #33862 [Intl] Update the ICU data to 65.1 (4.3 branch) (jakzal)
This PR was merged into the 4.3 branch.

Discussion
----------

[Intl] Update the ICU data to 65.1 (4.3 branch)

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

A follow up to #33852.

Commits
-------

1410f849a5 [Intl] Update the ICU data to 65.1 (4.3 branch)
2019-10-04 23:41:39 +02:00
Jakub Zalas
1410f849a5
[Intl] Update the ICU data to 65.1 (4.3 branch) 2019-10-04 23:18:34 +02:00
Nicolas Grekas
f2056e88ba minor #33864 Replace deprecated calls in tests (jakzal)
This PR was merged into the 4.3 branch.

Discussion
----------

Replace deprecated calls in tests

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

Commits
-------

5aee2f140b Replace deprecated calls in tests
2019-10-04 23:15:56 +02:00
Jakub Zalas
5aee2f140b
Replace deprecated calls in tests 2019-10-04 23:11:33 +02:00
Nicolas Grekas
4d5530f8a4 [Routing] gracefully handle docref_root ini setting 2019-10-04 22:57:10 +02:00
Nicolas Grekas
6016070132 bug #33846 [Cache] give 100ms before starting the expiration countdown (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] give 100ms before starting the expiration countdown

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

Because the expiration count-down starts immediately after calling `CachItem::expiresAfter(N)`, it's impossible to actually cache items for more than `N-1` seconds.

This PR adds a 0.1s grace period so that backends that have a second-level resolution can store the items for `N` seconds, provided the time between calling `CachItem::expiresAfter(N)` and saving the value to the backend is lower than 0.1s.

This PR also fixes the calculation of the computation time in `ContractsTrait`.

Commits
-------

ba63e181fd [Cache] give 100ms before starting the expiration countdown
2019-10-04 22:48:32 +02:00
Nicolas Grekas
1124809895 bug #33853 [HttpClient] fix "no_proxy" option ignored in NativeHttpClient (Harry-Dunne)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix "no_proxy" option ignored in NativeHttpClient

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

Allow overriding of no_proxy environment variable by passing no_proxy option in NativeHttpClient::request() method.

Commits
-------

e4fb58d1b8 [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method
2019-10-04 22:46:01 +02:00
Nicolas Grekas
1d0a0774ab Merge branch '3.4' into 4.3
* 3.4:
  [Intl] Update the ICU data to 65.1
  [VarDumper] fix dumping uninitialized SplFileInfo
  Added missing translations.
  Fixed invalid VarDumper upgrade doc.
  [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
  Don't let falsey usernames slip through
2019-10-04 21:48:13 +02:00
Nicolas Grekas
14d0e27bf0 minor #33852 [Intl] Update the ICU data to 65.1 (jakzal)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Update the ICU data to 65.1

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

Commits
-------

5cc9811fa9 [Intl] Update the ICU data to 65.1
2019-10-04 21:42:13 +02:00
Yonel Ceruto
ede6b49182 minor #33857 [DI] Whitelist validator.auto_mapper in UnusedTagsPass (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Whitelist validator.auto_mapper in UnusedTagsPass

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

Commits
-------

811758c [DI] Whitelist validator.auto_mapper in UnusedTagsPass
2019-10-04 15:11:37 -04:00
Jakub Zalas
5cc9811fa9
[Intl] Update the ICU data to 65.1 2019-10-04 20:48:33 +02:00
Nicolas Grekas
5c4f2a972a bug #33841 [VarDumper] fix dumping uninitialized SplFileInfo (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix dumping uninitialized SplFileInfo

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

Commits
-------

b0f42333a5 [VarDumper] fix dumping uninitialized SplFileInfo
2019-10-04 20:45:27 +02:00
Nicolas Grekas
c458e4bda7 minor #33860 Delete 5_Security_issue.md, in favor of GitHub SECURITY.md (ro0NL)
This PR was merged into the 4.3 branch.

Discussion
----------

Delete 5_Security_issue.md, in favor of GitHub SECURITY.md

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This seems kinda duplicate today:

![image](https://user-images.githubusercontent.com/1047696/66231230-45d58b00-e6e6-11e9-8cde-50e05c0080df.png)

(https://github.com/symfony/symfony/issues/new/choose)

Commits
-------

84d62eb317 Delete 5_Security_issue.md
2019-10-04 20:44:53 +02:00
Nicolas Grekas
3786d4e799 bug #33842 [Cache] fix logger usage in CacheTrait::doGet() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix logger usage in CacheTrait::doGet()

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

Commits
-------

ca6515cc76 [Cache] fix logger usage in CacheTrait::doGet()
2019-10-04 20:44:12 +02:00
Roland Franssen
84d62eb317
Delete 5_Security_issue.md 2019-10-04 20:40:56 +02:00
Yonel Ceruto
80f545b8cf minor #33858 [DI] Whitelist error_renderer.renderer tag in UnusedTagsPass (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Whitelist error_renderer.renderer tag  in UnusedTagsPass

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

Commits
-------

82644dd [DI] Whitelist error_renderer.renderer tag  in UnusedTagsPass
2019-10-04 14:36:50 -04:00
Robin Chalas
82644dd904 [DI] Whitelist error_renderer.renderer tag in UnusedTagsPass 2019-10-04 19:54:05 +02:00
Robin Chalas
811758c82c [DI] Whitelist validator.auto_mapper in UnusedTagsPass 2019-10-04 19:45:43 +02:00
Yonel Ceruto
21bc1914d2 minor #33855 [Form] Update CHANGELOG.md (ro0NL)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Update CHANGELOG.md

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

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

Commits
-------

332128f Update CHANGELOG.md
2019-10-04 13:32:45 -04:00
Roland Franssen
332128f972
Update CHANGELOG.md 2019-10-04 19:10:58 +02:00
Eric Grimois
e4fb58d1b8 [HttpClient] Fixed #33832 NO_PROXY option ignored in NativeHttpClient::request() method 2019-10-04 17:43:55 +02:00
Nicolas Grekas
8f92594576 feature #33793 [EventDispatcher] A compiler pass for aliased userland events (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] A compiler pass for aliased userland events

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

Since 4.3, the EventDispatcher component allows to register events via the FQCN of the class name instead of a dedicated event name.

Earlier this year I have worked with a team that used the event dispatcher for own custom events. When 4.3 was released, the team decided to use the new mechanism for new events. For the sake of consistency, we also wanted to migrate existing event subscribers to FQCN events.

While FrameworkBundle implements a nice aliasing mechanism for its own events, we couldn't find an obvious way to make use of FQCN event aliases for our own events. The best way we could find is registering a compiler pass that would extend an internal parameter that stores all event aliases. But that made us feel like we're fiddling with an implementation detail of the framework.

This PR aims to provide a standard way for applications and third-party bundles to register their own event aliases.

```php
$container->addCompilerPass(new EventAliasesPass([
    MyCustomEvent::class => 'my_custom_event',
]));
```

Furthermore, it adds tests for class aliasing to the component's test suite. Additionally, the newly introduced pass is dogfooded by the SecurityBundle, so FrameworkBundle doesn't need to know about events fired by the security components.

Commits
-------

34efe40371 [EventDispatcher] A compiler pass for aliased userland events.
2019-10-04 13:06:19 +02:00
Alexander M. Turek
34efe40371 [EventDispatcher] A compiler pass for aliased userland events. 2019-10-04 13:01:02 +02:00