Commit Graph

42156 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
Fabien Potencier
a46276028c bug #31510 Use the current working dir as default first arg in 'link' binary (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

Use the current working dir as default first arg in 'link' binary

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

I don't know how you work on symfony, but each time I face the same issue

1. I go on lyrixx/symfony (my fork)
1. I execute `pwd` and copy it
1. I go to an application
1. I paste the cwd + add `/link` and hit enter
1. I got an error because I missed the "target"
1. I replay the last command and add ` .`

With this PR, I will save the last 2 items...

Event if it's a "new feature", I targeted 3.4.

Commits
-------

6b76c365ea Use the current working dir as default first arg in 'link' binary
2019-05-18 18:09:21 +02:00
Fabien Potencier
ef7ff67f83 bug #31524 [HttpFoundation] prevent deprecation when filesize matches error code (xabbuh)
This PR was merged into the 4.2 branch.

Discussion
----------

[HttpFoundation] prevent deprecation when filesize matches error code

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

Commits
-------

d836c63b91 prevent deprecation when filesize matches error code
2019-05-18 18:05:55 +02:00
Fabien Potencier
721d721304 bug #31535 [Debug] Wrap call to require_once in a try/catch (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Wrap call to require_once in a try/catch

| 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/monolog-bundle/issues/236
| License       | MIT
| Doc PR        |

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

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

afb6e1ec9e [Debug] Wrap call to require_once in a try/catch
2019-05-18 17:58:07 +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
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
Fabien Potencier
87855a59ec minor #31513 [PropertyInfo] Add missing documentation link in Readme (plozmun)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #31513).

Discussion
----------

[PropertyInfo] Add missing documentation link in Readme

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

Missing link to Property Info documentation

Commits
-------

62894ed8b9 [PropertyInfo] Add missing documentation link in Readme
2019-05-16 16:10:44 +02:00
Pablo Lozano
62894ed8b9 [PropertyInfo] Add missing documentation link in Readme 2019-05-16 16:10:36 +02:00
Grégoire Pineau
6b76c365ea Use the current working dir as default first arg in 'link' binary 2019-05-16 11:52:39 +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
Fabien Potencier
c5772ae9bc feature #31030 [Serializer] Deprecate calling createChildContext without the format parameter (dbu)
This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #31030).

Discussion
----------

[Serializer] Deprecate calling createChildContext without the format parameter

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

as discussed in #30907 deprecate omitting the format parameter when extending the AbstractNormalizer.

Commits
-------

cb77902805 deprecate calling createChildContext without the format parameter
2019-05-15 11:58:17 +02:00
David Buchmann
cb77902805 deprecate calling createChildContext without the format parameter 2019-05-15 11:58:03 +02:00
Fabien Potencier
b529e0746a minor #31498 [EventDispatcher] Fix interface name used in error messages (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] Fix interface name used in error messages

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

Forgotten in #31459

Commits
-------

38cad41a0a [EventDispatcher] Fix interface name used in error messages
2019-05-15 07:31:06 +02:00
Fabien Potencier
01964c8570 minor #31499 [Validator] Add the missing translations for the Danish ("da") locale (gauss)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Danish ("da") locale

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

Addresses the missing translations listed in #30155

Commits
-------

710f8a6367 [Validator] Add the missing translations for the Danish ("da") locale
2019-05-15 07:17:01 +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
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
Fabien Potencier
853743a79a bug #31480 Update dependencies in the main component (DavidPrevot)
This PR was squashed before being merged into the 4.3 branch (closes #31480).

Discussion
----------

Update dependencies in the main component

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

The doctrine/collections and psr/simple-cache dependencies have already been demoted to require-dev in the relevant components.

BTW, I wonder if symfony/mailer (and symfony/*-mailer bridges) should be provided in the main composer.json too.

Commits
-------

96f4626952 Update dependencies in the main component
2019-05-13 07:53:16 +02:00
David Prévot
96f4626952 Update dependencies in the main component 2019-05-13 07:53:09 +02:00
Fabien Potencier
1bce54c5dc minor #31488 Drop useless executable bit (DavidPrevot)
This PR was merged into the 4.3 branch.

Discussion
----------

Drop useless executable bit

The files were added as executable via #28477.

| 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

Commits
-------

79058633ca Drop useless executable bit
2019-05-13 07:51:13 +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
Nicolas Grekas
11f8a1e5c9 bug #31475 [HttpFoundation] Allow set 'None' on samesite cookie flag (markitosgv)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Allow set 'None' on samesite cookie flag

Allow set samesite cookie flag to 'None' value

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

Google introduces new Chrome policy, marking all none setted samesite flag to 'Strict' by default. If you want to allow third party cookies you must set samesite flag to None.

This PR fixes #31467, allow to put samesite Cookie flag to None.

Commits
-------

8bac3d6fa3 Allow set 'None' on samesite cookie flag
2019-05-11 11:52:36 +02:00
Nicolas Grekas
8335810794 minor #31469 [Workflow] Update WorkflowEvents typo (noniagriconomie)
This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #31469).

Discussion
----------

[Workflow] Update WorkflowEvents typo

| Q             | A
| ------------- | ---
| Branch?       |  <!-- see below -->
| Bug fix?      | no
| 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 | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Some little typo
Maybe to do for other branches?

Commits
-------

6583e5a1d7 Update WorkflowEvents.php
2019-05-11 11:33:13 +02:00
Antoine Makdessi
6583e5a1d7 Update WorkflowEvents.php 2019-05-11 11:33:04 +02:00