Commit Graph

37115 Commits

Author SHA1 Message Date
Nicolas Grekas
71a1e29c82 Fix CS 2018-05-16 16:41:07 +02:00
Nicolas Grekas
205b097802 Merge branch '4.0' into 4.1
* 4.0: (21 commits)
  [PropertyInfo] fix resolving parent|self type hints
  fixed CS
  fix merge
  [Security] Fix logout
  Cleanup 2 tests for the HttpException classes
  #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
  [Config] Fix tests when path contains UTF chars
  [DI] Shared services should not be inlined in non-shared ones
  [Profiler] Remove propel & event_listener_loading category identifiers
  [Filesystem] Fix usages of error_get_last()
  [Cache][Lock] Fix usages of error_get_last()
  [Debug] Fix populating error_get_last() for handled silent errors
  fixed CS
  fixed CS
  fixed CS
  [FrameworkBundle] Fix cache:clear on vagrant
  [HttpKernel] Handle NoConfigurationException "onKernelException()"
  Fix misses calculation when calling getItems
  [DI] Display previous error messages when throwing unused bindings
  Fixed return type
  ...
2018-05-16 16:33:22 +02:00
Nicolas Grekas
544af2dd8b Merge branch '3.4' into 4.0
* 3.4:
  [PropertyInfo] fix resolving parent|self type hints
  fixed CS
2018-05-16 16:21:07 +02:00
Nicolas Grekas
5327957ff9 bug #27287 [PropertyInfo] fix resolving parent|self type hints (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] fix resolving parent|self type hints

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

Commits
-------

88a3b90860 [PropertyInfo] fix resolving parent|self type hints
2018-05-16 16:13:01 +02:00
Nicolas Grekas
2a10cc6047 bug #27281 [HttpKernel] Fix dealing with self/parent in ArgumentMetadataFactory (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix dealing with self/parent in ArgumentMetadataFactory

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

Applies CS fixes that where merged on 4.0 to 3.4, embeds a fix in ArgumentMetadataFactory, which couldn't deal with self/parent type hints.

Commits
-------

ba5cb1a245 fixed CS
2018-05-16 16:03:39 +02:00
Nicolas Grekas
88a3b90860 [PropertyInfo] fix resolving parent|self type hints 2018-05-16 15:47:24 +02:00
Tobias Schultze
198925ee4e [Messenger] implement several senders using a ChainSender 2018-05-16 15:12:01 +02:00
Fabien Potencier
ba5cb1a245 fixed CS 2018-05-16 14:49:49 +02:00
Nicolas Grekas
8c430fbeb2 Merge branch '3.4' into 4.0
* 3.4:
  fix merge
  [Security] Fix logout
  Cleanup 2 tests for the HttpException classes
  #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
  [Config] Fix tests when path contains UTF chars
  [DI] Shared services should not be inlined in non-shared ones
  [Profiler] Remove propel & event_listener_loading category identifiers
  [Filesystem] Fix usages of error_get_last()
  [Cache][Lock] Fix usages of error_get_last()
  [Debug] Fix populating error_get_last() for handled silent errors
  [DI] Display previous error messages when throwing unused bindings
  Suppress warnings when open_basedir is non-empty
2018-05-16 11:05:32 +02:00
Nicolas Grekas
bf2943ecd1 Merge branch '2.8' into 3.4
* 2.8:
  fix merge
2018-05-16 10:49:53 +02:00
Nicolas Grekas
f49310b54c fix merge 2018-05-16 10:49:48 +02:00
Nicolas Grekas
86a9c73026 Merge branch '2.8' into 3.4
* 2.8:
  [Security] Fix logout
  #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
  [Profiler] Remove propel & event_listener_loading category identifiers
  [Filesystem] Fix usages of error_get_last()
  [Debug] Fix populating error_get_last() for handled silent errors
  Suppress warnings when open_basedir is non-empty
2018-05-16 10:49:21 +02:00
Gabriel Ostrolucký
97cbea005e [Lock] Skip test if posix extension is not installed
This isn't installed by default on Fedora
2018-05-16 10:09:04 +02:00
Nicolas Grekas
a8122f8271 Merge branch '2.7' into 2.8
* 2.7:
  [Security] Fix logout
  #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
  [Profiler] Remove propel & event_listener_loading category identifiers
  [Filesystem] Fix usages of error_get_last()
  [Debug] Fix populating error_get_last() for handled silent errors
  Suppress warnings when open_basedir is non-empty
2018-05-15 23:17:45 +02:00
Nicolas Grekas
15a7bbd92c bug #24805 [Security] Fix logout (MatTheCat)
This PR was squashed before being merged into the 2.7 branch (closes #24805).

Discussion
----------

[Security] Fix logout

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

Commits
-------

9e88eb5aa9 [Security] Fix logout
2018-05-15 17:39:51 +02:00
MatTheCat
9e88eb5aa9 [Security] Fix logout 2018-05-15 17:39:41 +02:00
Nicolas Grekas
88ecd0dc9a [DI] fine tune dumped factories 2018-05-15 12:01:07 +02:00
smaine
cb5ce8f32e fix bug when imported routes are prefixed 2018-05-15 11:43:27 +02:00
Nicolas Grekas
10a2d39365 bug #27265 [DI] Shared services should not be inlined in non-shared ones (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Shared services should not be inlined in non-shared ones

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

[Already good on 2.7/2.8.](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php#L152)

Commits
-------

6f8b8625f4 [DI] Shared services should not be inlined in non-shared ones
2018-05-15 10:55:40 +02:00
Nicolas Grekas
932dbd232d minor #27243 [Config] Fix tests when path contains UTF chars (ostrolucky)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Fix tests when path contains UTF chars

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

Commits
-------

b2a97ea00f [Config] Fix tests when path contains UTF chars
2018-05-15 10:54:45 +02:00
Nicolas Grekas
b7feafcf58 bug #27141 [Process] Suppress warnings when open_basedir is non-empty (cbj4074)
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Suppress warnings when open_basedir is non-empty

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

If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings.

While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error.

We fixed a similar issue in the ExecutableFinder class via symfony/symfony#16182 .

This has always been an issue, but 709e15e7a3 made it more likely that a warning is triggered.

Commits
-------

34f136e01b Suppress warnings when open_basedir is non-empty
2018-05-15 10:20:41 +02:00
Nicolas Grekas
1c3b1055df [DI] Allow defining bindings on ChildDefinition 2018-05-15 09:24:59 +02:00
Fabien Potencier
4c38b4dfa6 minor #27256 Cleanup 2 tests for the HttpException classes (ncou)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #27256).

Discussion
----------

Cleanup 2 tests for the HttpException classes

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

See discussion in linked issue.

Commits
-------

5516b329af Cleanup 2 tests for the HttpException classes
2018-05-15 07:00:07 +02:00
ncou
5516b329af Cleanup 2 tests for the HttpException classes 2018-05-15 06:59:59 +02:00
Fabien Potencier
974050feb8 bug #27250 [Session] limiting :key for GET_LOCK to 64 chars (oleg-andreyev)
This PR was merged into the 2.7 branch.

Discussion
----------

[Session] limiting :key for GET_LOCK to 64 chars

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

> MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced.

Cases:
- `session_id` is set by developers manually
- `session.sid_length` is configured

Ref.:
- https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock
- http://php.net/manual/en/session.configuration.php#ini.session.sid-length

Other issues:
- https://github.com/go-sql-driver/mysql/issues/385
- https://github.com/stefangabos/Zebra_Session/issues/16

Commits
-------

9cda96b8b5 #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later
2018-05-15 06:51:13 +02:00
Samuel ROZE
4a7e6fa9bc Merge branch '4.1'
* 4.1:
  [Messenger] Middleware factories support in config
  [HttpKernel] Make TraceableValueResolver $stopwatch mandatory
  [Messenger] Improve the profiler panel
  [Workflow] Added DefinitionBuilder::setMetadataStore().
  [Messenger][DX] Uses custom method names for handlers
  [Messenger] remove autoconfiguration for Sender/ReceiverInterface
  [Messenger] Make sure default receiver name is set before command configuration
  [HttpKernel] Fix services are no longer injected into __invoke controllers method
  Rename tag attribute "name" by "alias"
  Autoconfiguring TransportFactoryInterface classes
  [Messenger] Fix new AMQP Transport test with Envelope
  Fixed return senders based on the message parents/interfaces
  [Messenger] Make sure Sender and Receiver locators have valid services
  [Workflow] add is deprecated since Symfony 4.1. Use addWorkflow() instead
  [Messenger] Fix TraceableBus with envelope
  Ensure the envelope is passed back and can be altered Ensure that the middlewares can also update the message within the envelope
  feature #26945 [Messenger] Support configuring messages when dispatching (ogizanagi)
  Add more tests around the AMQP transport
2018-05-14 20:20:21 +01: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
Oleg Andreyev
9cda96b8b5 #27250 limiting GET_LOCK key up to 64 char due to changes in MySQL 5.7.5 and later 2018-05-14 20:29:47 +03:00
Adam Szaraniec
2400e71962 use strict compare in url validator 2018-05-14 21:15:07 +04:00
Gabriel Ostrolucký
b2a97ea00f [Config] Fix tests when path contains UTF chars 2018-05-14 18:49:53 +02:00
Fabien Potencier
d7d4e4169a minor #27263 [Profiler] Remove propel & event_listener_loading category identifiers (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Profiler] Remove propel & event_listener_loading category identifiers

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- 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 | Part of https://github.com/symfony/symfony/issues/27262#issuecomment-388865265   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

d52f491bfa [Profiler] Remove propel & event_listener_loading category identifiers
2018-05-14 18:36:29 +02:00
Nicolas Grekas
6f8b8625f4 [DI] Shared services should not be inlined in non-shared ones 2018-05-14 18:07:37 +02:00
Maxime Steinhausser
d52f491bfa [Profiler] Remove propel & event_listener_loading category identifiers 2018-05-14 18:07:30 +02:00
Fabien Potencier
784a7accf5 minor #27255 Minor tweak in the issue templates (javiereguiluz)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Minor tweak in the 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        | -

When these templates were created I didn't realize that GitHub already displays a link to the Code of Conduct when creating issues and PRs:

![github-code-conduct](https://user-images.githubusercontent.com/73419/39987369-e0a3b05c-5764-11e8-85d4-37c1695facda.png)

I propose to remove our custom CoC links and rely on the GitHub links, which are standard for all repositories and contributors are already used to them. Thanks!

Commits
-------

c9121a33f1 Minor tweak in the issue templates
2018-05-14 13:31:05 +02:00
Javier Eguiluz
c9121a33f1 Minor tweak in the issue templates 2018-05-14 10:49:54 +02: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
30ffb61b1f bug #27237 [Debug] Fix populating error_get_last() for handled silent errors (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Fix populating error_get_last() for handled silent errors

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

When a userland error handler doesn't return `false`, `error_get_last()` is not updated, so we cannot see the real last error, but the previous one.

See https://3v4l.org/Smmt7

Commits
-------

d7e612d2ac [Debug] Fix populating error_get_last() for handled silent errors
2018-05-14 08:44:24 +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
Fabien Potencier
fb881194b6 bug #27232 [Cache][Lock] Fix usages of error_get_last() (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache][Lock] Fix usages of error_get_last()

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

When a userland error handler doesn't return `false`, `error_get_last()` is not updated, so we cannot see the real last error, but the previous one.

See https://3v4l.org/Smmt7

Commits
-------

7904784a94 [Cache][Lock] Fix usages of error_get_last()
2018-05-14 08:38:31 +02:00
Fabien Potencier
15b03a8981 bug #27236 [Filesystem] Fix usages of error_get_last() (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] Fix usages of error_get_last()

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

Same as #27232 for 2.7.
When a userland error handler doesn't return `false`, `error_get_last()` is not updated, so we cannot see the real last error, but the previous one.

See https://3v4l.org/Smmt7

Commits
-------

9d015c7c50 [Filesystem] Fix usages of error_get_last()
2018-05-14 08:36:14 +02:00
Gabriel Ostrolucký
16ebb43bd4 Disallow illegal characters like "." in session.name
PHP saves cookie with correct name, but upon deserialization to
$_COOKIE, it replaces some characters, e.g. "." becomes "_".

This is probably also reason why \SessionHandler is not able to find
a session.

https://harrybailey.com/2009/04/dots-arent-allowed-in-php-cookie-names/
https://bugs.php.net/bug.php?id=75883
2018-05-13 23:57:04 +02:00
Maxime Steinhausser
585ae7c646 [HttpKernel] Make TraceableValueResolver $stopwatch mandatory 2018-05-13 20:52:09 +02:00
Nicolas Grekas
9d015c7c50 [Filesystem] Fix usages of error_get_last() 2018-05-13 17:44:36 +02:00
Malte Blättermann
8fc09c73c6 Add applyOperations batch method to EntryManager
Also introduce new UpdateOperation class.
2018-05-13 14:10:34 +02:00
Nicolas Grekas
f8cde70ba1 [HttpKernel] do file_exists() check instead of silent notice 2018-05-13 13:51:16 +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
98934e4c77 bug #27191 [DI] Display previous error messages when throwing unused bindings (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Display previous error messages when throwing unused bindings

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

As reported by @jvasseur, confirmation + review welcome.

Commits
-------

f2231b584e [DI] Display previous error messages when throwing unused bindings
2018-05-12 11:34:41 +02:00
Nicolas Grekas
7904784a94 [Cache][Lock] Fix usages of error_get_last() 2018-05-11 10:42:54 -07:00