Commit Graph

36742 Commits

Author SHA1 Message Date
Tobias Schultze
198925ee4e [Messenger] implement several senders using a ChainSender 2018-05-16 15:12:01 +02:00
Samuel ROZE
f59ce97eff feature #27128 [Messenger] Middleware factories support in config (ogizanagi)
This PR was squashed before being merged into the 4.1 branch (closes #27128).

Discussion
----------

[Messenger] Middleware factories support in config

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no  <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo

Following https://github.com/symfony/symfony/pull/26864, this would allow to configure easily the middlewares by using an abstract factory definition to which are provided simple arguments (just scalars, no services references).

For instance, here is how the DoctrineBundle would benefit from such a feature (also solving the wiring of the `DoctrineTransactionMiddleware` reverted in https://github.com/symfony/symfony/pull/26684):

```yaml
framework:
    messenger:
      buses:
        default:
          middleware:
            - logger
            - doctrine_transaction_middleware: ['entity_manager_name']
```

where `doctrine_transaction_middleware` would be an abstract factory definition provided by the doctrine bundle:

```yml
services:

    doctrine.orm.messenger.middleware_factory.transaction:
      class: Symfony\Bridge\Doctrine\Messenger\DoctrineTransactionMiddlewareFactory
      arguments: ['@doctrine']

    doctrine_transaction_middleware:
      class: Symfony\Bridge\Doctrine\Messenger\DoctrineTransactionMiddleware
      factory: ['@doctrine.orm.messenger.middleware_factory.transaction', 'createMiddleware']
      abstract: true
      # the default arguments to use when none provided from config.
      # i.e:
      #   middlewares:
      #     - doctrine_transaction_middleware: ~
      arguments: ['default']
```

and is interpreted as:

```yml
buses:
    default:
        middleware:
            -
                id: logger
                arguments: {  }
            -
                id: doctrine_transaction_middleware
                arguments:
                    - entity_manager_name
        default_middleware: true
```

---

<details>

<summary>Here is the whole config reference with these changes: </summary>

```yaml
# Messenger configuration
messenger:
    enabled:              true
    routing:

        # Prototype
        message_class:
            senders:              []
    serializer:
        enabled:              true
        format:               json
        context:

            # Prototype
            name:                 ~
    encoder:              messenger.transport.serializer
    decoder:              messenger.transport.serializer
    adapters:

        # Prototype
        name:
            dsn:                  ~
            options:              []
    default_bus:          null
    buses:

        # Prototype
        name:
            default_middleware:  true
            middleware:

                # Prototype
                -
                    id:                   ~ # Required
                    arguments:            []
```

</details>

Commits
-------

f5ef421474 [Messenger] Middleware factories support in config
2018-05-14 20:17:15 +01:00
Maxime Steinhausser
f5ef421474 [Messenger] Middleware factories support in config 2018-05-14 20:17:01 +01:00
Fabien Potencier
5f0e2d6671 bug #27214 [HttpKernel] Fix services are no longer injected into __invoke controllers method (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[HttpKernel] Fix services are no longer injected into __invoke controllers method

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27208   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

_TL;DR:_ The `RemoveEmptyControllerArgumentLocatorsPass` is the one adding the `Controller::_invoke` => `Controller` shortcut missing from the service locator. It isn't properly executed on some cases. This fixes it.

Since https://github.com/symfony/symfony/pull/26833, the resolvers are decorated by a `TraceableValueResolver`, which usually isn't much an issue to deal within passes. But the `RemoveEmptyControllerArgumentLocatorsPass` happens late (`TYPE_BEFORE_REMOVING`), when decoration inheritance is already resolved, so accessing `$controllerLocator = $container->getDefinition((string) $serviceResolver->getArgument(0));` isn't accessing the controller locator, but the decorated service instead.

Commits
-------

ee44903fd0 [HttpKernel] Fix services are no longer injected into __invoke controllers method
2018-05-14 08:47:00 +02:00
Fabien Potencier
906a05c43f minor #27252 [HttpKernel] Make TraceableValueResolver $stopwatch mandatory (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[HttpKernel] Make TraceableValueResolver $stopwatch mandatory

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/pull/26833#discussion_r181997515   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

I understand why this was suggested in https://github.com/symfony/symfony/pull/26833#discussion_r181997515, but as stated by @iltar , I don't think it makes sense to register a traceable resolver instantiating a Stopwatch itself, as there is no way to fetch it and wouldn't be a shared instance, probably defeating the feature and registering a useless decorator.
Instead, let's make the stopwatch mandatory and make the service id to use in the pass configurable.

Commits
-------

585ae7c646 [HttpKernel] Make TraceableValueResolver $stopwatch mandatory
2018-05-14 08:40:41 +02:00
Maxime Steinhausser
585ae7c646 [HttpKernel] Make TraceableValueResolver $stopwatch mandatory 2018-05-13 20:52:09 +02:00
Fabien Potencier
8335537446 feature #27202 [Messenger] Improve the profiler panel (ogizanagi)
This PR was squashed before being merged into the 4.1 branch (closes #27202).

Discussion
----------

[Messenger] Improve the profiler panel

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #26597  issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This is an attempt to enhance the profiler panel a bit.

**with the following messages dispatched:**

```php
$queryBus->dispatch(Envelope::wrap(new GetGreetingsQuery('Hello you'))
    ->with(new JustAFriendOfMine())
    ->with(new AndHisPlusO̶n̶e̶Eleven())
);
$commandBus->dispatch(new SendGiftCommand());
$queryBus->dispatch(new GetGreetingsQuery('Exterminate!'));
```

## Before

<img width="1084" alt="screenshot 2018-05-12 a 13 57 57" src="https://user-images.githubusercontent.com/2211145/39957055-8a0f009e-55ec-11e8-9d8e-bf79aad4b420.PNG">

🐛calls order are wrong here, fixed in this PR

## After

### collapsed

<!-- <img width="1083" alt="screenshot 2018-05-10 a 23 51 07" src="https://user-images.githubusercontent.com/2211145/39896093-19a8c7ee-54ad-11e8-8dcb-4e165ffd2eae.PNG">-->

<img width="1085" alt="screenshot 2018-05-12 a 13 18 35" src="https://user-images.githubusercontent.com/2211145/39956802-9d4c38a2-55e7-11e8-8425-ad090c0871b6.PNG">
<img width="1085" alt="screenshot 2018-05-12 a 13 26 44" src="https://user-images.githubusercontent.com/2211145/39956827-25d9e426-55e8-11e8-9116-160603649f33.PNG">

📝 _When loading the page, all messages details are collapsed by default but the first one per tab._

### expanded

<!-- <img width="1083" alt="screenshot 2018-05-10 a 23 13 39" src="https://user-images.githubusercontent.com/2211145/39894779-42c9cc9a-54a8-11e8-9529-6292481536d4.PNG"> -->

<img width="1086" alt="screenshot 2018-05-12 a 13 49 42" src="https://user-images.githubusercontent.com/2211145/39956981-639fc3d6-55eb-11e8-9224-a48f591db3da.PNG">

### live

<!-- ![mai-10-2018 23-16-17](https://user-images.githubusercontent.com/2211145/39894789-4b8fa138-54a8-11e8-986c-fccf6cd0234f.gif) -->

![mai-12-2018 13-55-40](https://user-images.githubusercontent.com/2211145/39957041-37f17b34-55ec-11e8-8569-a733a104bf82.gif)

### toolbar (with exceptions)

<img width="284" alt="screenshot 2018-05-10 a 23 18 32" src="https://user-images.githubusercontent.com/2211145/39895011-0467f2a0-54a9-11e8-9d78-25461cf71c41.PNG">

## Notes

- Table headers are clickable, so you can jump directly to the message class in the code
- Reversing headers/rows allows to have a wider space for dumps and allows to add more entries in the future. This is an issue we already have with the Validator panel (when there is both an invalid value as object and a constraint violation dumped) which I'd like to revamp soon.
- ~~I wonder if we should keep the dispatched messages in call order, or if we can segregate by bus (using tabs?).~~
- ~~we could add a left container listing messages classes only, allowing to show details of a single message dispatched on a right container (similar to what the Form panel does). I'll probably suggest the same for the Validator panel.~~

Commits
-------

3d19578297 [Messenger] Improve the profiler panel
2018-05-13 08:14:37 +02:00
Maxime Steinhausser
3d19578297 [Messenger] Improve the profiler panel 2018-05-13 08:14:09 +02:00
Fabien Potencier
c54faf4111 minor #27190 [Workflow] Added DefinitionBuilder::setMetadataStore(). (vudaltsov)
This PR was squashed before being merged into the 4.1 branch (closes #27190).

Discussion
----------

[Workflow] Added DefinitionBuilder::setMetadataStore().

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

This PR complements #26092.

Commits
-------

2882f8d8c8 [Workflow] Added DefinitionBuilder::setMetadataStore().
2018-05-11 18:37:28 +02:00
Valentin
2882f8d8c8 [Workflow] Added DefinitionBuilder::setMetadataStore(). 2018-05-11 18:37:20 +02:00
Samuel ROZE
982fc66760 feature #27034 [Messenger][DX] Uses custom method names for handlers (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger][DX] Uses custom method names for handlers

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

This has been discussed mostly in the [`MessageHandlerInterface` pull-request](https://github.com/symfony/symfony/pull/26685). For consistency reasons and convenience, this PR adds the ability to configure the method to be used on handlers:
```php
use Symfony\Component\Messenger\Handler\MessageSubscriberInterface;
use Symfony\Component\Messenger\Handler\MessageSubscriberConfiguration;

class CreateNumberMessageHandler implements MessageSubscriberInterface
{
    /**
     * {@inheritdoc}
     */
    public static function getHandledMessages(): array
    {
        return [
            CreateNumber::class => ['createNumber', 10],
            AnotherMessage::class => 'anotherMethod',
        ];
    }

    public function createNumber(CreateNumber $command)
    {
        // ...
    }
}
```

Commits
-------

2461e5119a [Messenger][DX] Uses custom method names for handlers
2018-05-11 15:17:34 +02:00
Samuel ROZE
4ef45dd03a bug #27228 [Messenger] Remove autoconfiguration for Sender/ReceiverInterface (kbond)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Remove autoconfiguration for Sender/ReceiverInterface

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

When creating a custom transport I ran into an error where the container was trying to autowire my transport and failing because it has arguments that can't be autowired.

The Transport service is created by the TransportFactory so this is not needed. (unless I am missing something)

Commits
-------

fa4ce7bbc4 [Messenger] remove autoconfiguration for Sender/ReceiverInterface
2018-05-11 15:15:15 +02:00
Samuel ROZE
2461e5119a [Messenger][DX] Uses custom method names for handlers 2018-05-11 15:00:51 +02:00
Kevin Bond
fa4ce7bbc4
[Messenger] remove autoconfiguration for Sender/ReceiverInterface 2018-05-11 08:48:51 -04:00
Tobias Schultze
497ce74f9e bug #27229 [Messenger] Rename tag attribute "name" by "alias" (yceruto)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Rename tag attribute "name" by "alias"

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

As "name" is a reserved attribute in YAML and XML schema it makes impossible to register manually a custom Sender or Receiver with another "name" attribute.

> The file ".../demos/messenger-flex/config/services.yaml" does not contain valid YAML.
Duplicate key "name" detected at line 30 (near "- { name: 'messenger.receiver', name: 'mail' }").

Commits
-------

1ef27a7e6a Rename tag attribute "name" by "alias"
2018-05-11 11:17:32 +02:00
Samuel ROZE
6988551ae3 bug #27224 [Messenger] Make sure default receiver name is set before command configuration (yceruto)
This PR was squashed before being merged into the 4.1 branch (closes #27224).

Discussion
----------

[Messenger] Make sure default receiver name is set before command configuration

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

Otherwise the receiver's name would still be required always.

3cc4a701e6/src/Symfony/Component/Console/Command/Command.php (L77)

Commits
-------

63871c9ce4 [Messenger] Make sure default receiver name is set before command configuration
2018-05-11 09:42:32 +02:00
Yonel Ceruto
63871c9ce4 [Messenger] Make sure default receiver name is set before command configuration 2018-05-11 09:42:20 +02:00
Samuel ROZE
906a27537d feature #27225 [Messenger] Autoconfiguring TransportFactoryInterface classes (yceruto)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Autoconfiguring TransportFactoryInterface classes

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

This would remove one step to create a custom transport factory.

Commits
-------

6295879a30 Autoconfiguring TransportFactoryInterface classes
2018-05-11 09:40:55 +02:00
Maxime Steinhausser
ee44903fd0 [HttpKernel] Fix services are no longer injected into __invoke controllers method 2018-05-10 23:46:14 +02:00
Yonel Ceruto
1ef27a7e6a Rename tag attribute "name" by "alias" 2018-05-10 17:13:07 -04:00
Yonel Ceruto
6295879a30 Autoconfiguring TransportFactoryInterface classes 2018-05-10 13:03:14 -04:00
Samuel ROZE
3cc4a701e6 bug #27220 [Messenger] Fix new AMQP Transport test with Envelope & fix contract (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix new AMQP Transport test with Envelope & fix contract

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://travis-ci.org/symfony/symfony/jobs/377246434#L3685-L3686, https://ci.appveyor.com/project/fabpot/symfony/build/1.0.36261#L297   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

7223bd75f9 [Messenger] Fix new AMQP Transport test with Envelope
2018-05-10 17:06:07 +02:00
Samuel ROZE
d013ab6f71 bug #27184 [Messenger] Fix return senders based on the message parents/interfaces (yceruto)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix return senders based on the message parents/interfaces

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

c3d4536203/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php (L1494-L1499)

According to the code a message interface is supported into routing configuration, but it doesn't work when `SendMessageMiddleware` gets the mapping senders for the current object message.

This PR tries to fix it.

Commits
-------

41e25abf8c Fixed return senders based on the message parents/interfaces
2018-05-10 17:05:13 +02:00
Maxime Steinhausser
7223bd75f9 [Messenger] Fix new AMQP Transport test with Envelope 2018-05-10 14:29:23 +02:00
Samuel ROZE
ebbe1adebc minor #27206 [Messenger] Add more tests around the AMQP transport (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Add more tests around the AMQP transport

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

Adding more tests to the AMQP transport/factory. These should have captured the following 3 bugs: #27198, #27197, #27196.

Commits
-------

faf9382223 Add more tests around the AMQP transport
2018-05-10 08:14:28 +01:00
Yonel Ceruto
41e25abf8c Fixed return senders based on the message parents/interfaces 2018-05-09 15:16:14 -04:00
Samuel ROZE
64a4a2b47f minor #27200 [Messenger] Make sure Sender and Receiver locators have valid services (yceruto)
This PR was squashed before being merged into the 4.1 branch (closes #27200).

Discussion
----------

[Messenger] Make sure Sender and Receiver locators have valid services

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

This make sure that Sender and Receiver locators have valid services. Also adds minor improvements into consume command.

Commits
-------

301ce5f839 [Messenger] Make sure Sender and Receiver locators have valid services
2018-05-09 19:57:59 +01:00
Yonel Ceruto
301ce5f839 [Messenger] Make sure Sender and Receiver locators have valid services 2018-05-09 19:57:45 +01:00
Samuel ROZE
ae6c96ea38 feature #27182 [Messenger] Re-introduce wrapped message configuration (with fix) (sroze, ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Re-introduce wrapped message configuration (with fix)

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

The pull request was merged before beta1, but because it introduced a bug, it has been reverted. This adds back the merged PR but pushes a fix for the found bug.

Commits
-------

21e49d21d8 [Messenger] Fix TraceableBus with envelope
599f32c085 Ensure the envelope is passed back and can be altered Ensure that the middlewares can also update the message within the envelope
7c33cb27ab feature #26945 [Messenger] Support configuring messages when dispatching (ogizanagi)
2018-05-09 19:50:47 +01:00
Fabien Potencier
1403112de1 bug #27209 [Workflow] add is deprecated since Symfony 4.1. Use addWorkflow() instead (xkobal)
This PR was squashed before being merged into the 4.1 branch (closes #27209).

Discussion
----------

[Workflow] add is deprecated since Symfony 4.1. Use addWorkflow() instead

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #...
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

ffa5d1ca94 [Workflow] add is deprecated since Symfony 4.1. Use addWorkflow() instead
2018-05-09 17:27:38 +02:00
Xavier HAUSHERR
ffa5d1ca94 [Workflow] add is deprecated since Symfony 4.1. Use addWorkflow() instead 2018-05-09 17:27:28 +02:00
Maxime Steinhausser
21e49d21d8 [Messenger] Fix TraceableBus with envelope 2018-05-09 15:46:48 +01:00
Samuel ROZE
599f32c085 Ensure the envelope is passed back and can be altered
Ensure that the middlewares can also update the message within the envelope
2018-05-09 15:46:48 +01:00
Samuel ROZE
7c33cb27ab feature #26945 [Messenger] Support configuring messages when dispatching (ogizanagi)
This reverts commit 76b17b0e0f.
2018-05-09 15:46:25 +01:00
Samuel ROZE
e0f225bd85 minor #27203 [Messenger][DX] Uses a default receiver when only one is defined (sroze)
This PR was squashed before being merged into the 4.1 branch (closes #27203).

Discussion
----------

[Messenger][DX] Uses a default receiver when only one is defined

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

When using only one receiver, as a developer, it makes no sense for me to have to precise the receiver name when using the `messenger:consume-messages` command. This is the change:

```patch
- bin/console messenger:consume-messages default
+ bin/console messenger:consume-messages
```

If I have more than one transport configured, I'll get the following message:

>
>  You have 0 or more than one receiver (no default have been found). You need to specify the receiver name with an argument.
>

Commits
-------

8315b868d5 [Messenger][DX] Uses a default receiver when only one is defined
2018-05-09 15:41:23 +01:00
Samuel ROZE
8315b868d5 [Messenger][DX] Uses a default receiver when only one is defined 2018-05-09 15:41:15 +01:00
Samuel ROZE
6207d70964 feature #26803 [Messenger] Add debug:messenger CLI command (ro0NL, sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Add debug:messenger CLI command

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Adds a `debug:messenger` CLI command to expose message classes that can be dispatched. Heavily inspired by `debug:autowiring`.

Commits
-------

7f87309c10 fix deps
290c7eb1bc Rename the command `DebugCommand`
9847b83723 [Messenger] Add debug:messenger CLI command
2018-05-09 15:39:20 +01:00
Samuel ROZE
9ce5941ee1 minor #27192 [Messenger] Improved exception on invalid message type (yceruto)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Improved exception on invalid message type

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

before:
![invalid_message_type_before](https://user-images.githubusercontent.com/2028198/39728992-91f592e6-5227-11e8-8a29-b13d1fed82f8.png)

after:
![invalid_message_type_after](https://user-images.githubusercontent.com/2028198/39728982-8ba5b790-5227-11e8-949d-64265b702fa7.png)

Commits
-------

01fe64856f Improved exception on invalid message type
2018-05-09 13:10:57 +01:00
Roland Franssen
7f87309c10 fix deps 2018-05-09 13:47:01 +02:00
Maxime Steinhausser
09987102a8 [Profiler] Join using ';\n' 2018-05-09 13:16:14 +02:00
Samuel ROZE
290c7eb1bc Rename the command DebugCommand 2018-05-09 09:31:45 +01:00
Roland Franssen
9847b83723 [Messenger] Add debug:messenger CLI command 2018-05-09 09:27:25 +01:00
Samuel ROZE
faf9382223 Add more tests around the AMQP transport 2018-05-09 09:02:39 +01:00
Fabien Potencier
9b841d969c bug #27189 [Profiler] Fix dump makes toolbar disappear (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[Profiler] Fix dump makes toolbar disappear

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27180   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Don't know if there is a better solution than executing eval on the global scope.

For ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval
> If you use the eval function indirectly, by invoking it via a reference other than eval, as of ECMAScript 5 it works in the global scope rather than the local scope. This means, for instance, that function declarations create global functions, and that the code being evaluated doesn't have access to local variables within the scope where it's being called.

Commits
-------

0cd51ae267 [Profiler] Fix dump makes toolbar disappear
2018-05-09 08:02:10 +02:00
Fabien Potencier
796c8fed1e bug #27199 [Messenger] Fix default bus name (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix default bus name

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yesish
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27162   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

After #27162, the default bus name configured automatically should use a full service id too, otherwise we currently get a `default` service id, no namespace identifier, which is the default bus.

Commits
-------

fa9b9849b1 [Messenger] Fix default bus name
2018-05-09 08:01:16 +02:00
Samuel ROZE
b9319021e8 bug #27198 [Messenger] Fix the transport factory after moving it (sroze)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix the transport factory after moving it

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

`ChainTransportFactory` was renamed but the `messenger.xml` wasn't changed.

Commits
-------

7a091d9d61 Fix the transport factory after moving it
2018-05-08 17:42:54 +01:00
Maxime Steinhausser
fa9b9849b1 [Messenger] Fix default bus name 2018-05-08 18:02:52 +02:00
Samuel ROZE
7a091d9d61 Fix the transport factory after moving it 2018-05-08 16:44:19 +01:00
Samuel ROZE
ef2c091787 bug #27197 [Messenger] Fix AMQP Transport factory & TransportFactoryInterface (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix AMQP Transport factory & TransportFactoryInterface

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27164  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Seems like we did review a bit fast here 😅

Commits
-------

98967cd73a [Messenger] Fix AMQP Transport factory & TransportFactoryInterface
2018-05-08 16:21:30 +01:00
Samuel ROZE
cbb587a1f0 bug #27196 [Messenger] Fix AMQP Transport (yceruto)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fix AMQP Transport

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

- [x] Fix typo
- [x] Fix create `Connection` instance
- [ ] Add test

Commits
-------

b8a4d5a232 Fix AmqpTransport
2018-05-08 16:19:50 +01:00