Commit Graph

38556 Commits

Author SHA1 Message Date
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
Fabien Potencier
4a0d5f1273 minor #36901 [HttpKernel] Prevent calling method_exists() with non-string values (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Prevent calling method_exists() with non-string values

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

On php 8, `method_exists()` will raise a `TypeError` if the first argument is neither an object or string. We do have a test case that calls the `ControllerResolver` with integer `1` as `$controller`. This test should work as expected again on php 8.

Commits
-------

1bbfdcbb8d [HttpKernel] Prevent calling method_exists() with non-string values.
2020-05-22 18:43:54 +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
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
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
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
606715b6ec [PhpUnitBridge] fix installing on PHP 8 2020-05-20 23:49:59 +02:00
Nicolas Grekas
b6151ed6cc [PhpUnitBridge] fix leftover 2020-05-20 19:29:51 +02:00
Fabien Potencier
0438baa22f bug #36882 [PhpUnitBridge] fix installing under PHP >= 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix installing under PHP >= 8

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

[As experimented on Twig](b952011f95), using `simple-phpunit` is not simple enough when testing with PHP 8.

This PR fixes the issue so that we could remove these lines in Twig.

On 3.4 since supporting new versions of PHP is a bugfix according to our policies.

Commits
-------

5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8
2020-05-20 19:21:57 +02:00
Nicolas Grekas
5aa25ceb41 [PhpUnitBridge] fix installing under PHP >= 8 2020-05-20 18:13:38 +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
Fabien Potencier
8e428ed217 bug #36867 [PhpUnitBridge] fix bad detection of unsilenced deprecations (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix bad detection of unsilenced deprecations

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

Commits
-------

9d5bb11ec9 [PhpUnitBridge] fix bad detection of unsilenced deprecations
2020-05-19 10:23:06 +02:00
Nicolas Grekas
9d5bb11ec9 [PhpUnitBridge] fix bad detection of unsilenced deprecations 2020-05-19 10:12:21 +02:00
Fabien Potencier
7ee33f9e82 bug #36855 [HttpKernel] Fix error logger when stderr is redirected to /dev/null (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix error logger when stderr is redirected to /dev/null

| 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       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

The HttpKernel Logger is meant to be used as a last resort logging mechanism when no logger has been explicitly configured (Monolog is not a dependency for instance).

For small apps, that can be more than enough.

But under some circumstances, it does not work. When you are using PHP-FPM, `stderr` is ignored by default (`catch_workers_output` is `false`) and so, logs are ignored as well. There is no issue with the official PHP Docker image as the setting has been explicitly set to `true`. Not an issue with Symfony CLI as well, as we also change the setting. Not a problem either with the PHP built-in server as it does not use PHP FPM anyway.

But, in many other places, where the setting has its default value, logs are lost (as you can imagine, it happened to me). As this feature is meant to be a fallback, I think it should always work, or at least, we need to make everything possible to make it work out of the box; that's why I've considered it a bug and hence a PR on 3.4.

This PR changes the default value for the output to `null`, which uses `error_log()` instead of `stderr` to log errors. Why is it better? The output of `error_log()` is controllable by the `error_logs` PHP ini setting and it is well understood by everyone (the default configuration should always work well); so it should work in most/more cases.

The other change (to be discussed) is to also log messages at the `ERROR` level and not just the `CRITICAL` ones.

/cc @dunglas

Commits
-------

5f829bdaeb [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-18 21:01:45 +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
vudaltsov
eb8d626c27 Properties $originalName and $mimeType are never null in UploadedFile 2020-05-16 16:15:54 +03: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
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
Nicolas Grekas
30e2543b49 minor #36829 [Security] Update test to test AccountStatusException behavior (wouterj)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Update test to test AccountStatusException behavior

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (behavior is this way since 2.0)
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

See https://github.com/symfony/symfony/pull/36822

This PR updates the `AccountStatusException` test to test the expected behavior of this exception (and its difference from `AuthenticationException`).

Commits
-------

08fbfcf5a0 Added regression test for AccountStatusException behavior (ref #36822)
2020-05-16 10:33:51 +02:00
Wouter J
08fbfcf5a0 Added regression test for AccountStatusException behavior (ref #36822) 2020-05-15 23:22:25 +02:00
Christian Flothmann
507a5963e4 embed resource name in error message 2020-05-15 09:32:03 +02:00
Fabien Potencier
8f2c68fc60 bug #36794 [Serializer] fix issue with PHP 8 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] fix issue with PHP 8

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

The current logic is a bit strange but I guess it's some legacy from PHP 5.

This keeps the current behavior while skipping the use of `ReflectionParameter::getClass()`, which [is deprecated in PHP 8](http://git.php.net/?p=php-src.git;a=commitdiff;h=28af364d2ae2261addc21f8830f175baa8fa72cf).

Commits
-------

44b45cbaf1 [Serializer] fix issue with PHP 8
2020-05-13 19:01:16 +02:00
Nicolas Grekas
44b45cbaf1 [Serializer] fix issue with PHP 8 2020-05-12 22:34:06 +02: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
Nicolas Grekas
1e1060f2eb minor #36756 [3.4] CS fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] CS fixes

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

Commits
-------

02b378f248 [3.4] CS fixes
2020-05-08 12:53:15 +02:00
Nicolas Grekas
02b378f248 [3.4] CS fixes 2020-05-08 12:38:31 +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
Nicolas Grekas
94482fe1be minor #36726 [FrameworkBundle] display actual target for error in AssetsInstallCommand (NerdyProjects)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[FrameworkBundle] display actual target for error in AssetsInstallCommand

| 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

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.

Commits
-------

f177b3d488 [FrameworkBundle] display actual target for error in AssetsInstallCommand
2020-05-08 11:56:21 +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
Nicolas Grekas
9b088bb014 minor #36744 Remove patches for Doctrine bugs and deprecations (greg0ire)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Remove patches for Doctrine bugs and deprecations

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

This PR removes patches put in place because of a bug fixed in doctrine/dbal#3994, and because of deprecations addressed in doctrine/orm#7953

Commits
-------

2f305cdc83 Remove patches for Doctrine bugs and deprecations
2020-05-08 11:45:19 +02:00
Grégoire Paris
2f305cdc83 Remove patches for Doctrine bugs and deprecations 2020-05-08 11:45: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
a8b5b15c25 minor #36707 Force doctrine/dbal <=2.10.2 when testing (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Force doctrine/dbal <=2.10.2 when testing

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

Until https://github.com/doctrine/dbal/issues/3990 is resolved.

Commits
-------

d1953d61cd Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:52:00 +02:00