Commit Graph

38082 Commits

Author SHA1 Message Date
Nicolas Grekas
6e368f136f bug #36917 [Cache] Accessing undefined constants raises an Error in php8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Accessing undefined constants raises an Error in php8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

Calling `constant()` for an undefined constant will raise an `Error` on php 8. This PR adjust the Memcached tests to this new behavior.

Commits
-------

49fd0efb12 [Cache] Accessing undefined constants raises an Error in php8
2020-05-23 13:35:31 +02:00
Alexander M. Turek
49fd0efb12 [Cache] Accessing undefined constants raises an Error in php8 2020-05-23 11:57:43 +02:00
Nicolas Grekas
d12b3b6a72 [Cache] allow DBAL v3 2020-05-23 11:12:58 +02:00
Nicolas Grekas
8de1091347 Merge branch '3.4' into 4.4
* 3.4:
  Skip Doctrine DBAL on php 8 until we have a compatible version.
  [DomCrawler] Catch expected ValueError.
  [Validator] Catch expected ValueError.
  [VarDumper] ReflectionFunction::isDisabled() is deprecated.
  [PropertyAccess] Parse php 8 TypeErrors correctly.
  [Intl] Fix call to ReflectionProperty::getValue() for static properties.
  [HttpKernel] Prevent calling method_exists() with non-string values.
  [Debug] php 8 does not pass $context to error handlers.
  [Config] Removed implicit cast of ReflectionProperty to string.
  [Debug] Undefined variables raise a warning in php 8.
  [Debug] Skip test that would trigger a fatal error on php 8.
  Address deprecation of ReflectionType::getClass().
  Properties $originalName and $mimeType are never null in UploadedFile
2020-05-23 11:11:46 +02:00
Nicolas Grekas
f32c2c15d9 minor #36909 [ErrorHandler] Apply php8 fixes from Debug component (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Apply php8 fixes from Debug component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

The changes of #36898 and #36897 ported to the ErrorHandler component.

Commits
-------

54f18698af [ErrorHandler] Apply php8 fixes from Debug component.
2020-05-23 10:32:54 +02:00
Alexander M. Turek
1090738264 Skip Doctrine DBAL on php 8 until we have a compatible version. 2020-05-23 10:20:35 +02:00
Nicolas Grekas
410b6214ea bug #36891 Address deprecation of ReflectionType::getClass() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Address deprecation of ReflectionType::getClass()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

Calling `ReflectionType::getClass()` will trigger a deprecation warning on php 8. This PR switches to `getType()` if available.

Commits
-------

53b1677a4e Address deprecation of ReflectionType::getClass().
2020-05-23 09:35:15 +02:00
Nicolas Grekas
fb91dc24eb bug #36899 [VarDumper] ReflectionFunction::isDisabled() is deprecated (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ReflectionFunction::isDisabled() is deprecated

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

See php/php-src#5473. Calling `ReflectionFunction::isDisabled()` is pointless on php 8 and doing so triggers a deprecation warning.

Someone who is more familiar with that component might want to have a second look on this PR. I'm not really sure if this is the right way to fix the issue.

Commits
-------

1da347e5ba [VarDumper] ReflectionFunction::isDisabled() is deprecated.
2020-05-23 09:34:32 +02:00
Nicolas Grekas
42692d625d bug #36905 [Validator] Catch expected ValueError (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Catch expected ValueError

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

`mb_check_encoding()` raises a `ValueError` on php 8 if an invalid encoding was passed. The validator that was patched here is expected to fail gracefully in that situation. This PR restores that behavior under php 8.

Maybe we can reconsider this behavior for Symfony 5.2. It feels a bit odd to me because we swallow a potential misconfiguration of the validator.

Commits
-------

8f3f67f82a [Validator] Catch expected ValueError.
2020-05-23 09:32:18 +02:00
Nicolas Grekas
5d7b7e9616 bug #36915 [DomCrawler] Catch expected ValueError (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DomCrawler] Catch expected ValueError

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

This is #36906 ported to the 4.4 branch.

Commits
-------

32691e5157 [DomCrawler] Catch expected ValueError.
2020-05-23 09:22:08 +02:00
Alexander M. Turek
32691e5157 [DomCrawler] Catch expected ValueError. 2020-05-23 02:03:06 +02:00
Alexander M. Turek
6fda276feb Made method signatures compatible with their corresponding traits. 2020-05-22 22:05:30 +02:00
Alexander M. Turek
54f18698af [ErrorHandler] Apply php8 fixes from Debug component. 2020-05-22 21:58:53 +02:00
Alexander M. Turek
b1db13728b [DomCrawler] Catch expected ValueError. 2020-05-22 21:35:43 +02:00
Alexander M. Turek
8f3f67f82a [Validator] Catch expected ValueError. 2020-05-22 20:52:50 +02:00
Alexander M. Turek
1da347e5ba [VarDumper] ReflectionFunction::isDisabled() is deprecated. 2020-05-22 20:50:36 +02:00
Nicolas Grekas
e220e7cc01 bug #36904 [PropertyAccess] Parse php 8 TypeErrors correctly (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess] Parse php 8 TypeErrors correctly

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

The wording of `TypeError` messages has changed in php 8. Since `PropertyAccessor` parses those messages, the logic needed some adjustments.

Commits
-------

7100c3ce1b [PropertyAccess] Parse php 8 TypeErrors correctly.
2020-05-22 20:33:39 +02:00
Nicolas Grekas
4e191688fe minor #36898 [Debug] php 8 does not pass $context to error handlers (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] php 8 does not pass $context to error handlers

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

php 8 will call error handlers without the optional `$context` parameter. Thus, error handlers that make that parameter mandatory will break.

Commits
-------

593897c9e1 [Debug] php 8 does not pass $context to error handlers.
2020-05-22 20:25:20 +02:00
Fabien Potencier
6d7c696742 bug #36839 [BrowserKit] Raw body with custom Content-Type header (azhurb)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[BrowserKit] Raw body with custom Content-Type header

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

Currently, if you try to send POST/PUT request with custom `Content-Type` header and specified body, the real request will contain `text/plain` content type.

Following code
```php
$client->request(
    'POST',
    '/url',
    [],
    [],
    [
        'CONTENT_TYPE' => 'application/json'
    ],
    '{"foo":"bar"}'
);
```
produces next request
```
POST /
Content-Type: text/plain; charset=utf-8

{"foo":"bar"}
```

With this fix, the request will be
```
POST /
Content-Type: application/json

{"foo":"bar"}
```

Commits
-------

d2dd92be77 [BrowserKit] Raw body with custom Content-Type header
2020-05-22 19:28:00 +02:00
Oleksii Zhurbytskyi
d2dd92be77 [BrowserKit] Raw body with custom Content-Type header 2020-05-22 19:27:55 +02:00
Fabien Potencier
2468314e94 minor #36837 UploadedFile minor fixes (vudaltsov)
This PR was merged into the 3.4 branch.

Discussion
----------

UploadedFile minor fixes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | none <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no

According to the [constructor assignments](cb7e78c809/src/Symfony/Component/HttpFoundation/File/UploadedFile.php (L60)), properties `$originalName` and `$mimeType` are never null in `UploadedFile`, so `getClientOriginalName()` and `getClientMimeType()` always return `string`. Also `$test` does not need a default value because it's always set in the constructor.

Commits
-------

eb8d626c27 Properties $originalName and $mimeType are never null in UploadedFile
2020-05-22 19:19:03 +02:00
Fabien Potencier
14ffc0231f minor #36902 [Intl] Fix call to ReflectionProperty::getValue() for static properties (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Fix call to ReflectionProperty::getValue() for static properties

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

When we call `ReflectionProperty::getValue()` for a static property, we don't need to pass any arguments. The code that was fixed here raised a `TypeError` on php 8 because the argument has to be an object now.

Commits
-------

d4045897d6 [Intl] Fix call to ReflectionProperty::getValue() for static properties.
2020-05-22 19:06:23 +02:00
Fabien Potencier
77a826c8b7 bug #36896 [Config] Removed implicit cast of ReflectionProperty to string (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Removed implicit cast of ReflectionProperty to string

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

PHP 8 does not allow casting `ReflectionProperty` instances to string anymore.

Commits
-------

8adbadede7 [Config] Removed implicit cast of ReflectionProperty to string.
2020-05-22 19:04:16 +02:00
Fabien Potencier
b2026966a7 minor #36897 [Debug] Undefined variables raise a warning in php 8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Undefined variables raise a warning in php 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

`ErrorHandlerTest` executes code with undefined variables to test how the error handler handles the triggered errors. In php 8.0, the severity and error message for this class of errors has been changed. I've adjusted the test accordingly.

Commits
-------

1d20b514f2 [Debug] Undefined variables raise a warning in php 8.
2020-05-22 18:47:25 +02:00
Alexander M. Turek
7100c3ce1b [PropertyAccess] Parse php 8 TypeErrors correctly. 2020-05-22 16:26:18 +02:00
Alexander M. Turek
d4045897d6 [Intl] Fix call to ReflectionProperty::getValue() for static properties. 2020-05-22 15:42:59 +02:00
Alexander M. Turek
1bbfdcbb8d [HttpKernel] Prevent calling method_exists() with non-string values. 2020-05-22 15:23:31 +02:00
Thibaut Salanon
7d2ad4b265 Fix wrong roles comparison 2020-05-22 14:29:11 +02:00
Alexander M. Turek
593897c9e1 [Debug] php 8 does not pass $context to error handlers. 2020-05-22 13:12:29 +02:00
Alexander M. Turek
8adbadede7 [Config] Removed implicit cast of ReflectionProperty to string. 2020-05-22 12:56:48 +02:00
Alexander M. Turek
1d20b514f2 [Debug] Undefined variables raise a warning in php 8. 2020-05-22 12:23:23 +02:00
Nicolas Grekas
52abcbeec9 minor #36892 [Debug] Skip test that would trigger a fatal error on php 8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] Skip test that would trigger a fatal error on php 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

This PR skips a test of `DebugClassLoader`. The test uses incompatible method signatures in class inheritance to provoke a php warning that should be handled by the debug class loader. On php 8 however, this error is not recoverable anymore, so the tested logic will be obsolete there.

Commits
-------

573d0dd493 [Debug] Skip test that would trigger a fatal error on php 8.
2020-05-22 10:14:52 +02:00
Christian Flothmann
d333aae187 never directly validate Existence (Required/Optional) constraints 2020-05-22 09:54:54 +02:00
Nicolas Grekas
47180fe447 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix setting platform.php
2020-05-21 20:35:07 +02:00
Nicolas Grekas
dd902d939f [PhpUnitBridge] fix setting platform.php 2020-05-21 20:33:26 +02:00
Alexander M. Turek
573d0dd493 [Debug] Skip test that would trigger a fatal error on php 8. 2020-05-21 16:02:48 +02:00
Alexander M. Turek
53b1677a4e Address deprecation of ReflectionType::getClass(). 2020-05-21 15:02:25 +02:00
Nicolas Grekas
0349890720 fix merge 2020-05-21 00:28:08 +02:00
Nicolas Grekas
ef6a85b7ea Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
2020-05-21 00:10:46 +02:00
Nicolas Grekas
5ec5bfb23c [PhpUnitBridge] fix installing on PHP 8 (ter) 2020-05-21 00:09:52 +02:00
Nicolas Grekas
c101259192 [PhpUnitBridge] fix installing on PHP 8 (bis) 2020-05-20 23:58:15 +02:00
Nicolas Grekas
a6ea1da1e6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix installing on PHP 8
2020-05-20 23:50:56 +02:00
Nicolas Grekas
606715b6ec [PhpUnitBridge] fix installing on PHP 8 2020-05-20 23:49:59 +02:00
Nicolas Grekas
53d89f71d6 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:31:34 +02:00
Nicolas Grekas
b6151ed6cc [PhpUnitBridge] fix leftover 2020-05-20 19:29:51 +02:00
Nicolas Grekas
5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8 2020-05-20 18:13:38 +02:00
Nicolas Grekas
f8aa0873cf Use ">=" for the "php" requirement 2020-05-20 10:37:50 +02:00
Roland Franssen
920e319051 bump icu 67.1 2020-05-19 19:12:53 +02:00
Nicolas Grekas
2c57ae2b97 Merge branch '3.4' into 4.4
* 3.4:
  [Validator] Add missing translations of nn locale
  [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
  [Intl] bump icu 67.1
2020-05-19 18:54:45 +02:00
Nicolas Grekas
5fc4d1b645 minor #36863 [Validator] Add missing translations of nn locale (themilanfan)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing translations of nn locale

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes/no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30178
| License       | MIT

Added missing translations to validator with locale nn

Commits
-------

040d01e53b [Validator] Add missing translations of nn locale
2020-05-19 18:38:52 +02:00
Giuseppe Campanelli
040d01e53b [Validator] Add missing translations of nn locale 2020-05-19 18:38:46 +02:00
Nicolas Grekas
af0df4ce14 bug #36833 [HttpKernel] Fix that the Store would not save responses with the X-Content-Digest header present (mpdude)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Responses fetched from upstream sources might have a `X-Content-Digest` header, for example if the Symfony Cache is used upstream. This currently prevents the `Store` from saving such responses. In general, the value of this header should not be trusted.

As I consider this header an implementation detail of the `Store`, the fix tries to be local to that class; we should not rely on the `HttpCache` or other classes to remove untrustworthy headers for us.

This fixes the issue that when using the `HttpCache` in combination with the Symfony HttpClient, responses that have also been cached upstream in an instance of `HttpCache` are not cached locally. It adds the overhead of re-computing the content digest every time the `HttpCache` successfully re-validated a response.

Commits
-------

d8964fb8b7 [HttpKernel] Fix that the `Store` would not save responses with the X-Content-Digest header present
2020-05-19 18:37:57 +02:00
Matthias Pigulla
d8964fb8b7 [HttpKernel] Fix that the Store would not save responses with the X-Content-Digest header present 2020-05-19 18:37:51 +02:00
Nicolas Grekas
42c79753eb minor #36860 [Intl] bump icu 67.1 (ro0NL)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Intl] bump icu 67.1

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

mainly some new locales+scripts (see 3a3a9ba)

Commits
-------

29eb271184 [Intl] bump icu 67.1
2020-05-19 18:34:53 +02:00
Roland Franssen
29eb271184 [Intl] bump icu 67.1 2020-05-19 18:34:45 +02:00
Nicolas Grekas
fd584bb9b3 Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:30:42 +02:00
Nicolas Grekas
9d5bb11ec9 [PhpUnitBridge] fix bad detection of unsilenced deprecations 2020-05-19 10:12:21 +02:00
rfaivre
b447433b67 [Security] Unserialize $parentData, if needed, to avoid errors 2020-05-18 23:38:28 +02:00
Fabien Potencier
5f829bdaeb [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM) 2020-05-18 17:28:46 +02:00
Alexander M. Turek
9f8d225aa1 Revert "Change priority of KernelEvents::RESPONSE subscriber"
This reverts commit 6ed624ad16.
2020-05-16 15:57:47 +02:00
vudaltsov
eb8d626c27 Properties $originalName and $mimeType are never null in UploadedFile 2020-05-16 16:15:54 +03:00
Nicolas Grekas
94e8c42736 Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix for change in PHP 7.4.6 (bis)
  [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:07:46 +02:00
Nicolas Grekas
cb7e78c809 bug #36592 [BrowserKit] Allow Referer set by history to be overridden (Slamdunk)
This PR was merged into the 3.4 branch.

Discussion
----------

[BrowserKit] Allow Referer set by history to be overridden

| Q             | A
| ------------- | ---
| Branch?       | 3.4, see https://github.com/symfony/symfony/pull/36591 for 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

4774946fbd [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:06:03 +02:00
Nicolas Grekas
e69673562c [VarDumper] fix for change in PHP 7.4.6 (bis) 2020-05-16 12:04:57 +02:00
Nicolas Grekas
1e9486de89 [VarExporter] fix for change in PHP 7.4.6 2020-05-16 12:04:25 +02:00
Nicolas Grekas
cc519aa5a9 bug #36823 [HttpClient] fix PHP warning + accept status code >= 600 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix PHP warning + accept status code >= 600

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36717
| License       | MIT
| Doc PR        | -

This fixes the PHP warning reported in the linked issue.

This also relaxes the accepted status codes, with https://www.linkedin.com/company/linkedin/ as an example that returns a non-conformant one (`999`).

These are now handled as 5xx codes, ie they trigger a ServerException.

Commits
-------

c764b5c36e [HttpClient] fix PHP warning + accept status code >= 600
2020-05-16 11:09:03 +02:00
Nicolas Grekas
bce37603cb bug #36824 [Security/Core] fix compat of NativePasswordEncoder with pre-PHP74 values of PASSWORD_* consts (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36451
| License       | MIT
| Doc PR        | -

Commits
-------

df32171cb2 [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts
2020-05-16 11:07:52 +02:00
Nicolas Grekas
ae67376ad3 bug #36811 [DependencyInjection] Fix register event listeners compiler pass (X-Coder264)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix register event listeners compiler pass

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I've wanted to use the simpler event listener registration syntax (https://symfony.com/blog/new-in-symfony-4-4-simpler-event-listeners) in my project and it didn't work so I'm sending this fix.

We use the `KnpPaginatorBundle` bundle which also [calls the `RegisterListenersPass` compiler pass](https://github.com/KnpLabs/KnpPaginatorBundle/blob/v5.2.0/src/DependencyInjection/Compiler/PaginatorConfigurationPass.php#L22) in order to register with the event dispatcher their custom tags for listeners and subscribers (`knp_paginator.listener` and `knp_paginator.subscriber`).

Their compiler pass is `TYPE_BEFORE_REMOVING` and priority zero which is the same type and priority as the pass that gets [added by FrameworkBundle](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php#L125). Since both the type and priority is the same the order of execution is `undefined` (because [that is how regular sort behaves in PHP which is used by default by `krsort`](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php#L264)) and the `RegisterListenersPass` currently removes the `eventAliasesParameter` parameter from the container if it is set (which is [set here](https://github.com/symfony/symfony/blob/v4.4.8/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml#L9)). So what happens in my app is that the Knp compiler pass runs first, the `event_dispatcher.event_aliases` parameter is removed and then the FrameworkBundle registered compiler pass runs and since the aliases are not present anymore the events do not get aliased properly. The event dispatcher service in the compiled container looks like:

```php
$instance->addListener('Symfony\Component\HttpKernel\Event\RequestEvent', ...);
```

instead of the expected

```php
$instance->addListener('kernel.request', ...);
```

This means that my listener never gets called on the kernel request event.

Another potential fix would be to adjust the Knp compiler pass priority, but seeing as that would fix only that bundle (who knows how many bundles out there have the same problem) and that I don't see any drawback in letting the `event_dispatcher.event_aliases` parameter stay in the container I think that this is better to fix here.

Commits
-------

646878d072 Fix register event listeners compiler pass
2020-05-16 11:07:08 +02:00
Nicolas Grekas
fb4c3f920f Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix for change in PHP 7.4.6
  Added regression test for AccountStatusException behavior (ref #36822)
  embed resource name in error message
  [Serializer] fix issue with PHP 8
  [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-16 11:03:35 +02:00
Nicolas Grekas
924822c2e8 [VarDumper] fix for change in PHP 7.4.6 2020-05-16 10:59:45 +02:00
Nicolas Grekas
cec0dfe5b3 minor #36780 [Translator] embed resource name in error message (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translator] embed resource name in error message

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Someone reported on Slack that they accidentally stored a translation file with the `.twig` extension and that the error message was quite confusing.

Commits
-------

507a5963e4 embed resource name in error message
2020-05-16 10:35:38 +02:00
Wouter J
08fbfcf5a0 Added regression test for AccountStatusException behavior (ref #36822) 2020-05-15 23:22:25 +02:00
Nicolas Grekas
c764b5c36e [HttpClient] fix PHP warning + accept status code >= 600 2020-05-15 16:28:26 +02:00
Nicolas Grekas
df32171cb2 [Security/Core] fix compat of NativePasswordEncoder with pre-PHP74 values of PASSWORD_* consts 2020-05-15 14:38:59 +02:00
Christian Flothmann
507a5963e4 embed resource name in error message 2020-05-15 09:32:03 +02:00
Nicolas Grekas
65e6812c1d [FrameworkBundle] fix stringable annotation 2020-05-14 20:47:17 +02:00
Fabien Potencier
e5c82c566e bug #36789 Change priority of KernelEvents::RESPONSE subscriber (marcw)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Change priority of KernelEvents::RESPONSE subscriber

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

This PR changes the priority of the `KernelEvents::RESPONSE` subscriber of the `ProfilerListener` so that it is the penultimate to be executed (just before `StreamedResponseListener`).

The reason is that other listeners that were executed after this one CAN change the response (such as `SessionListener` for example). This creates a headache when debugging, with a discrepancy between what is shown in a curl command, and by the Symfony profiler.

Commits
-------

6ed624ad16 Change priority of KernelEvents::RESPONSE subscriber
2020-05-14 11:30:03 +02:00
Marc Weistroff
6ed624ad16 Change priority of KernelEvents::RESPONSE subscriber 2020-05-14 11:29:57 +02:00
Fabien Potencier
315010422f bug #36786 [WebProfiler] Remove 'none' when appending CSP tokens (ndench)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfiler] Remove 'none' when appending CSP tokens

| Q             | A
| ------------- | ---
| Branch?       | 3.4, 4.4, 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36645
| License       | MIT
| Doc PR        | n/a

@nicolas-grekas  asked me to to have a look at this after #36678.

If a user has a CSP policy of `default-src 'none'`, then the WebProfiler copies `'none'` to `script-src` and `style-src` then adds other sources. This creates an invalid policy since `'none'` is only allowed when it's the only item in the source list.

This will probably need to be merged into 3.4 first, I started on 4.4 so I can test in my current symfony project which requires 4.4.

Commits
-------

967bc4a860 [WebProfiler] Remove 'none' when appending CSP tokens
2020-05-13 19:00:16 +02:00
Antonio Pauletich
646878d072 Fix register event listeners compiler pass 2020-05-13 18:27:55 +02:00
Carlos Buenosvinos
d31d1e0111 Missing description in messenger:setup-transports command
making `bin/console` to show an empty description when the rest of the commands have one.
2020-05-12 22:52:55 +02:00
Nicolas Grekas
44b45cbaf1 [Serializer] fix issue with PHP 8 2020-05-12 22:34:06 +02:00
Nathan Dench
967bc4a860 [WebProfiler] Remove 'none' when appending CSP tokens 2020-05-12 17:24:37 +10:00
Fabien Potencier
a8cb3cd2da bug #36743 [Yaml] Fix escaped quotes in quoted multi-line string (ossinkine)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Fix escaped quotes in quoted multi-line string

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

This PR continues https://github.com/symfony/symfony/pull/19304

This PR fixes incorrect parsing quoted multi-line string which contain escaped quotes, see tests

Commits
-------

2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-11 09:51:54 +02:00
Tobias Schultze
35e391aaa2 [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 2020-05-10 16:50:02 +02:00
Nicolas Grekas
333f7187dc [HttpClient] fix testTimeoutIsNotAFatalError (bis) 2020-05-09 19:43:44 +02:00
Nicolas Grekas
00ae470307 [HttpClient] fix testTimeoutIsNotAFatalError 2020-05-09 18:24:06 +02:00
Nicolas Grekas
4ab6ff37bd [HttpClient] improve testTimeoutIsNotAFatalError 2020-05-09 17:57:30 +02:00
Fabien Potencier
6310084f25 bug #36716 [Mime] handle passing custom mime types as string (mcneely)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] handle passing custom mime types as string

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36715
| License       | MIT
| Doc PR        | none
Fix's issue where custom mimetypes were failing

Commits
-------

f3005ec653 Fix for #36715
2020-05-09 14:32:08 +02:00
Paul L. McNeely
f3005ec653
Fix for #36715 2020-05-09 07:22:40 -05:00
Nicolas Grekas
36ccf4c65b [HttpClient] test that timeout is not fatal 2020-05-09 14:08:40 +02:00
Nicolas Grekas
edb517699a [PhpUnitBridge] fix bad test 2020-05-08 14:32:38 +02:00
Nicolas Grekas
da8b9552ad Merge branch '3.4' into 4.4
* 3.4:
  [3.4] CS fixes
2020-05-08 12:54:34 +02:00
Nicolas Grekas
eba09d47e7 [4.4] CS fixes 2020-05-08 12:39:41 +02:00
Nicolas Grekas
02b378f248 [3.4] CS fixes 2020-05-08 12:38:31 +02:00
theravel
9d48eedbdc Queue name is a required parameter 2020-05-08 12:02:31 +02:00
Nicolas Grekas
a60937519b bug #36751 [Mime] fix bad method call on EmailAddressContains (Kocal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] fix bad method call on `EmailAddressContains`

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | -
| License       | MIT
| Doc PR        | -

There is no method `Address` on [`MailboxHeader`](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Mime/Header/MailboxHeader.php), but a method `getAddress`.

Commits
-------

227ebd2fe9 [Mime] fix bad method call on "EmailAddressContains"
2020-05-08 11:59:36 +02:00
Nicolas Grekas
2dbfeb9db9 Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] display actual target for error in AssetsInstallCommand
  Remove patches for Doctrine bugs and deprecations
  [DI][EventDispatcher] added contract for implementation
2020-05-08 11:58:40 +02:00
Nicolas Grekas
f6ae18e3ac minor #36710 [DI][EventDispatcher] added contract for implementation (bestform)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI][EventDispatcher] added contract for implementation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36708
| License       | MIT

As described in the attached issue a comment in the documentation of the `EventSubscriberInterface` would be helpful to make sure users do not use logic based on runtime state in their implementation of `getSubscribedEvents`.

Commits
-------

88e43d4d4c [DI][EventDispatcher] added contract for implementation
2020-05-08 11:57:02 +02:00
Matthias Larisch
f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
When assets:install fails because the target directory does not exist, it should display the actual directory it wanted to have instead of the configuration directive. In most cases, the target directory is retrieved from the kernel config and thus differs from the argument.
2020-05-08 11:56:06 +02:00
Grégoire Paris
2f305cdc83 Remove patches for Doctrine bugs and deprecations 2020-05-08 11:45:13 +02:00
Hugo Alliaume
227ebd2fe9
[Mime] fix bad method call on "EmailAddressContains"
There is no method `Address` on `MailboxHeader`, but a method `getAddress`.
2020-05-08 10:53:13 +02:00
Gocha Ossinkine
2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string 2020-05-07 22:33:48 +05:00
Matthias Derer
88e43d4d4c [DI][EventDispatcher] added contract for implementation
fixes #36708.
2020-05-05 17:06:23 +02:00
Nicolas Grekas
f8bedf4e79 Merge branch '3.4' into 4.4
* 3.4:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:57 +02:00
Nicolas Grekas
d1953d61cd Force doctrine/dbal <=2.10.2 when testing 2020-05-05 15:43:18 +02:00
Nicolas Grekas
6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper 2020-05-05 13:09:20 +02:00
Nicolas Grekas
2732dda83c Merge branch '3.4' into 4.4
* 3.4:
  [PhpUnitBridge] fix PHP 5.3 compat
  [PhpUnitBridge] Mark parent class also covered in CoverageListener
  prevent notice for invalid octal numbers on PHP 7.4
2020-05-05 09:39:02 +02:00
Nicolas Grekas
f7fc3cf6cb [PhpUnitBridge] fix PHP 5.3 compat 2020-05-05 09:38:03 +02:00
Fabien Potencier
9b8911598b bug #36569 [PhpUnitBridge] Mark parent class also covered in CoverageListener (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Mark parent class also covered in CoverageListener

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener
2020-05-05 07:34:36 +02:00
Grégoire Pineau
dcb5653728 [PhpUnitBridge] Mark parent class also covered in CoverageListener 2020-05-05 00:33:45 +02:00
Christian Flothmann
92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4 2020-05-04 18:58:31 +02:00
Nicolas Grekas
b0573cb418 Merge branch '3.4' into 4.4
* 3.4:
  Fix exception messages containing exception messages
2020-05-04 17:32:48 +02:00
Nicolas Grekas
169e49d491 Fix exception messages containing exception messages 2020-05-04 17:12:51 +02:00
Nicolas Grekas
394946de47 Merge branch '3.4' into 4.4
* 3.4:
  [Filesystem] Handle paths on different drives
  [WebProfiler] Do not add src-elem CSP directives if they do not exist
  [Yaml] fix parse error when unindented collections contain a comment
  [3.4][Inflector] Improve testSingularize() argument name
  [PhpUnitBridge] fix PHP 5.3 compat again
  Skip validation when email is an empty object
  fix sr_Latn translation
  [Validator] fix lazy property usage.
  Fix annotation
  [PhpUnitBridge] fix compat with PHP 5.3
  [DX] Show the ParseException message in YAML file loaders
2020-05-04 16:02:18 +02:00
Fabien Potencier
64e5a9dee8 bug #36590 [Console] Default hidden question to 1 attempt for non-tty session (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Default hidden question to 1 attempt for non-tty session

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36565
| License       | MIT
| Doc PR        |

### Problem 1
`validateAttempts()` method repeats validation forever by default, until exception extending `RuntimeException` isn't thrown. This currently happens disregarding if user is in tty session where they can actually type input, or non-tty session. This presents a problem when user code throws custom exceptions for hidden questions -> loop doesn't stop. As far as I can tell this issue is in all Symfony versions, but it was uncovered only after we stopped marking interactive flag to false automatically ourselves. Actually, all 3 problems were already existing problems, just hidden until now.
### Problem 2
Infinite loop problem is related to hidden questions, but this one isn't. If validation fails, another attempt to read & validate happens. This means user will get two prompts: 2x same question with 2 different error messages. One error message coming from validator, second error message about inability to read input (because this loop repeats until this kind of error happens, so last output will always be this error). As an example, output in practice would look like following
```

 What do you want to do:
 >

 [ERROR] Action must not be empty.

 What do you want to do:
 >

  Aborted.

```

So even if loop stops, output is more than expected.

### Problem 3
This is purely cosmetic issue, but currently user gets `stty: stdin isn't a terminal` printed additionally when question helper tries to ask a hidden question without having tty. I have fixed this in same fashion as was already done for [getShell() method](ee7fc5544e/src/Symfony/Component/Console/Helper/QuestionHelper.php (L500)).

### More details
Well root of the first problem is that `\Symfony\Component\Console\Helper\QuestionHelper::getHiddenResponse` is inconsistent. In some cases it does throw `MissingInputException` (which extends `RuntimeException`), in others doesn't. This is because in others, `shell_exec` is used, which won't return `false` even in non-tty sessions. Initially I attempted to fix this and make them consistent by checking for empty result + `isTty` call, but during my testing I found that at least last, `bash -c` method returns `\n` as output both when passing empty input and when passing newline as input. This means we cannot differentiate with this technique when input is really empty, or at least I can't currently tell how, maybe someone does. I had also idea to use proc_open and check if `STDERR` cotains message about stdin not being a terminal, but I realized these functions might not be available. In future we should modernize this method to use less hacky techniques. Other solutions, eg. Inquirer.js or [hoa/console](https://github.com/hoaproject/Console/blob/master/Source/Readline/Readline.php) have much more elegant solutions. Anyway, since I encountered this issue and additionally this doesn't solve Problem 2, I stopped trying to fix this on this level.

### Alternative solution
Alternative solution to problem 1 and 3 would be to fallback to default in case of hidden questions when tty is missing. But this still doesn't solve problem 2 and I can't think about solution right now which would fix problem 2 separately. We also didn't really reach consensus if reading passwords via stdin is desired. I tried this in `Inquirer.js` and this library *does read password from stdin*

Commits
-------

ee7fc5544e [Console] Default hidden question to 1 attempt for non-tty session
2020-05-04 15:57:21 +02:00
Nicolas Grekas
bd952b9c47 bug #36497 [Filesystem] Handle paths on different drives (crishoj)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Filesystem] Handle paths on different drives

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

`makePathRelative` strips and ignores the drive letters given Windows paths on different drives, resulting in a relative path which does not resolve to the desired target.

This PR makes `makePathRelative` notice paths on different drives, and return the full (absolute) target path in case instead.

Commits
-------

00e727ae4e [Filesystem] Handle paths on different drives
2020-05-04 15:48:43 +02:00
Christian Rishøj
00e727ae4e [Filesystem] Handle paths on different drives 2020-05-04 15:48:34 +02:00
Nicolas Grekas
cf0d086d14 bug #36678 [WebProfiler] Do not add src-elem CSP directives if they do not exist (ndench)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfiler] Do not add src-elem CSP directives if they do not exist

| Q             | A
| ------------- | ---
| Branch?       | 3.4, 4.4, 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36643
| License       | MIT
| Doc PR        | n/a

In the latest 3.4.*, 4.4.* and 5.0.* branches the `script-src-elem` and `style-src-elem` directives are added to the Content-Security-Policy header if they don't exist by copying the `default-src`. This causes browsers to ignore the `script-src` and `style-src` directives which likely contain scripts and styles the developer wanted to allow.

As mentioned in the fixed ticket, we shouldn't be adding these directives if they don't exist because the browser will automatically fallback to `script-src` and `style-src` which we have already added `unsafe-inlen` and the `nonce-*` to.

This will need to be merged into 3.4, 4.4 and 5.0, but I was unsure which branch I am meant to base it off to start with. I've put it on 4.4 but can move it to another if required.

Commits
-------

d9c47087c9 [WebProfiler] Do not add src-elem CSP directives if they do not exist
2020-05-04 15:33:45 +02:00
Nicolas Grekas
78a7f4682f bug #36501 [DX] Show the ParseException message in all YAML file loaders (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[DX] Show the ParseException message in all YAML file loaders

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR synchronizes the exception message in the Routing, Validator and Translation YAML file loaders with the DependencyInjection YAML file loader behavior. Adding the ParseException message is a big DX gain because it highlights the problem directly instead of having to scroll down 7 previous exceptions.

I'm targetting 3.4 because DX can be considered as a bug fix AFAIK.

Commits
-------

fc6cf3d3c6 [DX] Show the ParseException message in YAML file loaders
2020-05-04 15:29:28 +02:00
Nathan Dench
d9c47087c9 [WebProfiler] Do not add src-elem CSP directives if they do not exist 2020-05-04 15:18:19 +02:00
Wouter Diesveld
58bb2c52ac [Yaml] fix parse error when unindented collections contain a comment 2020-05-04 14:50:41 +02:00
Fabien Potencier
0a7fa8f35d minor #36647 Execute docker dependent tests with github actions (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

Execute docker dependent tests with github actions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fixes #36427
| License       | MIT
| Doc PR        | -

* redis, memcached, rabbitmq and vulcain dependent tests moved to the github action
* run on PHP 7.1 and 7.4 only
* use the `integration` group for all tests that depend on docker services
* do not exclude the `integration` group on Travis, but make sure tests that depend on docker services are skipped properly

[<img width="1222" alt="image" src="https://user-images.githubusercontent.com/190447/80806323-48339100-8bb2-11ea-95cd-5ce773c74ce6.png">](https://github.com/jakzal/symfony/runs/636461875?check_suite_focus=true)

Commits
-------

d710c1b654 Execute docker dependent tests with github actions
2020-05-04 14:48:54 +02:00
Jakub Zalas
d710c1b654
Execute docker dependent tests with github actions 2020-05-04 12:09:26 +01:00
Fabien Potencier
469d82d6e2 bug #36672 [Validator] Skip validation when email is an empty object (acrobat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Skip validation when email is an empty object

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | <!-- required for new features -->

When the value passed to the email validator is an empty object the validator is still called and will mark the value as invalid. The object should be skipped in this case, as it is also done in the `UrlValidator`

bfdbb244fe/src/Symfony/Component/Validator/Constraints/UrlValidator.php (L59-L62)

<!--
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/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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 branch master.
-->

Commits
-------

de5d68ef2a Skip validation when email is an empty object
2020-05-04 09:50:33 +02:00
Olatunbosun Egberinde
1c9162d2ad Update exception.html.php 2020-05-04 09:47:19 +02:00
Thomas Calvet
75405247be [3.4][Inflector] Improve testSingularize() argument name 2020-05-04 09:08:14 +02:00
Thomas Calvet
fb42f98315 [Inflector] Fix testPluralize() arguments names 2020-05-04 09:00:39 +02:00
Nicolas Grekas
065a8cee5f [PhpUnitBridge] fix PHP 5.3 compat again 2020-05-03 23:44:38 +02:00
Jeroen Thora
de5d68ef2a
Skip validation when email is an empty object 2020-05-03 21:36:20 +02:00
Fabien Potencier
a5ae434a92 bug #36505 [Translation] Fix for translation:update command updating ICU messages (artemoliynyk)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] Fix for translation:update command updating ICU messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36459
| License       | MIT

If `translation:update` command executed with option `--domain=messages`  – it  ignore `messages-intl-icu` file and just create new `messages`

Method `TranslationUpdateCommand::filterCatalogue()` on `MessageCatalogue::all()` method to get all messages for domain
But `MessageCatalogue::all()` method disredard `intl-icu` domains and simply merge all.

[Translation] added $strict parameter for MessageCatalogueInterface::all() to be able to get only defined domain messages
[FrameworkBundle] modified translation:update command to respect intl-icu domain

Commits
-------

567cee5f02 [Translation] Fix for translation:update command updating ICU messages
2020-05-03 10:46:12 +02:00
Marko Kaznovac
0da177a224
fix sr_Latn translation
*negative* translated as positive
2020-05-03 00:06:24 +02:00
Christian Flothmann
aee10cd44a bug #36627 [Validator] fix lazy property usage. (bendavies)
This PR was squashed before being merged into the 3.4 branch (closes #36627).

Discussion
----------

[Validator] fix lazy property usage.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36343
| License       | MIT
| Doc PR        |

This attempts to fix a large regression introduced in #36343, which broke recursing values returned from `getter` Constraints, because they are now wrapped  in in a `LazyProperty`. The `LazyProperty` needs to be evaluated because some checks are done on the type of `$value`, i.e `is_array` etc... in `validateGenericNode`.

I'm concerned that the original PR didn't really add sufficient test coverage for the introduction of `LazyProperty`, and I'm not 100% sure that I've caught all the cases where the `instanceof` check are needed in this PR.

For the tests, I added the `@dataProvider getConstraintMethods` to every test that hit the problem area of code.

~~The only issue is that my fixed has broken the test introduced in #36343, `testGroupedMethodConstraintValidateInSequence`.~~

~~I think I need @HeahDude to help me work through this. Maybe there is a more simple solution, one that doesn't require doing `instanceof LazyPropery` checks in multiple places, because this feels very brittle.~~
EDIT: fixed that test.

Commits
-------

281861e788 [Validator] fix lazy property usage.
2020-05-02 08:43:10 +02:00
Ben Davies
281861e788 [Validator] fix lazy property usage. 2020-05-02 08:43:03 +02:00
Christian Flothmann
a804333b25 minor #36613 [Form] provide a useful message when extension types don't match (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] provide a useful message when extension types don't match

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36610
| License       | MIT
| Doc PR        |

Commits
-------

88d836643a provide a useful message when extension types don't match
2020-05-02 08:23:09 +02:00
Nicolas Grekas
4528c1194b bug #36601 [Serializer] do not transform empty \Traversable to Array (soyuka)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] do not transform empty \Traversable to Array

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

Today, using `PRESERVE_EMPTY_OBJECTS` ([introduced in 4.0](f28e826627)), the JSON serialization of:

```php
<?php
$object = [];
$object['foo'] = new \ArrayObject();
$object['bar'] = new \ArrayObject(['notempty']);
$object['baz'] = new \ArrayObject(['nested' => new \ArrayObject()]);
```

Outputs:

```json
{"foo":[],"bar":["notempty"],"baz":{"nested":[]}}
```

Instead of the expected:

```json
{"foo":{},"bar":["notempty"],"baz":{"nested":{}}}
```

This issue comes from the Serializer that transforms `Traversable` to an Array [here](11a707200d/src/Symfony/Component/Serializer/Serializer.php (L159)). Also, the `AbstractObjectNormalizer` [doesn't support Traversable](11a707200d/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php (L134)), but he allows to preserve empty objects.

I propose this patch where the fix doesn't transform a `Traversable` to an Array. I see another way to patch this in which we could allow empty Traversable in the `AbstractObjectNormalizer` (not sure it's better though). See attached [other-fix.patch](https://github.com/symfony/symfony/files/4539865/other-fix.log) to see the alternative patch.

Commits
-------

e5c20293fa Fix serializer do not transform empty \Traversable to Array
2020-05-01 23:09:03 +02:00
Vincent Langlet
67b744929f Fix annotation 2020-05-01 19:30:18 +02:00
Nicolas Grekas
c5e5b2d019 [Debug][ErrorHandler] cleanup phpunit.xml.dist files 2020-05-01 18:55:10 +02:00
Artem Oliynyk
567cee5f02 [Translation] Fix for translation:update command updating ICU messages 2020-04-30 20:05:09 +02:00
Nicolas Grekas
f8d3b0626a bug #36606 [Cache] Fixed not supported Redis eviction policies (SerheyDolgushev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Fixed not supported Redis eviction policies

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | no

**Steps to reproduce:**
1. Define the following redis service on SymfonyCloud:
```
rediscache:
    type: redis:5.0
    size: S
    configuration:
        maxmemory_policy: allkeys-lru
```
2. Deploy the change

**Expected result:**
No redis cache will be populated

**Actual result:**
Following exception is thrown:
```
[2020-04-28T05:35:58.440403-04:00] php.CRITICAL: Uncaught Error: Return value of Symfony\Component\Cache\Adapter\RedisTagAwareAdapter::doSave() must be of the type array, bool returned {"exception":"[object] (TypeError(code: 0): Return value of Symfony\\Component\\Cache\\Adapter\\RedisTagAwareAdapter::doSave() must be of the type array, bool returned at /app/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php:100)"} []
```

Commits
-------

3d6e942da5 [Cache] Fixed not supported Redis eviction policies
2020-04-30 19:47:27 +02:00
Nicolas Grekas
856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3 2020-04-29 17:41:38 +02:00
Fabien Potencier
cd66cd57a0 bumped Symfony version to 4.4.9 2020-04-28 20:52:27 +02:00
Fabien Potencier
f7b9d93cb2 updated VERSION for 4.4.8 2020-04-28 20:47:42 +02:00
Nicolas Grekas
dfc4a71eac [Validator] fix merge 2020-04-28 20:23:58 +02:00
Nicolas Grekas
49b74baab4 Merge branch '3.4' into 4.4
* 3.4:
  updated VERSION for 3.4.40
  update CONTRIBUTORS for 3.4.40
  updated CHANGELOG for 3.4.40
  [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB)
  add tests for the ConstraintViolationBuilder class
  Improve dirname usage
  [PhpUnitBridge] Use COMPOSER_BINARY env var if available
  [YAML] escape DEL(\x7f)
  fix compatibility with phpunit 9
  [Cache] skip APCu in chains when the backend is disabled
  [Form] apply automatically step=1 for datetime-local input
2020-04-28 19:55:16 +02:00
Christian Flothmann
88d836643a provide a useful message when extension types don't match 2020-04-28 19:46:51 +02:00
Fabien Potencier
f59e0e9c23 updated VERSION for 3.4.40 2020-04-28 19:41:38 +02:00
Serhey Dolgushev
3d6e942da5 [Cache] Fixed not supported Redis eviction policies 2020-04-28 12:13:53 +01:00
soyuka
e5c20293fa Fix serializer do not transform empty \Traversable to Array 2020-04-27 16:07:50 +02:00
Filippo Tessarotto
4774946fbd [BrowserKit] Allow Referer set by history to be overridden (3.4) 2020-04-27 08:55:12 +02:00