Commit Graph

36385 Commits

Author SHA1 Message Date
Samuel ROZE
e5deb8499b [Messenger] Define multiple buses from the framework.messenger.buses configuration 2018-04-25 18:39:05 +02:00
Samuel ROZE
4429c9b20f bug #26956 [Messenger][AmqpExt] Allow disabling the auto-setup of the connection (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26956).

Discussion
----------

[Messenger][AmqpExt] Allow disabling the auto-setup of the connection

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

Allow disabling the auto-setup of the AMQP connection. Especially useful when the messages are published to another system (see #26937)

Commits
-------

b3039faa1a [Messenger][AmqpExt] Allow disabling the auto-setup of the connection
2018-04-17 17:51:29 +01:00
Samuel ROZE
b3039faa1a [Messenger][AmqpExt] Allow disabling the auto-setup of the connection 2018-04-17 17:51:20 +01:00
Samuel ROZE
fe199317da feature #26941 [Messenger] Allow to configure the transport (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26941).

Discussion
----------

[Messenger] Allow to configure the transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | ish
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26900, #26908, #26935
| License       | MIT
| Doc PR        | ø

We allow users to configure the encoder/decoder used by the built-in adapter(s). This also adds the support of configuring the default's encoder/decoder format and context.

Commits
-------

1a3f0bbb14 [Messenger] Allow to configure the transport
2018-04-17 17:47:47 +01:00
Samuel ROZE
1a3f0bbb14 [Messenger] Allow to configure the transport 2018-04-17 17:47:06 +01:00
Samuel ROZE
4af9003bd6 bug #26960 [Messenger] Allow sender tag name omission (soyuka)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Allow sender tag name omission

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

Tag attributes are not mandatory.

Commits
-------

a4737915c8 [Messenger] Allow sender tag name omission
2018-04-17 14:08:29 +01:00
abluchet
a4737915c8 [Messenger] Allow sender tag name omission 2018-04-17 14:59:00 +02:00
Samuel ROZE
507989db87 bug #26947 [Messenger] Support nested configuration on adapters (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Support nested configuration on adapters

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

The configuration of options did not support "in-depth" configuration. This adds it.

Commits
-------

177cea0ee1 Support nested configuration on adapters
2018-04-16 23:30:47 +01:00
Samuel ROZE
177cea0ee1 Support nested configuration on adapters 2018-04-16 18:40:17 +01:00
Fabien Potencier
d2f8df8054 bug #26895 [Config] Fixes the valid placeholder types for variable node (romain-pierre)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Config] Fixes the valid placeholder types for variable node

| Q             | A
| ------------- | ---
| Branch?       | master
| 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?   | we will see...    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26894
| License       | MIT

This is a proposition, still in discussion.
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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.
-->

Commits
-------

9fbdcdbeb9 Fixes the valid placeholder types for variable node
2018-04-16 19:38:06 +02:00
Fabien Potencier
7e4de96c03 minor #26909 [Messenger][DX] Uses the adapter name instead of the service name (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26909).

Discussion
----------

[Messenger][DX] Uses the adapter name instead of the service name

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

As a developer, I don't get why I would need to use the service name while I give a name to the adapters. This is basically what this PR means for me in terms of configuration:
```patch
framework:
    messenger:
        routing:
            # We want the command below to be handled async with the "messenger.default_sender" (AMQP producer).
-            'App\Message\Command\CreateNumber': messenger.sender.amqp
+            'App\Message\Command\CreateNumber': amqp

        adapters:
            amqp: "%env(AMQP_DSN)%"
```

And in terms of pulling the messages:
```patch
- bin/console messenger:consume-messages messenger.receiver.amqp
+ bin/console messenger:consume-messages amqp
```

Commits
-------

b5afb40441 [Messenger][DX] Uses the adapter name instead of the service name
2018-04-16 19:19:59 +02:00
Samuel ROZE
b5afb40441 [Messenger][DX] Uses the adapter name instead of the service name 2018-04-16 19:19:48 +02:00
Romain Pierre
9fbdcdbeb9 Fixes the valid placeholder types for variable node 2018-04-16 10:25:21 +02:00
Samuel ROZE
c442929737 minor #26912 [Messenger] Testing LoggingMiddleware and minor improvements (yceruto)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Testing LoggingMiddleware and minor improvements

| 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 add tests for `LoggingMiddleware` class
- Similar to [`translator.logging`](6bbb5bcc52/src/Symfony/Component/Translation/LoggingTranslator.php (L33)) a logging service doesn't make sense without a [hard `logger` dependency](6bbb5bcc52/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml (L25-L29)) and according to:
6bbb5bcc52/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php (L52-L54)

   it must be removed if `logger` alias doesn't exists.

Commits
-------

eedad4c061 Make logger arg a hard dependency, remove dead code and add tests
2018-04-15 22:28:31 +01:00
Nicolas Grekas
ccb0e84799 [Form] tweak CHANGELOG 2018-04-15 08:55:41 -05:00
Yonel Ceruto
eedad4c061 Make logger arg a hard dependency, remove dead code and add tests 2018-04-14 13:36:02 -04:00
Nicolas Grekas
782ffe2fd2 Merge branch '4.0'
* 4.0:
  [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing
  Add d-block to bootstrap 4 alerts
  [Console] Don't go past exact matches when autocompleting
  [DI] Improve error message for non-autowirable scalar argument
  Disable autoloader call on interface_exists check
  [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
  [HttpKernel] Dont create mock cookie for new sessions in tests
2018-04-14 11:36:26 -05:00
Nicolas Grekas
594925a934 Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing
  Add d-block to bootstrap 4 alerts
  [Console] Don't go past exact matches when autocompleting
  [DI] Improve error message for non-autowirable scalar argument
  Disable autoloader call on interface_exists check
  [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
  [HttpKernel] Dont create mock cookie for new sessions in tests
2018-04-14 11:34:42 -05:00
Nicolas Grekas
0a02fb1bdd Merge branch '2.8' into 3.4
* 2.8:
  [Console] Don't go past exact matches when autocompleting
  Disable autoloader call on interface_exists check
  [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
2018-04-14 11:33:56 -05:00
Nicolas Grekas
32c04bdcbb Merge branch '2.7' into 2.8
* 2.7:
  [Console] Don't go past exact matches when autocompleting
  Disable autoloader call on interface_exists check
  [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
2018-04-14 11:27:29 -05:00
Nicolas Grekas
811c4dd7cd bug #26773 [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing (mathieutu)
This PR was submitted for the 4.0 branch but it was squashed and merged into the 3.4 branch instead (closes #26773).

Discussion
----------

[HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing

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

Hi folks,

This PR fixes https://github.com/symfony/symfony/issues/26772:
>Controller "App\Controllers\Foo" requires that you provide a value for the "$foo" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.

Thank you for your work!

PS: This is my first (of many planned!) PR to Symfony, so please let me know if I did something wrong.

Commits
-------

3b47441 [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing
2018-04-14 10:06:58 -05:00
Mathieu TUDISCO
3b47441fd5 [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing 2018-04-14 10:06:52 -05:00
Nicolas Grekas
6bdaa406d2 bug #26870 Add d-block to bootstrap 4 alerts (Normunds)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #26870).

Discussion
----------

Add d-block to bootstrap 4 alerts

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

Commits
-------

40bd8bd Add d-block to bootstrap 4 alerts
2018-04-14 09:57:28 -05:00
Normunds
40bd8bd797 Add d-block to bootstrap 4 alerts 2018-04-14 09:54:06 -05:00
Nicolas Grekas
ce5b3e7ded minor #26913 [Messenger] Add tests for ValidationMiddleware (yceruto)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Add tests for ValidationMiddleware

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

Commits
-------

4a3f8f4 Add tests for ValidationMiddleware
2018-04-14 09:04:31 -05:00
Nicolas Grekas
f394b4540b minor #26914 [Messenger] Add tests for ChainHandler class (yceruto)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Add tests for ChainHandler class

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

More tests, the last one for now ;)

Commits
-------

2d3ce1d Add tests for ChainHandler class
2018-04-14 08:34:18 -05:00
Nicolas Grekas
3265df040e bug #26920 [PhpUnit Bridge] Fixes a non-initialized variable (romain-pierre)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[PhpUnit Bridge] Fixes a non-initialized variable

| Q             | A
| ------------- | ---
| Branch?       | to be updated
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT

If you are ok with this, I will rebase on the best branch.

Commits
-------

fa5f5b3 Fixes a non-initialized variable in phpunit bridge
2018-04-14 08:31:23 -05:00
Nicolas Grekas
16ae72059e bug #26857 [HttpKernel] Dont create mock cookie for new sessions in tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Dont create mock cookie for new sessions in tests

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

@romainneutron can you please check if this fixes your issue?

Commits
-------

86b850e [HttpKernel] Dont create mock cookie for new sessions in tests
2018-04-14 08:14:37 -05:00
Yonel Ceruto
2d3ce1dc58 Add tests for ChainHandler class 2018-04-14 08:58:06 -04:00
Romain Pierre
fa5f5b3797 Fixes a non-initialized variable in phpunit bridge 2018-04-13 16:57:55 +02:00
Yonel Ceruto
4a3f8f4775 Add tests for ValidationMiddleware 2018-04-13 08:28:05 -04:00
Samuel ROZE
6bbb5bcc52 minor #26907 [Messenger] Minor improvements and cleanup (yceruto)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Minor improvements and cleanup

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

- enable some of opcode optimizations
- add missing typehints
- cleanup

Commits
-------

d8cc7a4715 Minor improvements and cleanup
2018-04-12 21:15:39 +01:00
Samuel ROZE
86887ef3f9 bug #26896 Messenger: fix for interface_exists (weaverryan, sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Messenger: fix for interface_exists

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

2 unrelated bugs! But, very minor :).

Commits
-------

d60425c868 Allow the logger to be null (as per every other bits in the FrameworkBundle)
3c4be3cdda Update the tests to also use `interface_exists`
2405eae500 Fixing bad class_exists vs interface_exists
2018-04-12 19:52:54 +01:00
Samuel ROZE
d60425c868 Allow the logger to be null (as per every other bits in the FrameworkBundle) 2018-04-12 19:18:53 +01:00
Yonel Ceruto
d8cc7a4715 Minor improvements and cleanup
- enable some of opcode optimizations
- add missing typehints
- cleanup
2018-04-12 11:42:15 -04:00
Samuel ROZE
3c4be3cdda
Update the tests to also use interface_exists 2018-04-12 16:38:50 +01:00
Ryan Weaver
2405eae500 Fixing bad class_exists vs interface_exists 2018-04-12 11:21:29 -04:00
Samuel ROZE
aa04d06dc4 feature #26632 [Messenger] Add AMQP adapter (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26632).

Discussion
----------

[Messenger] Add AMQP adapter

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

- [x] Depends on the Messenger component #24411
- [x] Add tests once we are all happy about the structure

---

In order to give a great DX for simple needs such as sending messages through an AMQP broker such as RabbitMq, we should ship an AMQP adapter for the Messenger component within Symfony Core. It should be as simple as this proposal. We don't need to handle more specific use-cases nor brokers as other adapters such as the [enqueue adapter](https://github.com/sroze/enqueue-bridge) can also be used.

Configuring the adapter is as simple as the following configuration:
```yaml
# config/packages/messenger_adapters.yaml
framework:
    messenger:
        adapter: "%env(MESSENGER_DSN)%"
```

With the given `.env` for example:
```
MESSENGER_DSN=amqp://guest:guest@localhost:5672/%2f/messages
```

Keep in mind that after having configured the adapter, developers have to route their messages to the given adapter.

```yaml
# config/packages/messenger_routes.yaml
framework:
    messenger:
        routing:
producer).
            'App\Message\Command\CreateNumber': messenger.default_sender
```

---

Additionally, multiple adapters can be created and messages routed to these ones.

```yaml
# config/packages/messenger_routes.yaml
framework:
    messenger:
        adapters:
            commands: "amqp://guest:guest@localhost:5672/%2f/commands"
            maintenance: "amqp://guest:guest@localhost:5672/%2f/maintenance"
        routing:
producer).
            'App\Message\Command\CreateNumber': messenger.commands_sender
            'App\Message\Command\MaintenanceSpecificCommand': messenger.maintenance_sender
```

Commits
-------

798c230ad5 [Messenger] Add AMQP adapter
2018-04-12 09:16:00 +01:00
Samuel ROZE
798c230ad5 [Messenger] Add AMQP adapter 2018-04-12 09:15:52 +01:00
Tobias Schultze
11bdd807ab minor #26856 [DI] Improve error message for non-autowirable scalar argument (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Improve error message for non-autowirable scalar argument

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

Commits
-------

7f398117f4 [DI] Improve error message for non-autowirable scalar argument
2018-04-10 19:23:09 +02:00
Robin Chalas
10674688da bug #26875 [Console] Don't go past exact matches when autocompleting (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Don't go past exact matches when autocompleting

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

Commits
-------

adba79a [Console] Don't go past exact matches when autocompleting
2018-04-10 11:58:27 +02:00
Nicolas Grekas
adba79a6b0 [Console] Don't go past exact matches when autocompleting 2018-04-09 15:41:45 -05:00
Nicolas Grekas
7f398117f4 [DI] Improve error message for non-autowirable scalar argument 2018-04-09 15:40:31 -05:00
Nicolas Grekas
9a999553a5 bug #26874 [FrameworkBundle] Fixed configuration of php_errors.log (lyrixx)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] Fixed configuration of php_errors.log

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26504 and #26740 (wrong implementation)
| License       | MIT
| Doc PR        |

Commits
-------

8e0fcf9 [FrameworkBundle] Fixed configuration of php_errors.log
2018-04-09 13:39:40 -05:00
Nicolas Grekas
0f9c45e145 bug #26823 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class (Pascal Montoya, pmontoya)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't existing class

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

If @Assert\Valid is applied to a string value, the value is searched in metadata cache and some characters aren't allowed in this cache. This create an unexpected exception.

Class existence is now tested before cache read.

Commits
-------

5198f43 Disable autoloader call on interface_exists check
cd91420 [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
2018-04-09 13:33:44 -05:00
Grégoire Pineau
8e0fcf933c [FrameworkBundle] Fixed configuration of php_errors.log 2018-04-09 18:19:45 +02:00
Pascal Montoya
5198f435a0
Disable autoloader call on interface_exists check 2018-04-09 10:32:24 +02:00
Pascal Montoya
cd914209bd
[Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class 2018-04-09 10:32:24 +02:00
Samuel ROZE
a726f05f81 minor #26862 [Messenger] Rename the middleware tag (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Rename the middleware tag

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

After a using it for a bit of time, it's weird to have the `messenger.message_handler` tag while using the `message_bus_middleware` tag for the middlewares.

I propose to rename the tag from `message_bus_middleware` to `messenger.bus_middleware` to keep some consistency.

Commits
-------

dd18445482 Rename the middleware tag from `message_bus_middleware` to `messenger.bus_middleware`
2018-04-09 09:13:48 +01:00
Robin Chalas
5736321ea7 feature #26863 [Console] Support iterable in SymfonyStyle::write/writeln (ogizanagi)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Console] Support iterable in SymfonyStyle::write/writeln

| Q             | A
| ------------- | ---
| Branch?       | master <!-- 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 | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Relates to https://github.com/symfony/symfony/pull/26847.

This would enable iterables benefits even when using `SymfonyStyle` output.

Commits
-------

d66827e [Console] Support iterable in SymfonyStyle::write/writeln
2018-04-09 09:47:20 +02:00