Commit Graph

37115 Commits

Author SHA1 Message Date
Nicolas Grekas
d7e612d2ac [Debug] Fix populating error_get_last() for handled silent errors 2018-05-11 10:00:11 -07:00
Fabien Potencier
965e48482b minor #27193 Improve github issue templates (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Improve github issue templates

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

Fixes ordering and adds some visual hints:

![image](https://user-images.githubusercontent.com/243674/39730597-71ba077e-5217-11e8-91cd-fbfa80777ee9.png)

Commits
-------

a05ae9b9cd Improve github issue templates
2018-05-11 18:45:01 +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
Nicolas Grekas
a05ae9b9cd Improve github issue templates 2018-05-11 09:34:51 -07:00
Fabien Potencier
4f3afd53a8 fixed CS 2018-05-11 17:58:37 +02:00
Fabien Potencier
f5e6a61a82 Merge branch '3.4' into 4.0
* 3.4:
  fixed CS
  fixed CS
  [FrameworkBundle] Fix cache:clear on vagrant
  [HttpKernel] Handle NoConfigurationException "onKernelException()"
  Fix misses calculation when calling getItems
  Fixed return type
2018-05-11 17:53:11 +02:00
Fabien Potencier
7b7f75994f Merge branch '2.8' into 3.4
* 2.8:
  fixed CS
  fixed CS
  Fixed return type
2018-05-11 17:52:51 +02:00
Fabien Potencier
df43c1e99d fixed CS 2018-05-11 17:51:28 +02:00
Fabien Potencier
1f3aa51b5f Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
  Fixed return type
2018-05-11 17:48:50 +02:00
Fabien Potencier
8072eed4bf fixed CS 2018-05-11 17:48:19 +02:00
Fabien Potencier
43bad425b8 bug #27231 [FrameworkBundle] Fix cache:clear on vagrant (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix cache:clear on vagrant

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

What a mess, shared folder on vbox...

![image](https://user-images.githubusercontent.com/243674/39903547-87bb2602-5488-11e8-914e-61aa53ffe6ea.png)

Commits
-------

3381611d86 [FrameworkBundle] Fix cache:clear on vagrant
2018-05-11 17:42:47 +02:00
Fabien Potencier
9ef517d2a4 bug #27222 [WebProfilerBundle][Cache] Fix misses calculation when calling getItems (fsevestre)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfilerBundle][Cache] Fix misses calculation when calling getItems

| 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        | -

Hello,

This PR fixes a bug in the misses calculation in the cache data collector when calling the `getItems` method.

Found this while trying to understand why I had an inconsistency in the profiler:
![misses](https://user-images.githubusercontent.com/4130750/39875423-e6212f60-5470-11e8-87be-c075ee76aeaa.png)

Commits
-------

3d1ab6df13 Fix misses calculation when calling getItems
2018-05-11 17:32:25 +02:00
Nicolas Grekas
3381611d86 [FrameworkBundle] Fix cache:clear on vagrant 2018-05-11 08:27:29 -07:00
Fabien Potencier
5deb504a92 bug #27227 [HttpKernel] Handle NoConfigurationException "onKernelException()" (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Handle NoConfigurationException "onKernelException()"

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

Commits
-------

db6ef38ea9 [HttpKernel] Handle NoConfigurationException "onKernelException()"
2018-05-11 17:19:12 +02:00
Yonel Ceruto
54c2541d94 Select alternatives on missing receiver arg or typo 2018-05-11 09:46:46 -04: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
Nicolas Grekas
db6ef38ea9 [HttpKernel] Handle NoConfigurationException "onKernelException()" 2018-05-10 11:44:29 -07: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
fsevestre
3d1ab6df13
Fix misses calculation when calling getItems 2018-05-10 16:33:41 +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
Nicolas Grekas
f2231b584e [DI] Display previous error messages when throwing unused bindings 2018-05-09 11:49:38 -07:00
Fabien Potencier
226e2f3949 feature #27075 [DI][DX] Allow exclude to be an array of patterns (magnetik)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI][DX] Allow exclude to be an array of patterns

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

This is basically continuing #24428.

In YAML before:
```yaml
AppBundle\:
  resource: '../../src/AppBundle/*'
  exclude: '../../src/AppBundle/{Entity,Payload,Repository}'
```

in YAML after:

```yaml
AppBundle\:
  resource: '../../src/AppBundle/*'
  exclude:
    - '../../src/AppBundle/{Entity,Payload,Repository}'
    - '../../src/AppBundle/Event/*Event.php'
```

In XML before:
```xml
<prototype namespace="App\" resource="../src/*" exclude="../src/{Entity,Migrations,Tests}" />
```

in XML after:

```xml
<prototype namespace="App\" resource="../src/*">
  <exclude>../src/{Entity,Migrations,Tests}</exclude>
  <exclude>../src/Yolo</exclude>
</prototype>
```

In PHP before:
```php
$di->load(Prototype::class.'\\', '../Prototype')
        ->autoconfigure()
        ->exclude('../Prototype/{OtherDir,BadClasses}')
```

In PHP after:
```php
    $di->load(Prototype::class.'\\', '../Prototype')
        ->autoconfigure()
        ->exclude(['../Prototype/OtherDir', '../Prototype/BadClasses'])
```

Everything is backward compatible.
Maybe a decision about handling both attribute exclude and element exclude in XML should be taken.

Commits
-------

3ae3a03f41 [DI][DX] Allow exclude to be an array of patterns (taking #24428 over)
2018-05-09 18:25:25 +02:00
Baptiste Lafontaine
3ae3a03f41 [DI][DX] Allow exclude to be an array of patterns (taking #24428 over) 2018-05-09 18:00:53 +02: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
cb2a77b24b Merge branch '4.1'
* 4.1:
  [Messenger][DX] Uses a default receiver when only one is defined
  fix deps
  [Profiler] Join using ';\n'
  Rename the command `DebugCommand`
  [Messenger] Add debug:messenger CLI command
  [Messenger] Fix default bus name
  Fix the transport factory after moving it
  [Messenger] Fix AMQP Transport factory & TransportFactoryInterface
  Fix AmqpTransport
  [Profiler] Fix dump makes toolbar disappear
  Improved exception on invalid message type
  bumped Symfony version to 4.1.0
  updated VERSION for 4.1.0-BETA1
  updated CHANGELOG for 4.1.0-BETA1
  [Messenger] Add TransportInterface as first class citizen sender+receiver
2018-05-09 15:43:48 +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