Commit Graph

34159 Commits

Author SHA1 Message Date
Fabien Potencier
e606ac1916 bug #31493 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor (wskorodecki)
This PR was merged into the 4.3 branch.

Discussion
----------

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

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

### The problem

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

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

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

The debug toolbar will not be displayed in this case.

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

### How to reproduce

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

Example:

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

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

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

### Solution:

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

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

Commits
-------

20c587fc23 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor
2019-05-18 18:11:27 +02:00
Fabien Potencier
ee0cfa9311 bug #31502 [WebProfilerBundle][Form] The form data collector return serialized data (Simperfit)
This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle][Form] The form data collector return serialized data

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31476 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

This bug occurs because at some point the FormDataCollector was returning serialized data, this has been changed in the upcoming branches but it seems that the bug occurs when using different version of the form component and the WebProfilerBundle.

This bugfix add a conflict param on the WebProfilerBundle to avoid using version of the form component who still serialize the data.

Commits
-------

70fdafd79f [WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object
2019-05-18 18:10:32 +02:00
Grégoire Pineau
afb6e1ec9e [Debug] Wrap call to require_once in a try/catch
If the included file contains an error, it hides the real error. This
makes debugging harder.

How to reproduce:

```
composer create-project symfony/skeleton symfony-3.4 3.4
cd symfony-3.4
composer req monolog
```

Add to `monolog.yaml`:
```yaml
        elasticsearch:
            type: "elasticsearch"
            elasticsearch:
                host: 'elasticsearch'
                port: '9200'
            index: 'ep_php_logs_dev'
            level: 'debug'
            tags: 'monolog.logger'
            channels: ['!event']
```

This will fail because the the \Elastica\Client class does not exist.
But this error will be hidden by the `ClassNotFoundFatalErrorHandler`
because it will try to load the `Symfony\Component\Kernel\Client` and
this class extends `Symfony\Component\BrowserKit\Client`. The last one
is a soft dependency...

---

Before
```
Fatal error: Uncaught Error: Class 'Symfony\Component\BrowserKit\Client' not found in /tmp/symfony-3.4/vendor/symfony/http-kernel/Client.php:31
```

After:
```
Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Client" from namespace "Elastica".
Did you forget a "use" statement for another namespace? in /tmp/symfony-es/var/cache/dev/ContainerWXN4mS9/srcApp_KernelDevDebugContainer.php:303
```
2019-05-18 15:32:47 +02:00
Robin Chalas
45446e891a [FrameworkBundle] Mention that the described service has been removed in debug:container 2019-05-17 16:46:37 +02:00
Wojciech Skorodecki
20c587fc23 [EventDispatcher] Removed "callable" type hint from WrappedListener constructor 2019-05-17 15:28:19 +02:00
Christian Flothmann
d836c63b91 prevent deprecation when filesize matches error code 2019-05-17 13:55:16 +02:00
Pablo Lozano
62894ed8b9 [PropertyInfo] Add missing documentation link in Readme 2019-05-16 16:10:36 +02:00
Grégoire Pineau
519ba3cddb Merge remote-tracking branch 'origin/4.3'
* origin/4.3:
  deprecate calling createChildContext without the format parameter
  [EventDispatcher] Fix interface name used in error messages
  [FrameworkBundle] Add cache configuration for PropertyInfo
  Update dependencies in the main component
  Drop useless executable bit
  [Doctrine][PropertyInfo] Detect if the ID is writeable
  Add transport in subscriber's phpdoc
  [Validator] Autovalidation: skip readonly props
  [DI] default to service id - *not* FQCN - when building tagged locators
  [Cache] Log a more readable error message when saving into cache fails
  Update WorkflowEvents.php
  [Messenger] On failure retry, make message appear received from original sender
  [Messenger] remove send_and_handle option which can be achieved with SyncTransport
  Fixing tests - passing pdo is not wrapped for some reason in dbal
  Changing how RoutableMessageBus fallback bus works
  [Serializer] Fix BC break: DEPTH_KEY_PATTERN must be public
  [FrameworkBundle] Fixed issue when a parameter container a '%'
  Fix the interface incompatibility of EventDispatchers
  [TwigBundle] fixed Mailer integration in Twig
  [Form] Add intl/choice_translation_locale option to TimezoneType
2019-05-16 11:31:29 +02:00
Konstantin Myakshin
42d62721fd Respect parent class contract in ContainerAwareDoctrineEventManager 2019-05-15 21:39:23 +03:00
Amrouche Hamza
70fdafd79f
[WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object 2019-05-15 20:22:43 +02:00
David Buchmann
cb77902805 deprecate calling createChildContext without the format parameter 2019-05-15 11:58:03 +02:00
gauss
710f8a6367 [Validator] Add the missing translations for the Danish ("da") locale 2019-05-14 17:13:30 +03:00
Robin Chalas
38cad41a0a [EventDispatcher] Fix interface name used in error messages 2019-05-14 15:44:14 +02:00
Amrouche Hamza
3d6b30330e [Console] Optimisation on getting the command 2019-05-14 14:53:33 +02:00
Ryan Weaver
34e7781c5c Adding a new NonSendableStampInterface to avoid sending certain stamps
Fixes a bug where Symfony serialization of the AmqpReceivedStamp sometimes caused problems.
2019-05-13 09:49:50 -04:00
Fabien Potencier
4559a656cc bug #31459 Fix the interface incompatibility of EventDispatchers (keulinho)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix the interface incompatibility of EventDispatchers

The `LegacyEventDispatcherProxy` now implements the full
`EventDispatcherInterface` from the `EventDispatcherBundle`.
Before it just implemented the Interface from the `Contracts` Bundle,
that made it incompatible with the `WrappedListener`.
This fixes #31457.

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

Commits
-------

bdeeae1510 Fix the interface incompatibility of EventDispatchers
2019-05-13 10:20:44 +02:00
Fabien Potencier
48233b0495 bug #31463 [DI] default to service id - *not* FQCN - when building tagged locators (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] default to service id - *not* FQCN - when building tagged locators

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

While reviewing #30926 I realized that defaulting to the FQCN is a shortcut that isn't useful enough.
Defaulting to the service id provides the same experience in practice because service ids are FQCN by default.
But when they aren't, the service id is the proper index to default to when building the locator.

Commits
-------

52e827c9cf [DI] default to service id - *not* FQCN - when building tagged locators
2019-05-13 09:03:50 +02:00
Fabien Potencier
3865b787eb minor #31483 [Messenger] Add from_transport in subscriber's phpdoc (sroze)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Add `from_transport` in subscriber's phpdoc

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

Add the `from_transport` to the subscriber's phpdoc as it was missed from the original PR.

Commits
-------

6a542cd738 Add transport in subscriber's phpdoc
2019-05-13 08:55:08 +02:00
Fabien Potencier
a326acc056 feature #31294 [Form] Add intl/choice_translation_locale option to TimezoneType (ro0NL)
This PR was merged into the 4.3 branch.

Discussion
----------

[Form] Add intl/choice_translation_locale option to TimezoneType

| 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 | #28836
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/11503

final step :)

for now i think any form of grouping is a user concern (i.e. by GMT offset or area name); see #31293 + #31295

having a special built in `group_by' => 'gmt_offset'` util would be nice, and can be done in the future.

includes #31434

Commits
-------

001b930611 [Form] Add intl/choice_translation_locale option to TimezoneType
2019-05-13 08:53:52 +02:00
Fabien Potencier
3a17701343 feature #31452 [FrameworkBundle] Add cache configuration for PropertyInfo (alanpoulain)
This PR was squashed before being merged into the 4.3 branch (closes #31452).

Discussion
----------

[FrameworkBundle] Add cache configuration for PropertyInfo

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

The PropertyInfoExtractor was not cached by default but the class to do it was surprisingly here, unused.

I've added the configuration to enable it by default when it's not the development environment.

I haven't added the warmup part because there are too much arguments for the methods (class, property, context).

It will be a big boost for the performance! For this code:

```php
$book = $this->serializer->deserialize('{"id":3,"reviews":[{"id": 7, "body": "This book is fantastic!", "rating": 9, "letter": "A", "publicationDate": "2019"}],"isbn":"978-0-5533-9243-2","title":"Fool\'s Assassin","description":"A famous saga","author":"Robin Hobb","publicationDate":"2014"}', Book::class, 'json');
$this->serializer->serialize($book, 'json');
```

We obtain this:

![image](https://user-images.githubusercontent.com/10920253/57487994-2874d000-72b2-11e9-92a2-28b14a038194.png)

The Blackfire comparison is here: https://blackfire.io/profiles/compare/2c746d26-320a-4aab-80ef-7276c2e92b96/graph

Commits
-------

17f6225d0f [FrameworkBundle] Add cache configuration for PropertyInfo
2019-05-13 08:44:35 +02:00
Alan Poulain
17f6225d0f [FrameworkBundle] Add cache configuration for PropertyInfo 2019-05-13 08:44:27 +02:00
Fabien Potencier
0d196c46a5 feature #31486 [Doctrine][PropertyInfo] Detect if the ID is writeable (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Doctrine][PropertyInfo] Detect if the ID is writeable

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

Companion of #31481. Allows to detect that ids with a generated value aren't writable (because the DBMS will generate the ID by itself). It could be considered as a bug fix or as a new feature. I prefer to not merge in in 3.4. However, it becomes necessary for autovalidation to work with such entities, so it should be in 4.3:

```php
/**
 * @Entity
 */
class Foo
{
    /**
     * @Id
     * @GeneratedValue(strategy="AUTO")
     * @Column(type="integer")
     */
    public $id;
}
```

Commits
-------

4598235192 [Doctrine][PropertyInfo] Detect if the ID is writeable
2019-05-13 08:41:44 +02:00
Fabien Potencier
b7cd925436 bug #31481 [Validator] Autovalidation: skip readonly props (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Validator] Autovalidation: skip readonly props

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

Read-only properties (such as an autogenerated ID) must be skipped during the validation (it makes no sense to validate a RO property anyway).
This is an allowed BC break because this feature will be introduced in 4.3.

Commits
-------

e7dc5e1045 [Validator] Autovalidation: skip readonly props
2019-05-13 08:38:56 +02:00
David Prévot
79058633ca Drop useless executable bit
The files were added as executable via #28477.
2019-05-12 17:52:16 -10:00
Kévin Dunglas
4598235192
[Doctrine][PropertyInfo] Detect if the ID is writeable 2019-05-12 22:41:45 +02:00
Samuel ROZE
6a542cd738 Add transport in subscriber's phpdoc 2019-05-12 16:09:02 +01:00
Nicolas Grekas
1620baf1b5 bug #31477 [PropertyAccess] Add missing property to PropertyAccessor (vudaltsov)
This PR was squashed before being merged into the 4.2 branch (closes #31477).

Discussion
----------

[PropertyAccess] Add missing property to PropertyAccessor

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

Commits
-------

b1d3736c40 [PropertyAccess] Add missing property to PropertyAccessor
2019-05-12 13:08:38 +02:00
Valentin
b1d3736c40 [PropertyAccess] Add missing property to PropertyAccessor 2019-05-12 13:08:31 +02:00
Nicolas Grekas
1ecc6a6c03 bug #31479 [Cache] fix saving unrelated keys in recursive callback calls (nicolas-grekas)
This PR was merged into the 4.2 branch.

Discussion
----------

[Cache] fix saving unrelated keys in recursive callback calls

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

Commits
-------

4443c2018c [Cache] fix saving unrelated keys in recursive callback calls
2019-05-12 12:40:49 +02:00
Kévin Dunglas
e7dc5e1045
[Validator] Autovalidation: skip readonly props 2019-05-12 11:42:24 +02:00
Nicolas Grekas
4443c2018c [Cache] fix saving unrelated keys in recursive callback calls 2019-05-11 20:09:18 +02:00
Nicolas Grekas
6c5faef5cb bug #30930 [FrameworkBundle] Fixed issue when a parameter contains a '%' (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] Fixed issue when a parameter contains a '%'

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

---

On my computer:
```
dump(get_cfg_var('xdebug.file_link_format'));
"subl://%f:%l"
```

When I ran `bin/console debug:config framework` I got this exception:

```

In ParameterBag.php line 100:

  [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
  The parameter "templating.helper.code.file_link_format" has a
dependency on a non-existent parameter "f:".

Exception trace:
 () at
/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:100
...
```

This issue was introduced [here](https://github.com/symfony/symfony/pull/27684/files#diff-b3847149480405e1de881530b4c75ab5L212) / cc @ro0NL

This PR does not really fix the issue: I'm able to debug the config, The
the `debug:container --env-vars` does not work anymore. How could we fix
both issue? cc @nicolas-grekas

Commits
-------

7bcd714381 [FrameworkBundle] Fixed issue when a parameter container a '%'
2019-05-11 19:07:23 +02:00
Nicolas Grekas
52e827c9cf [DI] default to service id - *not* FQCN - when building tagged locators 2019-05-11 18:47:04 +02:00
Nicolas Grekas
7ef80ff2ff minor #31395 [Cache] Log a more readable message when trying to cache an unsupported type (Deuchnord)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] Log a more readable message when trying to cache an unsupported type

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

Improved the warning risen when trying to save something that has a non-supported type in the Simple cache.

For instance, let's say the following code:
```php
class TestCommand extends Command
{
    private $cache;

    public function __construct(CacheInterface $cache)
    {
        parent::__construct();
        $this->cache = $cache;
    }

    // ...

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $n = $this->cache->get('n', function () {
            return function () {
                return rand(0,10);
            };
        });

        dump($n());
    }
}
```

Running this code will give the following:
```
14:32:03 WARNING   [cache] Could not save key "n" in cache: the Closure type is not supported.
0
```

Commits
-------

21ba3c07a0 [Cache] Log a more readable error message when saving into cache fails
2019-05-11 12:15:48 +02:00
Jérôme Deuchnord
21ba3c07a0 [Cache] Log a more readable error message when saving into cache fails 2019-05-11 12:14:36 +02:00
Nicolas Grekas
00552848f8 bug #31438 [Serializer] Fix denormalization of object with variadic constructor typed argument (ajgarlag)
This PR was squashed before being merged into the 3.4 branch (closes #31438).

Discussion
----------

[Serializer] Fix denormalization of object with variadic constructor typed argument

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

This PR adds a test to demonstrate the bug, and a fix to squash it.

Commits
-------

c8c3c56cc8 [Serializer] Fix denormalization of object with variadic constructor typed argument
2019-05-11 11:57:45 +02:00
Antonio J. García Lagar
c8c3c56cc8 [Serializer] Fix denormalization of object with variadic constructor typed argument 2019-05-11 11:57:38 +02:00
Nicolas Grekas
b9d3135b1f bug #31445 [Messenger] Making cache rebuild correctly when message subscribers change (weaverryan)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Making cache rebuild correctly when message subscribers change

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

An edge-case that's identical to `EventSubscriberInterface`: when the return value of `getHandledMessages()` changes, the container needs to be rebuilt.

If you're wondering why these checks aren't in their own resource class, see #25984 - it's something we probably should do, but haven't done yet.

Commits
-------

d88446be07 Making cache rebuild correctly with MessageSubscriberInterface return values
2019-05-11 11:56:45 +02:00
Nicolas Grekas
3ae1e802ad bug #31442 [Validator] Fix finding translator parent definition in compiler pass (deguif)
This PR was merged into the 4.2 branch.

Discussion
----------

[Validator] Fix finding translator parent definition in compiler pass

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

Method `ChildDefintion::getParent()` returns a string, but here it is expected to return an object of class `Definition` in order to call `getClass` on it in the loop.

Commits
-------

d261bb5dd1 Fix finding parent definition
2019-05-11 11:53:29 +02:00
Antoine Makdessi
6583e5a1d7 Update WorkflowEvents.php 2019-05-11 11:33:04 +02:00
Fabien Potencier
22ffa5fcd6 feature #31454 [Messenger] remove send_and_handle which can be achieved with SyncTransport (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] remove send_and_handle which can be achieved with SyncTransport

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

The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759

So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing
```yaml
framework:
    messenger:
        routing:
            'My\Message\ThatIsGoingToBeSentAndHandledLocally':
                 senders: [amqp]
                 send_and_handle: true
```
is the same as
```yaml
framework:
    messenger:
        routing:
            'My\Message\ThatIsGoingToBeSentAndHandledLocally':
                 senders: [amqp, sync]
```

https://github.com/symfony/symfony/pull/31401#pullrequestreview-235396370

Commits
-------

4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport
2019-05-11 08:56:15 +02:00
Fabien Potencier
78003969f8 bug #31425 [Messenger] On failure retry, make message appear received from original sender (weaverryan)
This PR was squashed before being merged into the 4.3 branch (closes #31425).

Discussion
----------

[Messenger] On failure retry, make message appear received from original sender

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

Fixes a bug when using the transport-based handler config from #30958. This also adds a pretty robust integration test that dispatches a complex message with transport-based handler config, failures, failure transport, etc - and verifies the correct behavior.

Cheers!

Commits
-------

80b5df270f [Messenger] On failure retry, make message appear received from original sender
2019-05-11 08:54:00 +02:00
Ryan Weaver
80b5df270f [Messenger] On failure retry, make message appear received from original sender 2019-05-11 08:53:51 +02:00
Tobias Schultze
4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport 2019-05-11 08:47:26 +02:00
Tobias Schultze
fe0f324751 bug #31472 [Messenger] Fix routable message bus default bus (weaverryan)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix routable message bus default bus

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

In #31288, we gave the `RoutableMessageBus` a "default" bus. We did that by using the `MessageBusInterface` service in the locator. But, no such service exists - I think that was just a huge oversight (and maybe @dirk39 named a bus this in the project he was testing on?). The services in the locator are very simply the keys under `framework.messenger.buses` or the default, which is a single `messenger.bus.default` id. There is an alias in the container for `MessageBusInterface`, but this is not added to the locator (and adding it would be a bit awkward, as `MessengerPass` is in the component and the interface alias is entirely a framework thing).

Cheers!

Commits
-------

42e0536d8f Changing how RoutableMessageBus fallback bus works
2019-05-11 08:29:54 +02:00
Marcos Gómez Vilches
8bac3d6fa3
Allow set 'None' on samesite cookie flag
Allow set samesite cookie flag to 'None' value
2019-05-10 21:58:31 +02:00
Ryan Weaver
a7cf3f997a Fixing tests - passing pdo is not wrapped for some reason in dbal 2019-05-10 14:00:00 -04:00
Ryan Weaver
42e0536d8f Changing how RoutableMessageBus fallback bus works 2019-05-10 13:35:34 -04:00
Kévin Dunglas
1bdf2af0da
[Serializer] Fix BC break: DEPTH_KEY_PATTERN must be public 2019-05-10 12:50:04 +02:00
Grégoire Pineau
7bcd714381 [FrameworkBundle] Fixed issue when a parameter container a '%'
On my computer:
```
dump(get_cfg_var('xdebug.file_link_format'));
"subl://%f:%l"
```

When I ran `bin/console debug:config framework` I got this exception:

```

In ParameterBag.php line 100:

  [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
  The parameter "templating.helper.code.file_link_format" has a
dependency on a non-existent parameter "f:".

Exception trace:
 () at
/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:100
...
```

This issue was introduced
[here](https://github.com/symfony/symfony/pull/27684/files#diff-b3847149480405e1de881530b4c75ab5L212)
2019-05-10 11:48:49 +02:00
Jonas Elfering
bdeeae1510 Fix the interface incompatibility of EventDispatchers
The `LegacyEventDispatcherProxy` now implements the full
`EventDispatcherInterface` from the `EventDispatcherBundle`.
Before it just implemented the Interface from the `Contracts` Bundle,
that made it incompatible with the `WrappedListener`.
This fixes #31457.
2019-05-10 10:17:32 +02:00
Fabien Potencier
ae38ed80e2 bug #31458 [TwigBundle] Fix Mailer integration in Twig (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle] Fix Mailer integration in Twig

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

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

Commits
-------

53b68afec4 [TwigBundle] fixed Mailer integration in Twig
2019-05-10 10:01:19 +02:00
Fabien Potencier
53b68afec4 [TwigBundle] fixed Mailer integration in Twig 2019-05-10 09:52:53 +02:00
Fabien Potencier
e19db439d8 Merge branch '4.3'
* 4.3:
  removed deprecated usage of some Twig features
2019-05-10 09:14:12 +02:00
Fabien Potencier
e75ed98979 Merge branch '4.2' into 4.3
* 4.2:
  removed deprecated usage of some Twig features
2019-05-10 09:13:57 +02:00
Fabien Potencier
74afcd6777 removed deprecated usage of some Twig features 2019-05-10 08:54:47 +02:00
Roland Franssen
001b930611 [Form] Add intl/choice_translation_locale option to TimezoneType 2019-05-10 08:51:52 +02:00
Fabien Potencier
0ad9f24c01 Merge branch '4.3'
* 4.3:
  Fix typo: depreciation -> deprecation
  [Form] Restore default locale during tests
2019-05-10 07:38:57 +02:00
Fabien Potencier
9e55e9c982 Merge branch '4.2' into 4.3
* 4.2:
  Fix typo: depreciation -> deprecation
  [Form] Restore default locale during tests
2019-05-10 07:38:46 +02:00
Fabien Potencier
3fcec72a78 Merge branch '3.4' into 4.2
* 3.4:
  [Form] Restore default locale during tests
2019-05-10 07:37:49 +02:00
Jon Dufresne
11ed09813f Fix typo: depreciation -> deprecation 2019-05-10 07:33:12 +02:00
Roland Franssen
7fce86f1db [Form] Restore default locale during tests 2019-05-09 19:39:59 +02:00
Ryan Weaver
d88446be07 Making cache rebuild correctly with MessageSubscriberInterface return values 2019-05-09 12:56:19 -04:00
Nicolas Grekas
79814a2f3d Merge branch '4.3'
* 4.3:
  [Doctrine\Bridge] fix tests
  [Intl] Revise timezone name generation
  Simplifying SyncTransport and fixing bug with handlers transport
  [DomCrawler] fix HTML5 parser integration
2019-05-09 16:07:05 +02:00
Nicolas Grekas
4f290d784c minor #31257 [DomCrawler] fix HTML5 parser integration (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DomCrawler] fix HTML5 parser integration

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

Spotted while reviewing #30892
The current logic is context-dependent: by changing the order of calls, you can get different behaviors.

Commits
-------

ba83bdadb1 [DomCrawler] fix HTML5 parser integration
2019-05-09 16:02:42 +02:00
Nicolas Grekas
cbbf8b7fd6 minor #31434 [Intl] Revise timezone name generation (ro0NL)
This PR was merged into the 4.3 branch.

Discussion
----------

 [Intl] Revise timezone name generation

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

This is the final polishing needed for #31294 :)

I've realized it's much easier to de-duplicate by processing fallback locales separate, and then only keep the diff compared to a specific locale. More or less the same approach `LocaleDataGenerator` already follows. I was trying to be clever and filter based on inheritance in a single process; bad idea.

Includes https://github.com/ro0NL/symfony/commit/31591d0 (ref #31432)

Commits
-------

bfdb4ed492 [Intl] Revise timezone name generation
2019-05-09 15:59:36 +02:00
Nicolas Grekas
10da2310da [Doctrine\Bridge] fix tests 2019-05-09 15:22:32 +02:00
François-Xavier de Guillebon
d261bb5dd1
Fix finding parent definition 2019-05-09 15:04:55 +02:00
Tobias Schultze
04f117f8e2 minor #31401 [Messenger] Simplifying SyncTransport and fixing bug with handlers transport (weaverryan)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Simplifying SyncTransport and fixing bug with handlers transport

| 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

This is still a WIP, because it's not quite working and tests are a TODO. However, the basic idea is there. This makes SyncTransport less "weird". It acts more like a real transport... except that it "receives" and re-dispatches its message immediately.

The bug I'm trying to fix is related to the transport-based handling config that @sroze introduced. It doesn't currently play nice with the sync transport due to the unnatural way that I made it originally.

Cheers!

Commits
-------

8a49eb8660 Simplifying SyncTransport and fixing bug with handlers transport
2019-05-09 14:09:13 +02:00
Nicolas Grekas
780439dcc3 Merge branch '4.3'
* 4.3:
  [Routing] Fixed unexpected 404 NoConfigurationException
  [DI] Removes number of elements information in debug mode
  [Contracts] Simplify implementation declarations
  Update PR template for 4.3
  [Intl] Add FallbackTrait for data generation
  [Console] Commands with an alias should not be recognized as ambiguous
  clarify the possible class/interface of the cache
2019-05-09 11:43:27 +02:00
Roland Franssen
bfdb4ed492 [Intl] Revise timezone name generation 2019-05-09 11:38:41 +02:00
Nicolas Grekas
7a53e8d3f9 Merge branch '4.2' into 4.3
* 4.2:
  [Routing] Fixed unexpected 404 NoConfigurationException
  [DI] Removes number of elements information in debug mode
  [Contracts] Simplify implementation declarations
  Update PR template for 4.3
  [Intl] Add FallbackTrait for data generation
  [Console] Commands with an alias should not be recognized as ambiguous
  clarify the possible class/interface of the cache
2019-05-09 11:33:12 +02:00
Nicolas Grekas
c083e20cf2 Merge branch '3.4' into 4.2
* 3.4:
  [DI] Removes number of elements information in debug mode
  Update PR template for 4.3
  [Intl] Add FallbackTrait for data generation
  [Console] Commands with an alias should not be recognized as ambiguous
  clarify the possible class/interface of the cache
2019-05-09 11:19:46 +02:00
Nicolas Grekas
77684e44dd bug #31207 [Routing] Fixed unexpected 404 NoConfigurationException (yceruto)
This PR was merged into the 4.2 branch.

Discussion
----------

[Routing] Fixed unexpected 404 NoConfigurationException

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

This is the patch for 4.2+
We need a different patch for 3.4 that is more complex, I think.

Commits
-------

aa71a42a49 [Routing] Fixed unexpected 404 NoConfigurationException
2019-05-09 11:06:20 +02:00
Yonel Ceruto
aa71a42a49 [Routing] Fixed unexpected 404 NoConfigurationException 2019-05-09 11:03:29 +02:00
Nicolas Grekas
fb4d92877f bug #31261 [Console] Commands with an alias should not be recognized as ambiguous when using register (Simperfit)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Commands with an alias should not be recognized as ambiguous when using register

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

I think when passing an alias, it should not be treated as a ambiguous command since it's configured to response to it.

I've [pushed a commit](2f5209a687) that reproduce the bug and with this patch it does work.

Commits
-------

ae7ee46465 [Console] Commands with an alias should not be recognized as ambiguous
2019-05-09 10:42:51 +02:00
Nicolas Grekas
284c21648a bug #31371 [DI] Removes number of elements information in debug mode (jschaedl)
This PR was squashed before being merged into the 3.4 branch (closes #31371).

Discussion
----------

[DI] Removes number of elements information in debug mode

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

With this services config:

```yaml
my_service:
    class: stdClass
    arguments: [!tagged my_tag]

my_tagged_service_1:
    class: stdClass
    tags: [my_tag]

my_tagged_service_2:
    class: stdClass
    tags: [my_tag]
```
Executing `./bin/console debug:container my_service --show-arguments --env=dev` resulted in

```bash
Information for Service "my_service"
====================================

 ---------------- -------------------------
  Option           Value
 ---------------- -------------------------
  Service ID       my_service
  Class            stdClass
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        yes
  Autoconfigured   yes
  Arguments        Iterator (0 element(s))
 ---------------- -------------------------
```
 With this fix the output changed to:

```bash
Information for Service "my_service"
====================================

 ---------------- ------------
  Option           Value
 ---------------- ------------
  Service ID       my_service
  Class            stdClass
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        yes
  Autoconfigured   yes
  Arguments        Tagged Iterator for "my_tag"
 ---------------- ------------
```

and with `./bin/console debug:container my_service --show-arguments --env=prod`

```bash
Information for Service "my_service_tagged_iterator"
====================================================

 ---------------- ---------------------------------------------
  Option           Value
 ---------------- ---------------------------------------------
  Service ID       my_service
  Class            stdClass
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        yes
  Autoconfigured   yes
  Arguments        Tagged Iterator for "my_tag" (2 element(s))
 ---------------- ---------------------------------------------
```

Commits
-------

0da4b83197 [DI] Removes number of elements information in debug mode
2019-05-09 10:36:03 +02:00
Jan Schädlich
0da4b83197 [DI] Removes number of elements information in debug mode 2019-05-09 10:35:56 +02:00
Nicolas Grekas
81b415767e bug #31418 [FrameworkBundle] clarify the possible class/interface of the cache (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] clarify the possible class/interface of the cache

| 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 the fallback cache pool is returned (on PHP 5.6, HHVM, or when
Opcache is disabled), the configured service can be any implementation
of the CacheItemPoolInterface.

Commits
-------

40273745ce clarify the possible class/interface of the cache
2019-05-09 10:32:22 +02:00
Nicolas Grekas
9ce27da407 minor #31432 [Intl] Add FallbackTrait for data generation (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Add FallbackTrait for data generation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| 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 -->

This is the last architectural change for the Intl data compilation. Promised.

It fixes de-duplicating a locale from its fallback locale. The problem is it uses a while-loop, comparing the locale to each fallback locale.

Given

- `root` (val=A)
  - `ur` (val=B)
    - `ur_IN` (val=A)

We have an edge case where a locale (ur_IN) override its fallback locale (ur), setting/restoring the value back to the root locale. This happens for the GMT format in the timezone bundle i know of ... in this case the `ur_IN` locale needs to write its own value.

The current approach is a while-loop comparing each fallback locale (ur, root) to the current locale (ur_IN). Eventually comparing `ur_IN <> root`, which causes a wrong diff, as such `ur_IN` falls back to `ur` providing the wrong value (val=B, where val=A is expected).

The new approach uses recursion so we only compare `ur <> ur_IN`, where `ur_IN` on itself is compared to `root`.

4.2) https://github.com/ro0NL/symfony/commit/e24d8e6
4.3) https://github.com/ro0NL/symfony/commit/31591d0

Commits
-------

36ddfd58b9 [Intl] Add FallbackTrait for data generation
2019-05-09 10:31:33 +02:00
Nicolas Grekas
7d51da36a7 [Contracts] Simplify implementation declarations 2019-05-09 09:39:53 +02:00
Fabien Potencier
387207f6c4 updated version to 4.4 2019-05-09 09:23:25 +02:00
Fabien Potencier
6852c84e82 bumped Symfony version to 4.3.0 2019-05-09 08:21:48 +02:00
Fabien Potencier
1ee6021ca1 updated VERSION for 4.3.0-BETA1 2019-05-09 08:08:49 +02:00
Ryan Weaver
8a49eb8660 Simplifying SyncTransport and fixing bug with handlers transport 2019-05-08 21:09:33 -04:00
Fabien Potencier
e6071a15c2 fixed test on Windows 2019-05-08 22:09:06 +02:00
Fabien Potencier
5b7a924c3d fixed tests 2019-05-08 22:09:06 +02:00
Fabien Potencier
49ceb1e662 fixed a test 2019-05-08 22:09:05 +02:00
Fabien Potencier
aac59b167f fixed tests 2019-05-08 22:09:05 +02:00
Fabien Potencier
f646914601 Merge branch '4.2'
* 4.2:
  refactored code
2019-05-08 22:08:47 +02:00
Fabien Potencier
3fc97ce1c5 Merge branch '3.4' into 4.2
* 3.4:
  refactored code
2019-05-08 22:08:34 +02:00
Fabien Potencier
b4364aa014 refactored code 2019-05-08 22:08:18 +02:00
Roland Franssen
36ddfd58b9 [Intl] Add FallbackTrait for data generation 2019-05-08 21:38:40 +02:00
Fabien Potencier
32785185be Merge branch '4.2'
* 4.2:
  fixed CS
  [Intl] Enable error handler during compile
2019-05-08 21:23:04 +02:00
Fabien Potencier
a3c3c4417c Merge branch '3.4' into 4.2
* 3.4:
  [Intl] Enable error handler during compile
2019-05-08 21:22:49 +02:00
Fabien Potencier
95e53ed7e0 fixed CS 2019-05-08 19:26:55 +02:00
Fabien Potencier
72863e441f fixed CS 2019-05-08 19:18:10 +02:00
Roland Franssen
914653d866 [Intl] Enable error handler during compile 2019-05-08 18:03:40 +02:00
Fabien Potencier
7c2305d9e9 bug #31423 Fix compat with older versions of PHP (fabpot)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Fix compat with older versions of PHP

| 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?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

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

07b9af2eff fixed compat with older versions of PHP
2019-05-08 15:49:48 +02:00
Fabien Potencier
07b9af2eff fixed compat with older versions of PHP 2019-05-08 15:47:25 +02:00
Amrouche Hamza
ae7ee46465
[Console] Commands with an alias should not be recognized as ambiguous 2019-05-08 12:29:47 +02:00
Christian Flothmann
40273745ce clarify the possible class/interface of the cache
When the fallback cache pool is returned (on PHP 5.6, HHVM, or when
Opcache is disabled), the configured service can be any implementation
of the CacheItemPoolInterface.
2019-05-08 11:57:35 +02:00
Roland Franssen
ee25226971 [Intl][4.3] Fix root fallback locale 2019-05-08 08:53:09 +02:00
Fabien Potencier
40e100d3a8 Merge branch '4.2'
* 4.2:
  [Intl] Fix root fallback locale
  fixed CS
2019-05-08 08:52:59 +02:00
Fabien Potencier
74cbe5af9f Merge branch '3.4' into 4.2
* 3.4:
  [Intl] Fix root fallback locale
  fixed CS
2019-05-08 08:50:14 +02:00
Fabien Potencier
b2df5ca2b2 bug #31410 [Messenger] Fixing missed tests from #31355 (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Fixing missed tests from #31355

| 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

Tests I missed from #31355 - sorry about that!

Commits
-------

ab3744961d Fixing missed tests from #31355
2019-05-08 08:17:17 +02:00
Roland Franssen
11ff24a665 [Intl] Fix root fallback locale 2019-05-07 23:35:39 +02:00
Roland Franssen
4b460eef82 [Intl] recompile master 2019-05-07 21:05:40 +02:00
Ryan Weaver
ab3744961d Fixing missed tests from #31355 2019-05-07 10:25:03 -04:00
Fabien Potencier
b2f5b8a1e2 feature #31249 [Translator] Set sources when extracting strings from php files (Stadly)
This PR was squashed before being merged into the 4.3-dev branch (closes #31249).

Discussion
----------

[Translator] Set sources when extracting strings from php files

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

Set metadata about filenames and line numbers when extracting translatable strings from php files. This PR complements #30909 and #31248, as those PRs implement support for dumping the filenames and line numbers to Po and Qt file formats.

Commits
-------

f05d4e41be [Translator] Set sources when extracting strings from php files
2019-05-07 13:11:03 +02:00
Stadly
f05d4e41be [Translator] Set sources when extracting strings from php files 2019-05-07 13:10:55 +02:00
Fabien Potencier
224ab703c1 bug #31355 [Messenger] Adding final routing key to delay queue name (weaverryan)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Adding final routing key to delay queue name

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

Fixes #31241.

When we delay, we create a queue whose `x-message-ttl` matches the delay length and `x-dead-letter-routing-key` matches the original routing key used for the message. However, before this PR, the original routing key was not part of that queue's name. The result is that if two messages were delayed by the same length, but with different routing keys, the second would try to "redeclare" the existing delay queue with a new `x-dead-letter-routing-key`, resulting in an error similar to:

> Server channel error: 406, message: PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-routing-key' for queue 'delay_queue_1000'

Integration test was improved to catch this.

Cheers!

Commits
-------

9940e71ae1 fixing a bug where the delay queue name did not contain the final routing key
2019-05-07 12:54:07 +02:00
Fabien Potencier
6c6f76f217 fixed CS 2019-05-07 12:18:14 +02:00
Fabien Potencier
555280878b minor #31405 [Dotenv] Test do not use putenv (xuanquynh)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Dotenv] Test do not use putenv

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

The related pull request is https://github.com/symfony/symfony/pull/31062.

If the `$usePutenv` flag is set to `false`, `putenv` won't be executed. I just add a small test for this situation.

Commits
-------

6d1a76e998 Test do not use putenv
2019-05-07 12:14:10 +02:00
Fabien Potencier
e387854288 minor #31403 [Intl][4.3] Apply localeDisplayPattern and fix locale generation (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #31403).

Discussion
----------

[Intl][4.3] Apply localeDisplayPattern and fix locale generation

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| 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 -->

Follow up of #31337 & #31402  for 4.3 / master

Commits
-------

ed04f242d2 recompile
504db27860 re-apply api changes for TimezoneDataGenerator
c443e78dde re-apply translator parents.json generation
bf50b61f2a [Intl] Apply localeDisplayPattern and fix locale generation
2019-05-07 12:11:50 +02:00
Fabien Potencier
da62835823 Merge branch '4.2'
* 4.2:
  recompile
  re-apply translator parents.json generation
  [Intl] Apply localeDisplayPattern and fix locale generation
  recompile
  [Intl] Apply localeDisplayPattern and fix locale generation
2019-05-07 12:08:52 +02:00
Quynh Xuan Nguyen
6d1a76e998 Test do not use putenv 2019-05-07 16:02:05 +07:00
Roland Franssen
ed04f242d2 recompile 2019-05-07 10:43:45 +02:00
Roland Franssen
504db27860 re-apply api changes for TimezoneDataGenerator 2019-05-07 10:41:50 +02:00
Roland Franssen
c443e78dde re-apply translator parents.json generation 2019-05-07 10:40:27 +02:00
Roland Franssen
bf50b61f2a [Intl] Apply localeDisplayPattern and fix locale generation 2019-05-07 10:39:48 +02:00
Roland Franssen
c902c8aea0 recompile 2019-05-07 10:22:02 +02:00
Roland Franssen
a3164debf8 re-apply translator parents.json generation 2019-05-07 10:20:14 +02:00
Roland Franssen
294ae7a2b5 [Intl] Apply localeDisplayPattern and fix locale generation 2019-05-07 10:06:38 +02:00
Roland Franssen
a20a6ccac4 recompile 2019-05-07 09:01:27 +02:00
Roland Franssen
29e8aba14b [Intl] Apply localeDisplayPattern and fix locale generation 2019-05-07 08:59:08 +02:00
Roland Franssen
1bb7ddeb75 [Intl] Made countries ISO 3166 compliant + exclude Zzzz script code 2019-05-07 08:50:30 +02:00
Fabien Potencier
2e872c4be0 Merge branch '4.2'
* 4.2:
  [Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
  Translated form, security, validators resources into Belarusian (be)
  [WebProfilerBundle] Don't filter submitted IP values
  [Intl] Cleanup
  bumped Symfony version to 4.2.9
  updated VERSION for 4.2.8
  updated CHANGELOG for 4.2.8
  bumped Symfony version to 3.4.28
  updated VERSION for 3.4.27
  update CONTRIBUTORS for 3.4.27
  updated CHANGELOG for 3.4.27
2019-05-07 08:08:50 +02:00
Fabien Potencier
4304fb8e05 Merge branch '3.4' into 4.2
* 3.4:
  [Intl] Cleanup
2019-05-07 07:54:54 +02:00
Fabien Potencier
16c460c6d6 minor #31366 [Intl] Cleanup (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Cleanup

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| 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 -->

cleanup of #31365 for 3.4 + some other stuff to keep in sync across branches

Commits
-------

70a941ec0c [Intl] Cleanup
2019-05-07 07:53:33 +02:00
Ryan Weaver
9940e71ae1 fixing a bug where the delay queue name did not contain the final routing key 2019-05-06 21:02:46 -04:00
Alexander Schranz
072e466355 [Messenger] Fix rejecting of pending messages 2019-05-06 17:19:44 +02:00
Fabien Potencier
ecfccc6ef0 feature #31060 [Validator] Make API endpoint for NotCompromisedPasswordValidator configurable (xelan)
This PR was squashed before being merged into the 4.3-dev branch (closes #31060).

Discussion
----------

[Validator] Make API endpoint for NotCompromisedPasswordValidator configurable

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes, but acceptable [1]
| Deprecations? | no [1]
| Tests pass?   | yes
| Fixed tickets | #30871, #31054
| License       | MIT
| Doc PR        | symfony/symfony-docs#... (TODO)

Makes the API endpoint for the `NotCompromisedPasswordValidator` configurable. The endpoint includes the placeholder which will be replaced with the first digits of the password hash for k-anonymity.

The endpoint can either be set via constructor injection of the validator if the component is used standalone, or via the framework configuration of symfony/framework-bundle.

[1] As discussed in #31054, the validator is not in a stable release yet, therefore the BC break is considered acceptable. No deprecation / BC layer is necessary.

Commits
-------

f6a80c214d [Validator] Make API endpoint for NotCompromisedPasswordValidator configurable
2019-05-06 13:55:51 +02:00
Andreas Erhard
f6a80c214d [Validator] Make API endpoint for NotCompromisedPasswordValidator configurable 2019-05-06 13:55:26 +02:00
Fabien Potencier
b9637c9209 Merge branch '3.4' into 4.2
* 3.4:
  [Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
  Translated form, security, validators resources into Belarusian (be)
  [WebProfilerBundle] Don't filter submitted IP values
  bumped Symfony version to 3.4.28
  updated VERSION for 3.4.27
  update CONTRIBUTORS for 3.4.27
  updated CHANGELOG for 3.4.27
2019-05-06 13:28:52 +02:00
Fabien Potencier
4e61ff535e bug #31387 [Messenger] Fix Redis Connection::get() after reject() (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Fix Redis Connection::get() after reject()

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

If a message is rejected, another consumer cannot read from the stream because the first subsequent call to `\Redis::xreadgroup()` returns false for some reason.
Reproducer: https://github.com/chalasr/redis-transport-bug

ping @alexander-schranz

Commits
-------

c05273f793 [Messenger] Fix Redis Connection::get() after reject()
2019-05-06 13:25:34 +02:00
Fabien Potencier
bee5216ae8 minor #31389 [Messenger] fix wrong use of generator returns (Tobion)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] fix wrong use of generator returns

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I've seen this problem many times: Mixing `yield` with `return []`.
Unfortunately it cannot be forbidden at the compiler level because it's actually a feature: https://www.php.net/manual/de/generator.getreturn.php
But usually not intended that way.
Also added some other minor cleanups I've found.

Commits
-------

e8a09e9d85 [Messenger] fix wrong use of generator returns
2019-05-06 13:17:40 +02:00
Fabien Potencier
660b18fe39 minor #31392 Make the exception messages consistent across the board (fabpot)
This PR was merged into the 4.3-dev branch.

Discussion
----------

Make the exception messages consistent across the board

| Q             | A
| ------------- | ---
| Branch?       | master
| 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
| License       | MIT
| Doc PR        | n/a

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

84c67193bc made the esception messages consistent across the board
2019-05-06 13:16:34 +02:00
Fabien Potencier
0807720ece fixed CS 2019-05-06 13:15:22 +02:00
Tobias Schultze
e8a09e9d85 [Messenger] fix wrong use of generator returns
And some other minor cleanups
2019-05-06 12:22:55 +02:00
Fabien Potencier
84c67193bc made the esception messages consistent across the board 2019-05-06 12:03:55 +02:00
Fabien Potencier
fec95e01a2 bug #31354 [Intl][Validator] Handle alias locales/timezones (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #31354).

Discussion
----------

[Intl][Validator] Handle alias locales/timezones

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes (including intl-data group)
| Fixed tickets | #31022
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

both timezones and locales have aliases (either thru deprecation/migration/etc.)

for locales we compile a mapping, for timezones we dont. yet we can benefit partial alias support thru DateTimeZone, which knows about most timezone IDs already.

both the timezone + locale validator already support aliases. Connsequently, we should support aliases in  `Timezones::exists()`  + `Locales::exists()` as well IMHO.

so far so good; the catch is; with this PR `Locales::getName()` supports aliases, whereas `Timezones::getName()` doesnt. I think it's reasonable for now, until we compile the timezone mapping so we can widen the timezone ID conversion here.

Commits
-------

0a9be0df6e [Intl][Validator] Handle alias locales/timezones
2019-05-06 11:58:38 +02:00
Roland Franssen
0a9be0df6e [Intl][Validator] Handle alias locales/timezones 2019-05-06 11:58:29 +02:00
Fabien Potencier
26e1d8948e feature #31353 [FrameworkBundle] Show injected services for iterator and array arguments (jschaedl)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] Show injected services for iterator and array arguments

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

When I have the following service configuration:

```yaml
    App\Word\Checker\StaticWordChecker:
        tags: [app.checker]

    App\Word\Checker\BannedWorldListChecker:
        tags: [app.checker]

    App\Word\WordCheckerTaggedIterator:
        arguments: [!tagged app.checker]

    App\Word\WordCheckerArray:
        arguments:
            - App\Word\Checker\StaticWordChecker: ~
              App\Word\Checker\BannedWorldListChecker: ~
```

and I run:
`./bin/console debug:container App\Word\WordCheckerArray --show-arguments`
```bash
Information for Service "App\Word\WordCheckerArray"
===================================================

 ---------------- -------------------------------------------
  Option           Value
 ---------------- -------------------------------------------
  Service ID       App\Word\WordCheckerArray
  Class            App\Word\WordCheckerArray
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        yes
  Autoconfigured   yes
  Arguments        Array (2 element(s))
                   - App\Word\Checker\StaticWordChecker
                   - App\Word\Checker\BannedWorldListChecker
 ---------------- -------------------------------------------
```
or

`./bin/console debug:container App\Word\WordCheckerTaggedIterator --show-arguments`
```bash
Information for Service "App\Word\WordCheckerTaggedIterator"
============================================================

 ---------------- -------------------------------------------
  Option           Value
 ---------------- -------------------------------------------
  Service ID       App\Word\WordCheckerTaggedIterator
  Class            App\Word\WordCheckerTaggedIterator
  Tags             -
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        yes
  Autoconfigured   yes
  Arguments        Iterator (2 element(s))
                   - App\Word\Checker\BannedWorldListChecker
                   - App\Word\Checker\StaticWordChecker
 ---------------- -------------------------------------------
```

I can now see the the objects injected into the iterator and array arguments.

Commits
-------

db5fb200ce [FrameworkBundle] Show injected services for Iterator and Array
2019-05-06 11:45:01 +02:00
Fabien Potencier
b1872616d0 feature #31350 [Intl] Rename Regions to Countries (ro0NL)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Intl] Rename Regions to Countries

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

Because that's what the current region data is about; country codes.

This makes things consistent across the board; i.e. CountryType, CountryValidator

This allows a possible other region subset (e.g "continents") to distinct. Thus having `Countries::class` + `Continents::class` both reading from the `region` data. By then data should be compiled under different keys.

Current class is master only, so now or never :)

The alternative approach would be `Regions::getCountryNames [,getContinentNames, etc.]`, which is harder to scale, and should also be decided for 4.3 ideally.

Commits
-------

49aee67f46 [Intl] Rename Regions to Countries
2019-05-06 11:35:15 +02:00
Fabien Potencier
60b505e88c bug #31377 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers) (battye)
This PR was squashed before being merged into the 3.4 branch (closes #31377).

Discussion
----------

[Console] Fix auto-complete for ChoiceQuestion (multi-select answers)

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

Previously, a bug existed whereby for multi-select questions, the auto-complete would only work for the first answer supplied by the user. On all subsequent answers, the auto-complete would not appear.

Now it works as expected:

![screenshot](https://user-images.githubusercontent.com/2110222/57158657-8c147e80-6e16-11e9-94f7-a9bc95506545.png)

Commits
-------

59321fe031 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers)
2019-05-06 11:25:23 +02:00
battye
59321fe031 [Console] Fix auto-complete for ChoiceQuestion (multi-select answers) 2019-05-06 11:25:16 +02:00
Jan Schädlich
db5fb200ce [FrameworkBundle] Show injected services for Iterator and Array 2019-05-05 22:13:45 +02:00
Dmitry Simushev
74a0be3e0b [Bridge/PhpUnit] Extract all the code but shebang from bin/simple-phpunit
The change allow `simple-phpunit` to be included without
`#!/usr/bin/env php` string outputted.

Also it's the first step to fix #27035 (the second one is to change
phpunit bridge recipe).
2019-05-05 21:47:39 +03:00
Nicolas Grekas
5453f3ea54 bug #31380 [WebProfilerBundle] Don't filter submitted IP values (javiereguiluz)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfilerBundle] Don't filter submitted IP values

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

I don't think we need to filter the value submitted by users in this case.

Commits
-------

29bd2ad3f2 [WebProfilerBundle] Don't filter submitted IP values
2019-05-05 18:39:56 +02:00
Robin Chalas
c05273f793 [Messenger] Fix Redis Connection::get() after reject() 2019-05-05 18:23:23 +02:00
Nicolas Grekas
c315767b69 bug #31382 [PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refacto (l-vo)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refacto

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

During the refactoring for #29211 , it seems a little bug was introduced. When using runInSeparateProcess, deprecation message isn't unserialized anymore.

Commits
-------

f522729527 [PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refactoring
2019-05-05 18:12:56 +02:00
Uladzimir Tsykun
3ae9de1ef3 Translated form, security, validators resources into Belarusian (be) 2019-05-05 18:11:06 +02:00
Konstantin Myakshin
d3079e0976 Changing messenger bus id from 'message_bus' to 'messenger.default_bus' 2019-05-05 00:51:20 +03:00
Laurent VOULLEMIER
f522729527 [PhpunitBridge] Fix not unserialized logs after DeprecationErrorHandler refactoring
(when using runInSeparateProcess)
2019-05-04 20:28:21 +02:00
Javier Eguiluz
29bd2ad3f2 [WebProfilerBundle] Don't filter submitted IP values 2019-05-04 10:57:59 +02:00
Robin Chalas
ad6e888a6f bug #31344 [FrameworkBundle] Remove SendFailedMessageToFailureTransportListener if no failure transport (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] Remove SendFailedMessageToFailureTransportListener if no failure transport

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

When there is no failure transport configured and `messenger:consume` hits a failing message:
>  Argument 2 passed to Symfony\Component\Messenger\EventListener\SendFailedMessageToFailureTransportListener::__construct() must be of the type string, null given

/cc @weaverryan

Commits
-------

bdf4e913be [FrameworkBundle] Remove SendFailedMessageToFailureTransportListener definition if no failure transport
2019-05-03 13:56:22 +02:00
Christian Flothmann
d4baa71af6 feature #30985 [Form] Keep preferred choices order in ChoiceType (vudaltsov)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Form] Keep preferred choices order in ChoiceType

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

#EUFOSSA

Commits
-------

340a2fb3f8 Keep preferred_choices order
2019-05-03 12:06:19 +02:00
Robin Chalas
bdf4e913be [FrameworkBundle] Remove SendFailedMessageToFailureTransportListener definition if no failure transport 2019-05-02 22:37:20 +02:00
Roland Franssen
70a941ec0c [Intl] Cleanup 2019-05-02 21:34:01 +02:00
Fabien Potencier
446480e2f7 minor #31346 [Messenger] Lowercased method calls on \Redis (chalasr)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Messenger] Lowercased method calls on \Redis

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

64e71b5307/php_redis.h (L231-L244)

Commits
-------

2d41976b26 [Messenger] Lowercased method calls on \Redis
2019-05-02 07:45:21 +02:00
Roland Franssen
49aee67f46 [Intl] Rename Regions to Countries 2019-05-01 22:02:47 +02:00
Christian Flothmann
d99da56f8e fix conflict resolution 2019-05-01 19:50:42 +02:00
Fabien Potencier
c9231e2d5a bumped Symfony version to 4.2.9 2019-05-01 15:33:38 +02:00
Fabien Potencier
33c23dadb2 updated VERSION for 4.2.8 2019-05-01 15:31:08 +02:00
Fabien Potencier
15e9eec225 bumped Symfony version to 3.4.28 2019-05-01 15:30:28 +02:00
Robin Chalas
2d41976b26 [Messenger] Lowercased method calls on \Redis 2019-05-01 15:13:23 +02:00
Fabien Potencier
3d7ca2e596 updated VERSION for 3.4.27 2019-05-01 15:03:24 +02:00
Fabien Potencier
58d03ea0cc Merge branch '4.2'
* 4.2:
  [Translation] Fixes typo in comment
  Reword VarDumper description
2019-05-01 14:55:49 +02:00
Fabien Potencier
962b3ae504 Merge branch '3.4' into 4.2
* 3.4:
  [Translation] Fixes typo in comment
  Reword VarDumper description
2019-05-01 14:55:36 +02:00
Fabien Potencier
e2881d178d minor #31339 Reword VarDumper description (greg0ire)
This PR was merged into the 3.4 branch.

Discussion
----------

Reword VarDumper description

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| 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
| License       | MIT
| Doc PR        | n/a

It is hard to understand what "Built on top" refers to, and even when
knowing, the sentence looks weird.
![Untitled](https://user-images.githubusercontent.com/657779/57011659-15ebfe00-6c03-11e9-9b85-5c00cfc15026.png)

The description of [the Github repository](https://github.com/symfony/var-dumper) has the same issue and should be changed.

Commits
-------

6024e16ea1 Reword VarDumper description
2019-05-01 14:54:26 +02:00
Jan Schädlich
e11985f001 [Translation] Fixes typo in comment 2019-05-01 13:10:09 +02:00
Grégoire Paris
6024e16ea1
Reword VarDumper description
It is hard to understand what "Built on top" refers to, and even when
knowing, the sentence looks weird.
2019-05-01 11:52:10 +02:00
Fabien Potencier
90326e67d5 Merge branch '4.2'
* 4.2:
  Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
  [Workflow] Fixed dumping when many transition with same name exist
  relax assertions in tests
  fix ConsoleFormatter - call to a member function format() on string
  Made `debug:container` and `debug:autowiring` ignore starting backslash in service id
  [Validator] Translate messages into Japanese
  Fix Thai translation in validators.th.xlf
  [FramworkBundle] mark any env vars found in the ide setting as used
2019-05-01 10:40:02 +02:00
Fabien Potencier
ecdfa80bf4 Merge branch '3.4' into 4.2
* 3.4:
  Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
  [Workflow] Fixed dumping when many transition with same name exist
  fix ConsoleFormatter - call to a member function format() on string
2019-05-01 10:36:31 +02:00
Fabien Potencier
904163788a bug #31338 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"

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

This reverts commit 029fb2e7e3, reversing
changes made to 9dad29d61c.

Reverts #30620
Replaces #31215

We don't need to solve this in 3.4
Making the session resettable should be done on master, by implementing `ResetInterface`.
On 3.4 apps, one should write a dedicated `SessionResetter` that would implement the reverted logic.

Commits
-------

4177331915 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
2019-05-01 10:11:03 +02:00
Fabien Potencier
2eda6ff149 fixed typos 2019-05-01 10:08:00 +02:00
Fabien Potencier
1e35f24b19 feature #31288 [Messenger] RoutableMessageBus route to default bus (dirk39)
This PR was squashed before being merged into the 4.3-dev branch (closes #31288).

Discussion
----------

[Messenger] RoutableMessageBus route to default bus

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

Hi! I modified the behaviour of RoutableMessageBus to route message without BusNameStamp to default bus instead of raise an exception.

Made with ❤️ by [![Open Source Saturday](https://img.shields.io/badge/%E2%9D%A4%EF%B8%8F-open%20source%20saturday-F64060.svg)](https://www.meetup.com/it-IT/Open-Source-Saturday-Milano/)

Commits
-------

c4e5e83b56 [Messenger] RoutableMessageBus route to default bus
2019-05-01 10:06:51 +02:00
Dirk39
c4e5e83b56 [Messenger] RoutableMessageBus route to default bus 2019-05-01 10:06:42 +02:00
Nicolas Grekas
4177331915 Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
This reverts commit 029fb2e7e3, reversing
changes made to 9dad29d61c.
2019-05-01 10:04:33 +02:00
Fabien Potencier
2b923a7c03 feature #31292 [Validator] Allow intl timezones (ro0NL)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Validator] Allow intl timezones

| 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 | ref #28836
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/11502

This PR considers the ICU timezones (#28831) as valid, as well as the PHP ones.

Both can be used in `DateTimeZone`, but expired timezones cannot be used with `IntlTimeZone`. The `intlCompatibility` option ensures compatibility between both.

Practically this allows for both `UTC` and `Etc/UTC`, where the latter should be preferred. I.e. currently `Etc/UTC` is considered an invalid timezone ... which it's not.

Commits
-------

7294b59c65 [Validator] Allow intl timezones
2019-05-01 08:41:35 +02:00
Fabien Potencier
0c3c21ac8d minor #31304 Made debug:container and debug:autowiring ignore starting backslash in service id (ruudk)
This PR was merged into the 4.2 branch.

Discussion
----------

Made `debug:container` and `debug:autowiring` ignore starting backslash in service id

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

When you copy a reference to a class from PHPStorm it always start the FQCN with a backslash.

When you now try to search the container for this class using `bin/console debug:container "\My\Class"` it cannot find it.

This PR always removes the starting backslash before searching the container to avoid this issue.

Commits
-------

0945f27e81 Made `debug:container` and `debug:autowiring` ignore starting backslash in service id
2019-05-01 08:35:18 +02:00
Fabien Potencier
e0b5fb2aa3 bug #31326 fix ConsoleFormatter - call to a member function format() on string (keksa)
This PR was merged into the 3.4 branch.

Discussion
----------

fix ConsoleFormatter - call to a member function format() on string

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

The ConsoleFormatter crashes when there is not a DateTime object in `$record['datetime']`. As this parameter is not documented anywhere (i.e. `FormatterInterface` does not say it must be a DateTime object), I think the proper fix is to check if there is DateTimeInterface object and only call the `format` method then.

We use a custom LogProcessor (https://symfony.com/doc/current/logging/processors.html) to add some extra data and format the DateTime in the `$record['datetime']`. We need to format the DateTime in the processor, because we use `JsonFormatter` in prod environment and it does not support changing the date format. We use `ConsoleFormatter` only in dev environment and as the processor is called before the formatter, we get the crash.

There were no tests whatsoever for `ConsoleFormatter`, so I've added a basic one, that passes before and after, and another one that tests the crash (failed before, passed after).

There is a theoretical BC break, as someone could have sent an object with a `format` method to the formatter and it would have worked, but I'm not sure if it's considered BC break by Symfony, please let me know, if it is.

Commits
-------

648832823f fix ConsoleFormatter - call to a member function format() on string
2019-05-01 08:30:15 +02:00
Fabien Potencier
885d08c1f5 bug #31331 [Workflow] Fixed dumping when many transition with same name exist (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] Fixed dumping when many transition with same name exist

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

---

With this configuration:

```yaml
framework:
    workflows:
        foobar:
            type: workflow
            supports:
                - stdClass
            initial_place: a
            places:
                - a
                - b
                - c
                - cancelled
            transitions:
                -   name: a-b
                    from: a
                    to: b
                -   name: b-c
                    from: b
                    to: c
                -   name: cancel
                    from: a
                    to: cancelled
                -   name: cancel
                    from: b
                    to: cancelled
                -   name: cancel
                    from: c
                    to: cancelled
```

before:
![workflow-broken](https://user-images.githubusercontent.com/408368/56969037-a0315500-6b64-11e9-917e-4c45820938cc.png)

After:
![workflow-fixed](https://user-images.githubusercontent.com/408368/56969047-a4f60900-6b64-11e9-8f07-30e701a4978f.png)

Commits
-------

312a456e04 [Workflow] Fixed dumping when many transition with same name exist
2019-05-01 08:26:53 +02:00
Fabien Potencier
798f8bbd03 fixed typos 2019-05-01 08:23:02 +02:00
Fabien Potencier
fdeb93ebcb feature #30970 [Messenger] Adding failure transport support (weaverryan)
This PR was squashed before being merged into the 4.3-dev branch (closes #30970).

Discussion
----------

[Messenger] Adding failure transport support

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

This adds "failure" transport support for messenger, so that messages that fail on *all* their retries can be collected in one spot and retried later if wanted:

```yml
framework:
    messenger:
        failure_transport: failed

        transports:
            async:
                dsn: 'amqp://'
            failed:
                dsn: 'doctrine://default?queue_name=failed'

        routing:
            'App\Message\SmsNotification': async
```

In this setup, `SmsNotification` would be retried 3 times on the `async` transport (current behavior) and then finally sent to the `failed` transport. The `failed` transport can be consumed like a normal transport, but should usually be handled & consumed by one of the new commands:

**> bin/console messenger:failed:show**
<img width="861" alt="Screen Shot 2019-04-10 at 3 15 45 PM" src="https://user-images.githubusercontent.com/121003/55917329-ddc54280-5ba3-11e9-878c-af3c653643de.png">

**> bin/console messenger:failed:show 217**
<img width="804" alt="Screen Shot 2019-04-10 at 3 15 55 PM" src="https://user-images.githubusercontent.com/121003/55917360-f33a6c80-5ba3-11e9-9f12-a8c57a9a7a4b.png">

**> bin/console messenger:failed:purge 217**
<img width="835" alt="Screen Shot 2019-04-10 at 3 16 07 PM" src="https://user-images.githubusercontent.com/121003/55917383-ff262e80-5ba3-11e9-9720-e24176b834f7.png">

**> bin/console messenger:failed:retry 217**
<img width="737" alt="Screen Shot 2019-04-10 at 3 16 29 PM" src="https://user-images.githubusercontent.com/121003/55917396-09482d00-5ba4-11e9-8d51-0bbe2b4ffc14.png">

**> bin/console messenger:failed:retry 218 -vv**
<img width="1011" alt="Screen Shot 2019-04-10 at 3 20 39 PM" src="https://user-images.githubusercontent.com/121003/55917503-6512b600-5ba4-11e9-9365-4ac87d858541.png">

**Note** (This screenshot is ugly - need to make the dump of the message and the exception more attractive)

Or you can run `bin/console messenger:failed:retry` without any argument, and it will consume the failed messages one-by-one and ask you if you want to retry/handle each. By passing

Cheers!

Commits
-------

36487e5f44 [Messenger] Adding failure transport support
2019-05-01 08:22:07 +02:00
Ryan Weaver
36487e5f44 [Messenger] Adding failure transport support 2019-05-01 08:21:53 +02:00
Fabien Potencier
48e3f40b55 bug #31332 [Intl] Add phpdoc (ro0NL)
This PR was squashed before being merged into the 4.3-dev branch (closes #31332).

Discussion
----------

[Intl] Add phpdoc

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

Commits
-------

22a6f7b1bd [Intl] Add phpdoc
2019-05-01 08:13:38 +02:00
Roland Franssen
22a6f7b1bd [Intl] Add phpdoc 2019-05-01 08:13:26 +02:00
Christian Flothmann
7c9dffe2e5 Merge branch '3.4' into 4.2
* 3.4:
  relax assertions in tests
  [Validator] Translate messages into Japanese
  Fix Thai translation in validators.th.xlf
  [FramworkBundle] mark any env vars found in the ide setting as used
2019-05-01 07:55:04 +02:00
Christian Flothmann
9a9134f4e4 do not choke on not existing mapping field 2019-05-01 07:27:43 +02:00
Grégoire Pineau
312a456e04 [Workflow] Fixed dumping when many transition with same name exist 2019-04-30 17:32:30 +02:00
Roland Franssen
7294b59c65 [Validator] Allow intl timezones 2019-04-30 14:55:27 +02:00
Fabien Potencier
1c110fa1f7 bug #31325 [Intl] Extra timezone tests (ro0NL)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Intl] Extra timezone tests

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

Guarantees timezone data integrity. Ideally to go before #31292 :)

Commits
-------

a3cac2b4c9 [Intl] Extra timezone tests
2019-04-30 14:45:54 +02:00
Christian Flothmann
730df0860c relax assertions in tests 2019-04-30 14:26:26 +02:00
Ondrej Exner
648832823f
fix ConsoleFormatter - call to a member function format() on string 2019-04-30 10:19:16 +02:00
Roland Franssen
a3cac2b4c9 [Intl] Extra timezone tests 2019-04-30 09:30:15 +02:00
Roland Franssen
4f2bba7cb5 [Validator] Extra timezone tests 2019-04-30 09:08:53 +02:00
Fabien Potencier
8fdcd6e6ef feature #31318 [Intl] Compile localized timezone offset name (ro0NL)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Intl] Compile localized timezone offset name

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

A tiny follow up of #31295

Commits
-------

7a40d207b7 [Intl] Compile localized timezone offset name
2019-04-29 19:35:47 +02:00
Fabien Potencier
0c78413b1e bug #31307 [FrameworkBundle] Allow env variables in scoped_client base_uri (nicolas-grekas)
This PR was merged into the 4.3-dev branch.

Discussion
----------

[FrameworkBundle] Allow env variables in scoped_client base_uri

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

Commits
-------

b2c885dfde [FrameworkBundle] Allow env variables in scoped_client base_uri
2019-04-29 12:09:28 +02:00