Commit Graph

42065 Commits

Author SHA1 Message Date
Farid Jalilov 67fbae1dbf [Mime][HttpFoundation] Added mime type audio/x-hx-aac-adts 2019-05-22 15:16:28 +02:00
Nicolas Grekas f93e252f6a bug #31541 [DI] fix using bindings with locators of service subscribers (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix using bindings with locators of service subscribers

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Spotted during the workshop in Sao Paulo, with @tsantos84, @andreia and others :)

Commits
-------

7146b95303 [DI] fix using bindings with locators of service subscribers
2019-05-22 15:07:19 +02:00
Nicolas Grekas b60872b1cf bug #31568 [Process] Fix infinite waiting for stopped process (mshavliuk)
This PR was squashed before being merged into the 3.4 branch (closes #31568).

Discussion
----------

[Process] Fix infinite waiting for stopped process

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31548
| License       | MIT

### Description
Add a regression test `Symfony\Component\Process\Tests\ProcessTest:testWaitStoppedDeadProcess` to reproduce the related bug #31548 . It consists of one file `ErrorProcessInitiator.php`, which executes as another process because otherwise if `Process::wait()` goes in an infinite loop (which is test checks) it will be impossible to handle it and stop test correctly.

The second commit contains bug fix, which is only `$this->checkTimeout();` call, that prevents infinite loop.

Commits
-------

6b9ee1e1c5 [Process] Fix infinite waiting for stopped process
2019-05-22 14:54:17 +02:00
mshavliuk 6b9ee1e1c5 [Process] Fix infinite waiting for stopped process 2019-05-22 14:54:11 +02:00
Nicolas Grekas 52398736af feature #31543 [DI] deprecate short callables in yaml (nicolas-grekas)
This PR was merged into the 4.4-dev branch.

Discussion
----------

[DI] deprecate short callables in yaml

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11589

This deprecates defining factories as `foo:method` instead of `['@foo', 'method']` in yaml.

This is confusing syntax and misses the opportunity to raise an error when one does a typo and uses a single colon instead of two.

This basically reverts #19190

Commits
-------

f8a04fdda6 [DI] deprecate short callables in yaml
2019-05-22 14:51:26 +02:00
Nicolas Grekas f8a04fdda6 [DI] deprecate short callables in yaml 2019-05-22 14:49:44 +02:00
Nicolas Grekas f410691842 [Contracts] split in one package per sub-contracts 2019-05-22 14:23:29 +02:00
Nicolas Grekas ae30af9b04 minor #31570 [Security\Http] fix phpdoc (keksa)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security\Http] fix phpdoc

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not needed
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixes phpdoc to correct format.

Commits
-------

45a8f893ef fix phpdoc
2019-05-22 14:15:46 +02:00
martijn 13ee1fa2b7 Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler. 2019-05-22 11:43:54 +02:00
Fabien Potencier 1cd99eaaa8 bumped Symfony version to 4.3.0 2019-05-22 11:41:49 +02:00
Fabien Potencier b7366a26b9
Merge pull request #31577 from fabpot/release-4.3.0-BETA2
released v4.3.0-BETA2
2019-05-22 11:37:44 +02:00
Fabien Potencier de65819399 updated VERSION for 4.3.0-BETA2 2019-05-22 11:37:23 +02:00
Fabien Potencier 5942fc48e9 updated CHANGELOG for 4.3.0-BETA2 2019-05-22 11:37:08 +02:00
Ondrej Exner 45a8f893ef
fix phpdoc 2019-05-22 09:57:24 +02:00
Fabien Potencier 274ff66265 bug #31569 [HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined (GawainLynch)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Regards the constants:

 - CURLMOPT_MAX_HOST_CONNECTIONS is available since PHP 7.0.7 and cURL 7.30.0
 - CURL_VERSION_HTTP2 is available since PHP 5.5.24 and 5.6.8 and cURL 7.33.0

Errors triggered:

> Use of undefined constant CURLMOPT_MAX_HOST_CONNECTIONS - assumed 'CURLMOPT_MAX_HOST_CONNECTIONS'
> in vendor/symfony/http-client/CurlHttpClient.php (line 73)

> Use of undefined constant CURL_VERSION_HTTP2 - assumed 'CURL_VERSION_HTTP2'
> in vendor/symfony/http-client/CurlHttpClient.php (line 191)

Commits
-------

4ea7283138 [HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined
2019-05-22 09:29:21 +02:00
Gawain Lynch 4ea7283138
[HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined
- CURLMOPT_MAX_HOST_CONNECTIONS is available since PHP 7.0.7 and cURL 7.30.0
 - CURL_VERSION_HTTP2 is available since PHP 5.5.24 and 5.6.8 and cURL 7.33.0
2019-05-22 06:50:01 +02:00
Nicolas Grekas 31ba038126 bug #31566 [Security] fixed a fatal error when upgrading from 4.2 (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security] fixed a fatal error when upgrading from 4.2

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This is needed when upgrading a project from 4.2 to 4.3 to avoid a fatal PHP error when unserializing a token serialized on 4.2.

Commits
-------

cd63446f9b [Security] fixed a fatal error when upgrading from 4.2
2019-05-21 22:19:56 +02:00
Fabien Potencier cd63446f9b [Security] fixed a fatal error when upgrading from 4.2 2019-05-21 22:19:00 +02:00
Nicolas Grekas 7f43878d9c bug #31219 [HttpClient] Allow arrays as query parameters (sleepyboy)
This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #31219).

Discussion
----------

[HttpClient] Allow arrays as query parameters

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This PR allows passing arrays as query parameters.

For instance, if I pass $options['query']['category'] = ['news', 'sport', 'culture'] to my GET request, I expect this to be transformed to URL?category[]=news&category[]=sport&category[]=culture.

I added two tests to cover this functionality. I also fixed one of the tests where "+" wasn't encoded as %20 in the final URL.

Commits
-------

1cbefd7fca [HttpClient] Allow arrays as query parameters
2019-05-21 18:51:52 +02:00
Andriy Prokopenko 1cbefd7fca [HttpClient] Allow arrays as query parameters 2019-05-21 18:51:43 +02:00
Nicolas Grekas aedd52eab7 minor #31553 [Ldap] add a test on parsing the rdn (Simperfit)
This PR was merged into the 4.3 branch.

Discussion
----------

[Ldap] add a test on parsing the rdn

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| 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/roadmap):
 - 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 the master branch.
-->

One more test on the rdn directly.

- [x] When #31552 has been merged this one needs to be rebased.

Commits
-------

0abe32b085 [Ldap] add a test on parsing the rdn
2019-05-21 18:00:28 +02:00
Fabien Potencier 987e1cf525 bug #31482 [Messenger][DoctrineBridge] Throws UnrecoverableMessageHandlingException when passed invalid entity manager name (Koc)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger][DoctrineBridge] Throws UnrecoverableMessageHandlingException when passed invalid entity manager name

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | not sure
| Deprecations? | no
| Tests pass?   | Waiting for Travis
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

1. Throws `UnrecoverableMessageHandlingException` and do not retry messages if middlewares missconfigured
2.  `getManager()` doesn't return null. Actually [it throws](https://github.com/doctrine/persistence/blob/master/lib/Doctrine/Persistence/AbstractManagerRegistry.php#L144-L160) `\InvalidArgumentException` in requested entity manager not exists.

Not sure, should this changes considered as BC-break.

Also I can extract abstract Doctrine middleware but not sure what branch should I use for it? Master or 4.3?

Commits
-------

c4eca27149 Throws UnrecoverableMessageHandlingException when passed invalid entity manager name for Doctrine middlewares
2019-05-21 08:58:01 +02:00
Konstantin Myakshin c4eca27149 Throws UnrecoverableMessageHandlingException when passed invalid entity manager name for Doctrine middlewares 2019-05-21 09:09:55 +03:00
Fabien Potencier 65458059d8 feature #31471 [Messenger] Add "non sendable" stamps (weaverryan)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Add "non sendable" stamps

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31460
| License       | MIT
| Doc PR        | not needed

Fixes a bug where Symfony serialization of the AmqpReceivedStamp sometimes caused problems.

It's still a mystery why the `AmqpReceivedStamp` caused a segfault *sometimes* when going through the Symfony serializer or the `VarDumper`. But, that stamp really didn't need to be sent on redelivery anyways.

I don't love making the removal the responsibility of the serializers, but it didn't work well anywhere else.

Cheers!

Commits
-------

34e7781c5c Adding a new NonSendableStampInterface to avoid sending certain stamps
2019-05-21 06:57:28 +02:00
Fabien Potencier 6fb05dc8dc bug #31545 [Messenger] Fix redis Connection::get() should be non blocking by default (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix redis Connection::get() should be non blocking by default

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | todo

The `\Redis::xreadgroup()` method waits until a message arrives or the specified timeout is reached before returning, which means that `RedisExt\Connection::get()` is blocking.
That's inconsistent with other transports which all returns immediately in case there is no message, for instance the AMQP transport uses `\Amqp::get()` instead of `\Amqp::consume()` for this reason.
It also short-circuits the worker's stop logic: both the `--time-limit` option of the `messenger:consume` command and the `messenger:stop-workers` don't work with the redis transport.
This returns early in case the message count is 0 and no blocking timeout has been configured.

Commits
-------

229502a89a [Messenger] Make redis Connection::get() non blocking by default
2019-05-21 06:50:56 +02:00
Robin Chalas 229502a89a [Messenger] Make redis Connection::get() non blocking by default 2019-05-21 04:46:48 +02:00
Nicolas Grekas beb603694d Merge branch '4.3'
* 4.3: (23 commits)
  minor: add some test in the ldap component
  [Workflow] Update MethodMarkingStore
  [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
  adding experimental note
  [HttpClient] add missing argument check
  [Messenger] Fix undefined index on read timeout
  [Workflow] use method marking store
  [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
  fixed a phpdoc
  [Debug] Wrap call to require_once in a try/catch
  [EventDispatcher] Removed "callable" type hint from WrappedListener constructor
  prevent deprecation when filesize matches error code
  [PropertyInfo] Add missing documentation link in Readme
  Use the current working dir as default first arg in 'link' binary
  Respect parent class contract in ContainerAwareDoctrineEventManager
  [WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object
  [Validator] Add the missing translations for the Danish ("da") locale
  [PropertyAccess] Add missing property to PropertyAccessor
  [Cache] fix saving unrelated keys in recursive callback calls
  [Serializer] Fix denormalization of object with variadic constructor typed argument
  ...
2019-05-20 18:28:43 +02:00
Amrouche Hamza 0abe32b085
[Ldap] add a test on parsing the rdn 2019-05-20 18:28:42 +02:00
Nicolas Grekas 2ecad3ffa9 Merge branch '4.2' into 4.3
* 4.2:
  minor: add some test in the ldap component
  [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
  [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
  fixed a phpdoc
  [Debug] Wrap call to require_once in a try/catch
  prevent deprecation when filesize matches error code
  [PropertyInfo] Add missing documentation link in Readme
  Use the current working dir as default first arg in 'link' binary
  Respect parent class contract in ContainerAwareDoctrineEventManager
  [Validator] Add the missing translations for the Danish ("da") locale
  [PropertyAccess] Add missing property to PropertyAccessor
  [Cache] fix saving unrelated keys in recursive callback calls
  [Serializer] Fix denormalization of object with variadic constructor typed argument
  Allow set 'None' on samesite cookie flag
  Making cache rebuild correctly with MessageSubscriberInterface return values
  Fix finding parent definition
2019-05-20 18:16:12 +02:00
Nicolas Grekas 48258fc12e Merge branch '3.4' into 4.2
* 3.4:
  minor: add some test in the ldap component
  [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
  [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
  fixed a phpdoc
  [Debug] Wrap call to require_once in a try/catch
  [PropertyInfo] Add missing documentation link in Readme
  Use the current working dir as default first arg in 'link' binary
  Respect parent class contract in ContainerAwareDoctrineEventManager
  [Validator] Add the missing translations for the Danish ("da") locale
  [Serializer] Fix denormalization of object with variadic constructor typed argument
  Allow set 'None' on samesite cookie flag
2019-05-20 18:15:26 +02:00
Nicolas Grekas 9e4d5ff47d minor #31552 [Ldap] add a test to getResources and binding (Simperfit)
This PR was merged into the 3.4 branch.

Discussion
----------

[Ldap] add a test to getResources and binding

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| 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/roadmap):
 - 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 the master branch.
-->

We could add more unit tests, but this is a beginning.

Commits
-------

d08f195502 minor: add some test in the ldap component
2019-05-20 18:00:08 +02:00
Amrouche Hamza d08f195502
minor: add some test in the ldap component 2019-05-20 14:59:43 +02:00
Nicolas Grekas 0c1a3dcdfb minor #31536 [Workflow] Update MethodMarkingStore (noniagriconomie)
This PR was squashed before being merged into the 4.3 branch (closes #31536).

Discussion
----------

[Workflow] Update MethodMarkingStore

| Q             | A
| ------------- | ---
| Branch?       | 4.3 (related to deprecation of single/multiple marking store)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | .
| License       | MIT
| Doc PR        | already documented

Minor fix

Commits
-------

c8636523d3 [Workflow] Update MethodMarkingStore
2019-05-20 13:45:47 +02:00
Antoine Makdessi c8636523d3 [Workflow] Update MethodMarkingStore 2019-05-20 13:45:40 +02:00
Nicolas Grekas 86bc1be2cf bug #31537 [Workflow] use method marking store (noniagriconomie)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] use method marking store

| Q             | A
| ------------- | ---
| Branch?       | 4.3 (related to deprecation of single/multiple marking store)
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | .
| License       | MIT
| Doc PR        | already documented

I think the deprecation of old marking store, the single one in the statemachine, was not patched here
Or did i miss something?

Thank you

Cc @lyrixx

Commits
-------

a2191678b7 [Workflow] use method marking store
2019-05-20 13:44:45 +02:00
Nicolas Grekas 8f62674c09 minor #31550 [Mailer] adding experimental disclaimer in readme (chr-hertel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] adding experimental disclaimer in readme

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Mailer Component is marked as experimental in code, but not in readme.
got confused while checking the readme files of the new components

Commits
-------

5175f6fffc adding experimental note
2019-05-20 13:39:16 +02:00
Nicolas Grekas e24e7dcb8c bug #31551 [ProxyManager] isProxyCandidate() does not take into account interfaces (andrerom)
This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManager] isProxyCandidate() does not take into account interfaces

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | N/A

When using factories it's common best practice to use interface as class name, especially in cases
where you know implementation can differ. Before this fix ProxyManager did not allow these to be lazy.

As we have have this issue on 2.8 and 3.4. it's very hard to debug, and goes against best practice for factories to not fix it, this is suggested for 2.8.

Commits
-------

e3739b1289 [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
2019-05-20 13:36:16 +02:00
Nicolas Grekas b5dfbef3d1 bug #31542 [HttpClient] add missing argument check (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add missing argument check

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Should save some time, sometimes.

Commits
-------

964acd9110 [HttpClient] add missing argument check
2019-05-20 13:13:23 +02:00
André R e3739b1289 [Bridge\ProxyManager] isProxyCandidate() does not take into account interfaces
When using factories it's common best practice to use interface as class name, especially in cases
where you know impl can differ. Before this fix ProxyManager did not allow these to be lazy.

In our case this has lead several to hard to debug issues on classes we need to mark as lazyi
and often a need to add lazy on decorators if there are any or other workarounds.
As we have had this issue, and still have on both 2.8 and 3.4 this is opened against 2.8.
2019-05-20 13:02:42 +02:00
Christopher Hertel 5175f6fffc
adding experimental note 2019-05-20 11:28:54 +02:00
Fabien Potencier abefb53d7c bug #31544 [Messenger] Fix undefined index on read timeout (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix undefined index on read timeout

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

fd8d6b8187 [Messenger] Fix undefined index on read timeout
2019-05-19 21:00:29 +02:00
Nicolas Grekas 964acd9110 [HttpClient] add missing argument check 2019-05-19 11:37:13 -03:00
Robin Chalas fd8d6b8187 [Messenger] Fix undefined index on read timeout 2019-05-19 16:33:13 +02:00
Nicolas Grekas 7146b95303 [DI] fix using bindings with locators of service subscribers 2019-05-19 11:11:39 -03:00
Antoine Makdessi a2191678b7
[Workflow] use method marking store 2019-05-19 00:39:11 +02:00
Fabien Potencier 365a390e6e bug #31335 [Doctrine] Respect parent class contract in ContainerAwareEventManager (Koc)
This PR was merged into the 3.4 branch.

Discussion
----------

[Doctrine] Respect parent class contract in ContainerAwareEventManager

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes, failures looks unrelated
| Fixed tickets | #31051
| License       | MIT
| Doc PR        | -

According to method signature of [original EventManager](https://github.com/doctrine/event-manager/blob/master/lib/Doctrine/Common/EventManager.php#L50) `getListeners` method should return array of initialized objects but now it returns array of strings of listener service names.

Commits
-------

42d62721fd Respect parent class contract in ContainerAwareDoctrineEventManager
2019-05-18 18:38:29 +02:00
Fabien Potencier 53556290ed bug #31421 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name (przemyslaw-bogusz)
This PR was squashed before being merged into the 3.4 branch (closes #31421).

Discussion
----------

[Routing][AnnotationClassLoader] fix utf-8 encoding in default route name

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

If controller, or one of its methods, contain a unicode character and you run:
```
./bin/console debug:router
```
you get this:
![Zrzut ekranu 2019-05-8 o 14 00 48](https://user-images.githubusercontent.com/35422131/57374545-71863080-719b-11e9-999e-fe0a5051c089.png)

This PR fixes it into this:
![Zrzut ekranu 2019-05-8 o 14 00 59](https://user-images.githubusercontent.com/35422131/57374616-92e71c80-719b-11e9-9d13-5370213c22f7.png)

Commits
-------

7ab52d3c36 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name
2019-05-18 18:36:56 +02:00
Przemysław Bogusz 7ab52d3c36 [Routing][AnnotationClassLoader] fix utf-8 encoding in default route name 2019-05-18 18:36:47 +02:00
Fabien Potencier c866efa615 fixed a phpdoc 2019-05-18 18:33:51 +02:00
Fabien Potencier e606ac1916 bug #31493 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor (wskorodecki)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] Removed "callable" type hint from WrappedListener constructor

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

### The problem

```php
public function __construct(callable $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
```

The *callable* type hint will cause the following exception if you register a listener class with a method, which could not be auto-guessed by the Symfony:

`Argument 1 passed to Symfony\Component\EventDispatcher\Debug\WrappedListener::__construct() must be callable, array given`

The debug toolbar will not be displayed in this case.

This is because PHP is checking the array first before making a decision if this is a valid callable or not. So if the second array element does not represent an existing method in object from the first element - PHP will treat this as a common array, not callable. Use `is_callable` method if you need a proof.

### How to reproduce

1. Register some listener with a method, which could not be auto-guessed by Symfony
2. Do not create the `__invoke` method in the listener
3. Skip the `method` attribute in the listener configuration

Example:

```php
class SomeListener
{
    public function myListenerMethod(SomeEvent $event)
    {
        // ...
    }
}
```

```yaml
App\EventListener\SomeListener:
    tags:
      -
        name: kernel.event_listener

        # Symfony will look for "onSomeEvent" method which does not exists.
        event: 'some.event'
        #method: 'myListenerMethod' # Skip this.
```

### Solution:

Removing the type hint will cause the \Closure::fromCallable() method to throw a proper exception, for example:

`Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Failed to create closure from callable: class 'App\EventListener\SomeListener' does not have a method 'onSomeEvent'`

Commits
-------

20c587fc23 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor
2019-05-18 18:11:27 +02:00