Commit Graph

39991 Commits

Author SHA1 Message Date
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
4fe2b4d1d5 Bump min Doctrine DBAL requirement to 2.10 2020-05-22 19:21:20 +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
MatTheCat
d933fa136f Revert https://github.com/symfony/symfony/pull/34986 2020-05-22 19:15:59 +02:00
Jérémy Derussé
a010a87373 Make ExpressionLanguageSyntax validator usable with annotation 2020-05-22 19:13:22 +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
Robin Chalas
a7c09acda0 bug #36873 [Messenger] Fixed check for allowed options in AwsSqs configuration (kroshilin)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Fixed check for allowed options in AwsSqs configuration

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

Before this fix it was unavailable to create Connection with access_key and secret_key in options, because they were added to $clientConfiguration var, and check for extra options was against $configuration var. Which lead to exception.
The idea is to check input options against self::DEFAULT_OPTIONS (which contains all available options)

Commits
-------

fb1967210e [Messenger] Fixed check for allowed options in AwsSqs configuration
2020-05-22 17:48:57 +02:00
Alexander M. Turek
7100c3ce1b [PropertyAccess] Parse php 8 TypeErrors correctly. 2020-05-22 16:26:18 +02:00
Eric Hertwig
de7f3fceec [Messenger] Add suggestion for Amazon SQS transport and make check more readable 2020-05-22 15:43:15 +02:00
Alexander M. Turek
d4045897d6 [Intl] Fix call to ReflectionProperty::getValue() for static properties. 2020-05-22 15:42:59 +02:00
Christian Flothmann
ee169d5a0c deprecate the "allowEmptyString" option 2020-05-22 15:23:49 +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
7950851708 Merge branch '5.1'
* 5.1:
  fix merge
2020-05-21 00:29:09 +02:00
Nicolas Grekas
4f93cc164a Merge branch '5.0' into 5.1
* 5.0:
  fix merge
2020-05-21 00:29:05 +02:00
Nicolas Grekas
4a365d2cf2 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
2020-05-21 00:28:59 +02:00
Nicolas Grekas
0349890720 fix merge 2020-05-21 00:28:08 +02:00
Nicolas Grekas
3574578961 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:11:59 +02:00
Nicolas Grekas
819f76a11f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:11:07 +02:00
Nicolas Grekas
f280829ad8 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix installing on PHP 8 (ter)
  [PhpUnitBridge] fix installing on PHP 8 (bis)
  [PhpUnitBridge] fix installing on PHP 8
2020-05-21 00:10:58 +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
6fbca914ec [PhpUnitBridge] fix installing on PHP 8 2020-05-20 23:45:24 +02:00
Nicolas Grekas
430b884570 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
  [DI] Remove preload primitive types
  [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
  [Validator] allow passing a validator to Validation::createCallable()
2020-05-20 19:44:07 +02:00
Nicolas Grekas
e65cdb685f Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:43:50 +02:00
Nicolas Grekas
b429b15eb5 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix leftover
  [PhpUnitBridge] fix installing under PHP >= 8
  Use ">=" for the "php" requirement
  bump icu 67.1
2020-05-20 19:38:26 +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
0fd5b95178 bug #36859 [Validator] allow passing a validator to Validation::createCallable() (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[Validator] allow passing a validator to Validation::createCallable()

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

As spotted by @stof in https://github.com/symfony/symfony/pull/31466#issuecomment-630054227

Commits
-------

1357cbf8ed [Validator] allow passing a validator to Validation::createCallable()
2020-05-19 19:03:49 +02:00
Nicolas Grekas
754bba483e minor #36866 [DI][Preload] Remove preload primitive types (Michał Jusięga, michaljusiega)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI][Preload] Remove preload primitive types

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no, but it could be for the future
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

After bump my project to  5.1.x-dev I saw the generated file of `*.preload.php` contains classes that are primitive types like int, string, bool.

```
composer create-project symfony/website-skeleton preload "5.1.x-dev"
cat preload/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
```

```
$ cat test/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
$classes[] = 'int';
$classes[] = 'string';
$classes[] = 'Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator';
$classes[] = 'Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint';
$classes[] = 'Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator';
$classes[] = 'Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer';
$classes[] = 'bool';
$classes[] = 'Symfony\Component\Validator\ContainerConstraintValidatorFactory';
$classes[] = 'Symfony\Component\Validator\Constraints\EmailValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\ExpressionValidator';
$classes[] = 'Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator';
$classes[] = 'Symfony\\Component\\Form\\Extension\\Validator\\Constraints\\Form';
```

I don't know if it is expected behaviour, but if not - then PR fix it.

~~In addition, classes are sorted for better reading.~~

Commits
-------

4d05dbbfb5 [DI] Remove preload primitive types
2020-05-19 19:02:44 +02:00
Michał Jusięga
4d05dbbfb5 [DI] Remove preload primitive types 2020-05-19 19:02:10 +02:00
Nicolas Grekas
b7ecb1582a Merge branch '5.0' into 5.1
* 5.0:
  [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:57:22 +02:00
Nicolas Grekas
6237e3d569 Merge branch '4.4' into 5.0
* 4.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:57:09 +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
Anton Kroshilin
fb1967210e [Messenger] Fixed check for allowed options in AwsSqs configuration
Before this fix it was unavailable to create Connection with access_key and secret_key in options, because they were added to $clientConfiguration var, and check for extra options was against $configuration var. Which lead to exception.
The idea is to check input options against self::DEFAULT_OPTIONS (which contains all available options)
2020-05-19 17:36:26 +03:00
Nicolas Grekas
b1c738341f Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [Security] Unserialize $parentData, if needed, to avoid errors
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:31:40 +02:00
Nicolas Grekas
b92399136e Merge branch '5.0' into 5.1
* 5.0:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [Security] Unserialize $parentData, if needed, to avoid errors
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:31:21 +02:00
Nicolas Grekas
31ffd761c3 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix bad detection of unsilenced deprecations
  [Security] Unserialize $parentData, if needed, to avoid errors
  [HttpKernel] Fix error logger when stderr is redirected to /dev/null (FPM)
2020-05-19 10:31:00 +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
Nicolas Grekas
1357cbf8ed [Validator] allow passing a validator to Validation::createCallable() 2020-05-18 18:55:18 +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
Fabien Potencier
5fb5082d28 Merge branch '5.1'
* 5.1:
  Revert "Change priority of KernelEvents::RESPONSE subscriber"
  bumped Symfony version to 5.1.0
  updated VERSION for 5.1.0-RC1
  updated CHANGELOG for 5.1.0-RC1
2020-05-18 09:51:30 +02:00
Fabien Potencier
24067f1889 Merge branch '5.0' into 5.1
* 5.0:
  Revert "Change priority of KernelEvents::RESPONSE subscriber"
2020-05-18 09:51:22 +02:00
Fabien Potencier
08f204c79a Merge branch '4.4' into 5.0
* 4.4:
  Revert "Change priority of KernelEvents::RESPONSE subscriber"
2020-05-18 09:51:10 +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
Fabien Potencier
21dc296b18 bumped Symfony version to 5.1.0 2020-05-16 14:36:23 +02:00
Fabien Potencier
73acbab57b updated VERSION for 5.1.0-RC1 2020-05-16 14:31:53 +02:00
Fabien Potencier
25c4889c8e updated version to 5.2 2020-05-16 14:09:30 +02:00
Nicolas Grekas
c268915352 bug #36832 [Security] Improved upgrade path for custom remember me services (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Improved upgrade path for custom remember me services

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | -
| Deprecations? | -
| Tickets       | https://github.com/symfony/symfony/pull/36806#issuecomment-628592543
| License       | MIT
| Doc PR        |

This improves the upgrade path for custom remember me services now `LogoutHandlerInterface` has been deprecated.

As suggested in https://github.com/symfony/symfony/pull/36806#issuecomment-628592543, the `logout()` method should be added to the `RememberMeServicesInterface` in Symfony 6.

This patch allows developers to write a custom class implementing only `RememberMeServicesInterface` with a `logout()` method. Requiring them to implement `LogoutHandlerInterface` will mean they have to maintain 2 version of the class to support both Symfony 5.1+ and 6.0.

Commits
-------

c49d00f984 Added deprecation for RememberMe services without logout() method
2020-05-16 13:32:52 +02:00
Wouter de Jong
c49d00f984 Added deprecation for RememberMe services without logout() method 2020-05-16 13:05:23 +02:00
Nicolas Grekas
773bebc381 Merge branch '5.0'
* 5.0:
  [VarDumper] fix for change in PHP 7.4.6 (bis)
  [VarExporter] fix for change in PHP 7.4.6
  [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:14:47 +02:00
Nicolas Grekas
7e376fd5b5 Merge branch '4.4' into 5.0
* 4.4:
  [VarDumper] fix for change in PHP 7.4.6 (bis)
  [VarExporter] fix for change in PHP 7.4.6
  [BrowserKit] Allow Referer set by history to be overridden (3.4)
2020-05-16 12:14:41 +02: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
cf04f1ec50 bug #36800 [DI] Renamed some PHP-DSL functions (javiereguiluz)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[DI] Renamed some PHP-DSL functions

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

As discussed in #36778, Symfony wants to move from XML to PHP for its own configuration. I propose these function renames to make the PHP-DSL a bit easier to understand:

```php
<?php
// Before
$services->set(Foo::class)
    ->args([ref(Bar::class), service('stdClass')]);

// After
$services->set(Foo::class)
    ->args([service(Bar::class), inline_service('stdClass')]);
```

Commits
-------

366405b93d [DI] Renamed some PHP-DSL functions
2020-05-16 11:33:23 +02:00
Javier Eguiluz
366405b93d [DI] Renamed some PHP-DSL functions 2020-05-16 11:33:10 +02:00
Nicolas Grekas
5dd99f2062 bug #36806 RememberMeLogoutListener should depend on LogoutHandlerInterface (scheb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

RememberMeLogoutListener should depend on LogoutHandlerInterface

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

`RememberMeLogoutListener`, which was introduced together with the new authenticator security in Symfony 5.1,  depends on `AbstractRememberMeServices`. This forces people to always extend from `AbstractRememberMeServices`, even when they're implementing the correct interface.

I'd suggest to depend on the minimum interface, which is `LogoutHandlerInterface`, instead.

Example of the type errors you'd get otherwise:
`
Argument 1 passed to Symfony\Component\Security\Http\EventListener\RememberMeLogoutListener::__construct() must be an instance of Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices, instance of Scheb\TwoFactorBundle\Security\Authentication\RememberMe\RememberMeServicesDecorator given, called in var/cache/dev/Container3IpOCEd/getSecurity_Logout_Listener_RememberMe_MainService.php on line 22
`

with

```php
class RememberMeServicesDecorator implements RememberMeServicesInterface, LogoutHandlerInterface
[...]
```

Commits
-------

994700fbae Depend on LogoutHandlerInterface
2020-05-16 11:30:21 +02:00
Nicolas Grekas
a86058c2fb bug #36805 [Security\Core] Fix NoopAuthenticationManager::authenticate() return value (chalasr)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security\Core] Fix NoopAuthenticationManager::authenticate() return value

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

Commits
-------

b05da72a3c [Security\Core] Fix NoopAuthenticationManager::authenticate() return value
2020-05-16 11:27:10 +02:00
Robin Chalas
b05da72a3c [Security\Core] Fix NoopAuthenticationManager::authenticate() return value 2020-05-16 11:27:00 +02:00
Nicolas Grekas
02cedc3804 minor #36785 [Messenger] Move doctrine deps to require-dev (tyx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Move doctrine deps to require-dev

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

To avoid requiring all doctrine stuff when require symfony/messenger
(that require symfony/doctrine-messenger to ensure BC)

Commits
-------

b73b26eb79 Move doctrine deps to require-dev
2020-05-16 11:17:14 +02:00
Nicolas Grekas
fb80229a3b minor #36826 [String] Move Inflector's polyfill-ctype dependency to String (derrabus)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] Move Inflector's polyfill-ctype dependency to String

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

With  #35092, the inflector implementation was moved to the string component, including all calls to `ext-ctype`. This is why I think the dependency on the corresponding polyfill should be moved as well, which is what this PR does.

Commits
-------

de960b8007 [String] Move Inflector's polyfill-ctype dependency to String.
2020-05-16 11:16:27 +02:00
Nicolas Grekas
be93a222e4 Merge branch '5.0'
* 5.0:
  [VarDumper] fix for change in PHP 7.4.6
  Added regression test for AccountStatusException behavior (ref #36822)
  [HttpClient] fix PHP warning + accept status code >= 600
  [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts
  embed resource name in error message
  [FrameworkBundle] fix stringable annotation
  Change priority of KernelEvents::RESPONSE subscriber
  Fix register event listeners compiler pass
  Missing description in `messenger:setup-transports` command
  [Serializer] fix issue with PHP 8
  [WebProfiler] Remove 'none' when appending CSP tokens
  [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0
  [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-16 11:12:54 +02:00
Nicolas Grekas
241542e543 Merge branch '4.4' into 5.0
* 4.4:
  [VarDumper] fix for change in PHP 7.4.6
  Added regression test for AccountStatusException behavior (ref #36822)
  [HttpClient] fix PHP warning + accept status code >= 600
  [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts
  embed resource name in error message
  [FrameworkBundle] fix stringable annotation
  Change priority of KernelEvents::RESPONSE subscriber
  Fix register event listeners compiler pass
  Missing description in `messenger:setup-transports` command
  [Serializer] fix issue with PHP 8
  [WebProfiler] Remove 'none' when appending CSP tokens
  [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0
  [Yaml] Fix escaped quotes in quoted multi-line string
2020-05-16 11:10:03 +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
Alexander M. Turek
de960b8007 [String] Move Inflector's polyfill-ctype dependency to String. 2020-05-15 17:20:05 +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
Timothée Barray
b73b26eb79 Move doctrine deps to require-dev
To avoid requiring all doctrine stuff when require symfony/messenger
(that require symfony/doctrine-messenger to ensure BC)
2020-05-14 17:52:50 +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
Christian Scheb
994700fbae Depend on LogoutHandlerInterface 2020-05-13 15:07:15 +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
Fabien Potencier
a73523b065 minor #36798 Secrets, Security, and Messenger commands descriptions should not end with a "." (dot) (carlosbuenosvinos)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

Secrets, Security, and Messenger commands descriptions should not end with a "." (dot)

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (to be switched while merging)
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

When running `bin/console` almost all the command descriptions do not end with a ".". So in order to be consistent, we should remove it from the Secrets Commands.

**Current Output for Secrets Commands (with dots)**
![image](https://user-images.githubusercontent.com/351553/81734096-4a8bca00-9493-11ea-8d5c-bb1dda20bcb0.png)

**Other Command Descriptions (without dots)**
![image](https://user-images.githubusercontent.com/351553/81734428-c84fd580-9493-11ea-8312-05557c7e6f0b.png)

![image](https://user-images.githubusercontent.com/351553/81734489-def62c80-9493-11ea-8d2b-1eb3668291cc.png)

**Symfony CLI output (without dots)**
![image](https://user-images.githubusercontent.com/351553/81734720-3eecd300-9494-11ea-805e-2a3ae3178e8c.png)

Commits
-------

4f7633983e Secrets, Security, and Messenger commands descriptions should not end with a "." (dot)
2020-05-12 22:48:08 +02:00
Carlos Buenosvinos
4f7633983e Secrets, Security, and Messenger commands descriptions should not end with a "." (dot) 2020-05-12 22:47:58 +02:00
Nicolas Grekas
44b45cbaf1 [Serializer] fix issue with PHP 8 2020-05-12 22:34:06 +02:00
Catalin Dan
a53d12674c bug #36793 [DI][Preload] Use require_once instead of require when appending cache warmer-returned files to preload file. 2020-05-12 20:28:51 +03: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
Fabien Potencier
1de42a5f08 bug #36773 [HttpClient] preserve the identity of responses streamed by TraceableHttpClient (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] preserve the identity of responses streamed by TraceableHttpClient

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

Commits
-------

afc44dae16 [HttpClient] preserve the identity of responses streamed by TraceableHttpClient
2020-05-10 18:21:09 +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
afc44dae16 [HttpClient] preserve the identity of responses streamed by TraceableHttpClient 2020-05-10 09:16:11 +02:00
Nicolas Grekas
ab8eca0ef6 [HttpClient] add TimeoutExceptionInterface 2020-05-09 20:37:03 +02:00
Nicolas Grekas
2ed6a0d74c Merge branch '5.0'
* 5.0:
  [HttpClient] fix testTimeoutIsNotAFatalError (bis)
2020-05-09 19:43:56 +02:00
Nicolas Grekas
b3e49ee2b4 Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] fix testTimeoutIsNotAFatalError (bis)
2020-05-09 19:43:51 +02:00
Nicolas Grekas
333f7187dc [HttpClient] fix testTimeoutIsNotAFatalError (bis) 2020-05-09 19:43:44 +02:00
Nicolas Grekas
3cdd2e4643 Merge branch '5.0'
* 5.0:
  [HttpClient] fix testTimeoutIsNotAFatalError
2020-05-09 18:24:19 +02:00
Nicolas Grekas
0ff13b2404 Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] fix testTimeoutIsNotAFatalError
2020-05-09 18:24:13 +02:00
Nicolas Grekas
00ae470307 [HttpClient] fix testTimeoutIsNotAFatalError 2020-05-09 18:24:06 +02:00
Nicolas Grekas
53423db039 Merge branch '5.0'
* 5.0:
  [HttpClient] improve testTimeoutIsNotAFatalError
  Fix for #36715
2020-05-09 17:57:56 +02:00
Nicolas Grekas
c794cab0cb Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] improve testTimeoutIsNotAFatalError
  Fix for #36715
2020-05-09 17:57:42 +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
Fabien Potencier
97a578201d minor #36763 [Security] Improve method signatures (minor) (umulmrum)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Improve method signatures (minor)

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

Improves type declarations and docblocks of new authenticator-related methods.

Commits
-------

b009254090 [Security] Improve method signatures (minor)
2020-05-09 14:14:32 +02:00
Nicolas Grekas
52c52a846c Merge branch '5.0'
* 5.0:
  [HttpClient] test that timeout is not fatal
2020-05-09 14:11:30 +02:00
Nicolas Grekas
d01ea50f7b Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] test that timeout is not fatal
2020-05-09 14:10:43 +02:00
Nicolas Grekas
36ccf4c65b [HttpClient] test that timeout is not fatal 2020-05-09 14:08:40 +02:00
Stefan Kruppa
b009254090 [Security] Improve method signatures (minor) 2020-05-09 13:45:48 +02:00
Nicolas Grekas
8fec0654d2 bug #36765 [HttpClient] fix dealing with informational response (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] fix dealing with informational response

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

Skipping the test was a bad idea, the failure was legit.

Commits
-------

9068aa48e2 [HttpClient] fix dealing with informational response
2020-05-08 23:44:02 +02:00
Nicolas Grekas
012247dc98 minor #36764 [HttpClient] remove "experimental" annotations (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpClient] remove "experimental" annotations

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

Commits
-------

db4cb51f0c [HttpClient] remove "experimental" annotations
2020-05-08 23:43:12 +02:00
Nicolas Grekas
2b554d8ad7 [Contracts] bump branch alias 2020-05-08 23:41:03 +02:00
Nicolas Grekas
9068aa48e2 [HttpClient] fix dealing with informational response 2020-05-08 22:52:14 +02:00
Nicolas Grekas
db4cb51f0c [HttpClient] remove "experimental" annotations 2020-05-08 22:08:25 +02:00
Nicolas Grekas
fb90fb3bb7 minor #36758 [5.1] CS fixes (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[5.1] CS fixes

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

Commits
-------

bb164e6615 [5.1] CS fixes
2020-05-08 14:37:13 +02:00
Nicolas Grekas
f8616f8eae Merge branch '5.0'
* 5.0:
  [PhpUnitBridge] fix bad test
  [4.4] CS fixes
  [3.4] CS fixes
  Disable phpunit verbosity
  Queue name is a required parameter
  [FrameworkBundle] display actual target for error in AssetsInstallCommand
  Remove patches for Doctrine bugs and deprecations
  [Mime] fix bad method call on "EmailAddressContains"
  [DI][EventDispatcher] added contract for implementation
2020-05-08 14:36:29 +02:00
Nicolas Grekas
0b34b39cc8 Merge branch '4.4' into 5.0
* 4.4:
  [PhpUnitBridge] fix bad test
  [4.4] CS fixes
  [3.4] CS fixes
  Disable phpunit verbosity
  Queue name is a required parameter
  [FrameworkBundle] display actual target for error in AssetsInstallCommand
  Remove patches for Doctrine bugs and deprecations
  [Mime] fix bad method call on "EmailAddressContains"
  [DI][EventDispatcher] added contract for implementation
2020-05-08 14:34:39 +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
bb164e6615 [5.1] CS fixes 2020-05-08 12:41:08 +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
Fabien Potencier
8f58a2d392 bug #36737 [Cache] fix accepting sub-second max-lifetimes in ArrayAdapter (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Cache] fix accepting sub-second max-lifetimes in ArrayAdapter

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

Commits
-------

cefa1e6e82 [Cache] fix accepting sub-second max-lifetimes in ArrayAdapter
2020-05-08 08:20:41 +02:00
Fabien Potencier
070552e1ca bug #36749 [DI] give priority to container.hot_path over container.no_preload (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] give priority to container.hot_path over container.no_preload

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

Spotted by looking at a website skeleton: `ConsoleHandler` is not preloaded right now (because it listens to console events only) while it should (because it is also wired as a monolog handle and is thus on the hot path.)

Commits
-------

461041f87d [DI] give priority to container.hot_path over container.no_preload
2020-05-08 08:17:45 +02:00
Nicolas Grekas
9d13d88e8d [DI] reduce recursivity of ResolveHotPathPass 2020-05-08 00:37:41 +02:00
Nicolas Grekas
461041f87d [DI] give priority to container.hot_path over container.no_preload 2020-05-08 00:34:01 +02:00
Gocha Ossinkine
2e99caacaf [Yaml] Fix escaped quotes in quoted multi-line string 2020-05-07 22:33:48 +05:00
Nicolas Grekas
cefa1e6e82 [Cache] fix accepting sub-second max-lifetimes in ArrayAdapter 2020-05-07 11:51:26 +02:00
Fabien Potencier
75e71e3bbe bug #36721 [FrameworkBundle] remove getProjectDir method from MicroKernelTrait (garak)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] remove getProjectDir method from MicroKernelTrait

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36719
| License       | MIT
| Doc PR        | not needed

Remove method added in trait, to be able to use same method in base kernel class.

Commits
-------

f2f3ebac8b remove getProjectDir method from MicroKernelTrait
2020-05-06 13:28:34 +02:00
Nicolas Grekas
1294cb5240 [HttpFoundation] fix perf of ResponseHeaderBag::initDate() 2020-05-06 12:54:46 +02:00
Massimiliano Arione
f2f3ebac8b
remove getProjectDir method from MicroKernelTrait 2020-05-06 12:44:29 +02:00
Jakub Zalas
dc7ac57a3c
Configure services additionally required by the master branch 2020-05-05 20:37:11 +01:00
Fabien Potencier
651f434783 bumped Symfony version to 5.1.0 2020-05-05 19:11:24 +02:00
Fabien Potencier
4bc152b033 updated VERSION for 5.1.0-BETA1 2020-05-05 19:05:38 +02:00
Nicolas Grekas
ea638549f4 [Form] deprecate NumberToLocalizedStringTransformer::ROUND_* constants 2020-05-05 18:27:54 +02:00
Nicolas Grekas
21edafac5e CI fixes 2020-05-05 18:19:12 +02:00
Nicolas Grekas
623e266cab Fix tests 2020-05-05 17:08:52 +02:00
Matthias Derer
88e43d4d4c [DI][EventDispatcher] added contract for implementation
fixes #36708.
2020-05-05 17:06:23 +02:00
Nicolas Grekas
02d9597a41 Merge branch '5.0'
* 5.0:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:53:42 +02:00
Nicolas Grekas
cd21c8208e Merge branch '4.4' into 5.0
* 4.4:
  Force doctrine/dbal <=2.10.2 when testing
2020-05-05 15:53:15 +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
Fabien Potencier
4228676b1a Merge branch '5.0'
* 5.0:
  [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:56:29 +02:00
Fabien Potencier
1f5eab2955 Merge branch '4.4' into 5.0
* 4.4:
  [Console] fix "data lost during stream conversion" with QuestionHelper
2020-05-05 13:56:08 +02:00
Nicolas Grekas
6d089ac437 [Console] fix "data lost during stream conversion" with QuestionHelper 2020-05-05 13:09:20 +02:00
Nicolas Grekas
11f4e8b475 Merge branch '5.0'
* 5.0:
  [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:46:02 +02:00
Nicolas Grekas
bf1222621a Merge branch '4.4' into 5.0
* 4.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:14 +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
36c0ce7cfb feature #36681 [FrameworkBundle] use the router context by default for assets (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] use the router context by default for assets

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

Follows #36651 and #21027

This means assets are going to be configured automatically most of the time. The only case where `asset.request_context.base_path` is useful is when the webserver still keeps a `/index.php/` in URLs. (I'm not sure if the doc should tell ppl to use the parameter, or if we should tell ppl to improve the config of their server...)

Commits
-------

1ac5f68810 [FrameworkBundle] use the router context by default for assets
2020-05-05 09:03:13 +02:00
Kévin Dunglas
be855a20bf [Serializer] Allow to include the severity in ConstraintViolationList 2020-05-05 08:59:24 +02:00
Fabien Potencier
5a2aef1d7e feature #36471 [String] allow passing a string of custom characters to ByteString::fromRandom (azjezz)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[String] allow passing a string of custom characters to ByteString::fromRandom

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes/
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

5d15c0be60 [String] allow passing a string of custom characters to ByteString::fromRandom
2020-05-05 08:58:12 +02:00
Fabien Potencier
ad01068b38 Revert "feature #36184 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate() (javiereguiluz)"
This reverts commit b494beb5dc, reversing
changes made to b9d41490fe.
2020-05-05 08:53:10 +02:00
Fabien Potencier
3e737ec28f feature #35092 [Inflector][String] Move Inflector in String (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Inflector][String] Move Inflector in String

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | https://github.com/orgs/symfony/projects/1#card-30499514
| License       | MIT
| Doc PR        | -

Needs https://github.com/symfony/symfony/pull/35091.

Should we have a standalone inflector (like the Slugger) or 2 new methods (pluralize and singularize) on the AbstractString class? I implemented both but since we only handle English I finally preferred the first one.

TODO (after the "move" is OK):
- [x] Deprecate the Inflector component
- [x] Use the String inflector in Symfony's code

Commits
-------

9c6a5c0093 [String] Move Inflector in String
2020-05-05 08:52:01 +02:00
Fabien Potencier
341ea45219 feature #36302 [Form] Add the html5 option to ColorType to validate the input (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] Add the html5 option to ColorType to validate the input

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

Continuation of https://github.com/symfony/symfony/pull/35626.

I'm resubmitting the initial implementation, this time in the Form component.

This `Color` constraint is dedicated to the HTML5 input type="color".

Commits
-------

454b6ff48b [Form] Add the html5 option to ColorType to validate the input
2020-05-05 08:48:59 +02:00
Thomas Calvet
9c6a5c0093 [String] Move Inflector in String 2020-05-05 08:40:05 +02:00
Javier Eguiluz
7b9ff2a445 [FrameworkBundle] Deprecate renderView() in favor of renderTemplate() 2020-05-05 08:26:27 +02:00
Fabien Potencier
b9d41490fe feature #36655 Automatically provide Messenger Doctrine schema to "diff" (weaverryan)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

Automatically provide Messenger Doctrine schema to "diff"

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Alternative to #36629
| License       | MIT
| Doc PR        | TODO - WILL be needed

This follows this conversation: https://github.com/symfony/symfony/pull/36629#issuecomment-621745821 - it automatically adds SQL to Doctrine's migration/diff system when features are added the require a database table:

The new feature works for:

### A) Messenger Doctrine transport
**FULL support**
Works perfectly: configure a doctrine transport and run `make:migration`

**Note**: There is no current way to disable this. So if you have `auto_setup` ON and you
run `make:migration` before trying Messenger, it will generate the table SQL. Adding a
flag to disable it might be very complicated, because we need to know (in DoctrineBundle, at compile time) whether or not this feature is enabled/disabled so that we can decide *not* to add `messenger_messages` to the `schema_filter`.

### B) `PdoAdapter` from Cache
**FULL support**
Works perfectly: configure a doctrine transport and run `make:migration`

### C) `PdoStore` from Lock
**PARTIAL support**
I added `PdoStore::configureSchema()` but did NOT add a listener. While `PdoStore` *does* accept a DBAL `Connection`, I don't think it's possible via the `framework.lock` config to create a `PdoStore` that is passed a `Connection`. In other words: if we added a listener that called `PdoStore::configureSchema` if the user configured a `pdo` lock, that service will *never* have a `Connection` object... so it's kind of worthless.

**NEED**: A proper way to inject a DBAL `Connection` into `PdoStore` via `framework.lock` config.

### D) `PdoSessionHandler`
**NO support**

This class doesn't accept a DBAL `Connection` object. And so, we can't reliably create a listener to add the schema because (if there are multiple connections) we wouldn't know which Connection to use.

We could compare (`===`) the `PDO` instance inside `PdoSessionHandler` to the wrapped `PDO` connection in Doctrine. That would only work if the user has configured their `PdoSessionHandler` to re-use the Doctrine PDO connection.

The `PdoSessionHandler` *already* has a `createTable()` method on it to help with manual migration. But... it's not easy to call from a migration because you would need to fetch the `PdoSessionHandler` service from the container. Adding something

**NEED**: Either:

A) A way for `PdoSessionHandler` to use a DBAL Connection
or
B) We try to hack this feature by comparing the `PDO` instances in the event subscriber
or
C) We add an easier way to access the `createTable()` method from inside a migration.

TODOs

* [X] Determine service injection XML needed for getting all PdoAdapter pools
* [ ] Finish DoctrineBundle PR: https://github.com/doctrine/DoctrineBundle/pull/1163

Commits
-------

2dd9c3c3c8 Automatically provide Messenger Doctrine schema to "diff"
2020-05-05 08:13:58 +02:00
Ryan Weaver
2dd9c3c3c8 Automatically provide Messenger Doctrine schema to "diff" 2020-05-05 08:13:52 +02:00
Fabien Potencier
3d30ff7677 feature #35849 [ExpressionLanguage] Added expression language syntax validator (Andrej-in-ua)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[ExpressionLanguage] Added expression language syntax validator

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #35700
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

Proposal implementation #35700

The current solution is a compromise between support complexity and cleanliness.

I tried different solutions to the issue. A beautiful solution was obtained only with full duplication of the parser code. That is unacceptable because parser complexity is quite high.

The main problem in this solution is that nodes instances are created which are then not used. I do not think that linter can be a bottleneck and will greatly affect performance. If this is corrected, the parser code becomes a bunch of if's.

JFI: I did not added parsing without variable names, because this breaks caching and potential location for vulnerabilities.

Commits
-------

a5cd965494 [ExpressionLanguage] Added expression language syntax validator
2020-05-05 07:59:29 +02:00
Andrey Sevastianov
a5cd965494 [ExpressionLanguage] Added expression language syntax validator 2020-05-05 07:59:23 +02:00
Fabien Potencier
ac1a336040 Fix typo 2020-05-05 07:41:22 +02:00
Fabien Potencier
a0c2dd8a87 feature #36656 [Security/Core] Add CustomUserMessageAccountStatusException (VincentLanglet)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security/Core] Add CustomUserMessageAccountStatusException

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

When implementing the `UserCheckerInterface`, we can throw `AccountStatusException`. Similar to `CustomUserMessageAuthenticationException`, this exception allow to throw an `AccountStatusException` with a custom message.

Commits
-------

9233efbe06 Add CustomUserMessageAccountStatusException
2020-05-05 07:40:46 +02:00
Fabien Potencier
c2cc99375d Fix changelog 2020-05-05 07:40:09 +02:00
Fabien Potencier
55706f75ac feature #36621 Log deprecations on a dedicated Monolog channel (l-vo)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

Log deprecations on a dedicated Monolog channel

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/orgs/symfony/projects/1#card-35233930
| License       | MIT
| Doc PR        |

This PR allows to activate a specific channel for deprecations.

## Base configuration

```yaml
monolog:
    handlers:
        #...
        deprecation:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
        deprecation_filter:
            type: filter
            handler: deprecation
            max_level: info
            channels: ["php"]
```

## Deprecation specific channel enabled:

```yaml
monolog:
    channels: ['deprecation']
    handlers:
        #...
        deprecation:
            type: stream
            channels: ["deprecation"]
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
```

Commits
-------

3d415cb70d Log deprecations on a dedicated Monolog channel
2020-05-05 07:39:34 +02:00
Laurent VOULLEMIER
3d415cb70d Log deprecations on a dedicated Monolog channel 2020-05-05 07:39:28 +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
azjezz
5d15c0be60 [String] allow passing a string of custom characters to ByteString::fromRandom 2020-05-04 23:13:29 +01:00
Christian Flothmann
440e0b7b63 support YAML 1.2 octal notation, deprecate YAML 1.1 one 2020-05-04 22:33:22 +02:00
Christian Flothmann
92bc19fd0c prevent notice for invalid octal numbers on PHP 7.4 2020-05-04 18:58:31 +02:00
Fabien Potencier
0d4bba82b8 feature #36557 [Messenger] Add support for RecoverableException (jderusse)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Add support for RecoverableException

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

The messenger supports the `UnrecoverableException` preventing the messenger retry mechanism
 when the Handler will never be able to process the Message.

This PR adds the opposite behavior to always retry the message.

UseCase:
- High concurency Consumers use non-blocking lock
- 503/429 errors from 3rd party API

Commits
-------

e7c31675f7 [Messenger] Add support for RecoverableException
2020-05-04 18:55:50 +02:00
Jérémy Derussé
e7c31675f7 [Messenger] Add support for RecoverableException 2020-05-04 18:55:44 +02:00
Christian Flothmann
e91bb614ae properly handle empty lines 2020-05-04 18:35:27 +02:00
Christian Flothmann
6d0195f3cd fix tests 2020-05-04 18:17:53 +02:00
Nicolas Grekas
39aab260d4 Merge branch '5.0'
* 5.0:
  Use PHP 7.2 minimum in tests run with github actions
  Fix exception messages containing exception messages
2020-05-04 17:54:21 +02:00
Nicolas Grekas
992f50fee2 Merge branch '4.4' into 5.0
* 4.4:
  Fix exception messages containing exception messages
2020-05-04 17:34:58 +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
1ae3e043c5 Merge branch '5.0'
* 5.0: (26 commits)
  [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
  Execute docker dependent tests with github actions
  Update exception.html.php
  [3.4][Inflector] Improve testSingularize() argument name
  [Inflector] Fix testPluralize() arguments names
  [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
  [Debug][ErrorHandler] cleanup phpunit.xml.dist files
  [Translation] Fix for translation:update command updating ICU messages
  [PhpUnitBridge] fix compat with PHP 5.3
  bumped Symfony version to 5.0.9
  updated VERSION for 5.0.8
  updated CHANGELOG for 5.0.8
  bumped Symfony version to 4.4.9
  updated VERSION for 4.4.8
  ...
2020-05-04 16:13:31 +02:00
Nicolas Grekas
ae226ee34b Merge branch '4.4' into 5.0
* 4.4: (23 commits)
  [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
  Execute docker dependent tests with github actions
  Update exception.html.php
  [3.4][Inflector] Improve testSingularize() argument name
  [Inflector] Fix testPluralize() arguments names
  [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
  [Debug][ErrorHandler] cleanup phpunit.xml.dist files
  [Translation] Fix for translation:update command updating ICU messages
  [PhpUnitBridge] fix compat with PHP 5.3
  bumped Symfony version to 4.4.9
  updated VERSION for 4.4.8
  updated CHANGELOG for 4.4.8
  provide a useful message when extension types don't match
  [Cache] Fixed not supported Redis eviction policies
  ...
2020-05-04 16:05:24 +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
Thomas Calvet
3e80e461a9 [DependencyInjection] Add a mechanism to deprecate public services to private 2020-05-04 15:38:14 +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
Nicolas Grekas
1ac5f68810 [FrameworkBundle] use the router context by default for assets 2020-05-04 10:37:33 +02: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
Fabien Potencier
e9be7418a3 feature #36651 [FrameworkBundle] Allow configuring the default base URI with a DSN (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Allow configuring the default base URI with a DSN

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fixes #35121, replaces #35580, partially reverts #35281
| License       | MIT
| Doc PR        | -

Instead of defining 3-4 parameters, this PR enables using a single DSN to configure the default URL context (for commands mainly):
```
framework:
	router:
		base_uri: 'https://my.host:8443/base-path/'
```

When using parameters directly, one can now set the same absolute URI in the `router.request_context.base_url` parameter, this will provide the same benefit.

Commits
-------

250fa7e979 [FrameworkBundle] Allow configuring the default base URI with a DSN
2020-05-04 09:42:27 +02:00
Nicolas Grekas
250fa7e979 [FrameworkBundle] Allow configuring the default base URI with a DSN 2020-05-04 09:14:05 +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
09645a9103 feature #36600 [Security] Added LDAP support to Authenticator system (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Added LDAP support to Authenticator system

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

The last missing authenticator in the new system 🎉

I have no experience with LDAP at all and I didn't succeed in setting up a server locally. So I can't test whether this works, but the unit test works (and also tested in a real app, while adding a `dd()` call in the listener).

---

I want to share with you the current state of Security LDAP, how this PR implements it and a possible other solution (which I think I would prefer most). Is there anyone who can share their opinions on this? (hopefully @weaverryan and @csarrazi can share their opinion, as they have most experience on this topic)

1. **Current Solution: An LDAP authentication provider + duplicated `SecurityFactory` classes**
   LDAP is done in one centralized authentication provider. This provider is configured by security factories for each core factory (e.g. `form_login` becomes `form_login_ldap`, `http_basic` becomes `http_basic_ldap`).
2. **Implementation in this PR: A listener is executed before the default `VerifyCredentialsListener`, to verify `PasswordCredentials`**
   This listener must be configured for each specific authenticator wanting to use LDAP. This is a technique similar to (1). It's a bit difficult to use this for your own authenticator (you need to configure a custom listener service) and still needs the duplicated factory classes
3. **Proposal: Introduce a `LdapCredentials` class and always register a listener**
   If an authentictor returns `LdapCredentials`, it'll be checked using the LDAP verification listener. This is the easiest for custom authenticators and would remove the duplicated factories, I can imagine `form_login` getting a new `ldap` sub option to configure the settings.

   The main disadvantage (I think) is that we would need to make `LdapCredentials` configure all options: ldap service, dnString, searchDn, searchPassword & queryString. Especially passing around the ldap service seems a bit weird. The main questions here are: Is it weird to pass all these things in the `LdapCredentials`? And, do we really need to support having multiple LDAP configuration sets for different authenticators? Or can we e.g. add a global `security.ldap` configuration, that registers the listener for all authenticators returning `LdapCredentials`?

Commits
-------

20962e604a [Security] Added LDAP support to Authenticator system
2020-05-03 19:24:55 +02:00
Michel Hunziker
ea79206470 [Messenger] Add option to stop the worker after a message failed 2020-05-03 19:22:38 +02:00
Fabien Potencier
362c5d4700 minor #36670 [Translations] Throw exception if xFileLoader dependencies don't exist. (jrushlow)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Translations] Throw exception if xFileLoader dependencies don't exist.

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

`XliffFileLoader` & `QtFileLoader` both require `XmlUtils::class` from the `Config` component. This PR throws a friendly exception is the `Config` component does not exist.

Original idea by @xabbuh was to throw the exception from the __constructor. This PR throws the exception from the `load()` method to be consistent with the `YamlFileLoader::class`.  But that can easily be changed.

Commits
-------

627e476eb4 [Translations] Throw exception if xFileLoader dependencies don't exist.
2020-05-03 19:18:39 +02:00
Jesse Rushlow
627e476eb4 [Translations] Throw exception if xFileLoader dependencies don't exist. 2020-05-03 19:18:32 +02:00
Wouter de Jong
20962e604a [Security] Added LDAP support to Authenticator system 2020-05-03 12:56:20 -04:00
Fabien Potencier
017420b511 feature #36094 [AmazonSqsMessenger] Use AsyncAws to handle SQS communication (jderusse)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[AmazonSqsMessenger] Use AsyncAws to handle SQS communication

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

Similar to #35992 this PR use AsyncAws to handle Sqs messages sent/receive

It move complexity of authentication/streaming outside Symfony while keeping HttpClient integration.

Commits
-------

7c4888eed1 [AmazonSqsMessenger] Use AsyncAws to handle SQS communication
2020-05-03 18:22:12 +02:00
Jérémy Derussé
7c4888eed1 [AmazonSqsMessenger] Use AsyncAws to handle SQS communication 2020-05-03 18:22:01 +02:00
Fabien Potencier
87a570185e bug #36660 [Messenger] Fix messenger:failed:remove can not remove single message (tienvx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Messenger] Fix messenger:failed:remove can not remove single message

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

Fix this error:
```
count(): Parameter must be an array or an object that implements Countable
```
When calling `messenger:failed:remove` command from other code with single id

Commits
-------

e66cd97ec3 [Messenger] Fix messenger:failed:remove can not remove single message
2020-05-03 17:44:00 +02:00
Fabien Potencier
eebb3efa2c feature #36636 Add support of PHP8 static return type for withers (l-vo)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Add support of PHP8 static return type for withers

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/orgs/symfony/projects/1#card-35852557
| License       | MIT
| Doc PR        |

Commits
-------

04fdf05cff Add support of PHP8 static return type for withers
2020-05-03 16:47:09 +02:00
Fabien Potencier
d6aa205b47 feature #36586 [DI] allow loading and dumping tags with an attribute named "name" (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[DI] allow loading and dumping tags with an attribute named "name"

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

This is a minor feature added for consistency: using PHP, we can already define tags with an attribute named `"name"`. But then, we cannot dump such definitions in YAML nor XML since we don't have a syntax to declare such tags in these formats.

I spotted this while looking at a dumped container: we already use an attribute named `"name"` on two tags: `cache.pool` and `workflow.definition`. Currently, the dumped XML is wrong because of this.

This PR enables the following new syntaxes (the current style still works as usual):
- in YAML, consistently with the new syntax for method calls:
  ```yaml
  tags:
    - cache.pool: { name: my_cache_pool }
  ```
- in XML:
  ```xml
  <tag name="my_cache_pool">cache.pool</tag>
  ```

Commits
-------

b023e4cac3 [DI] allow loading and dumping tags with an attribute named "name"
2020-05-03 16:42:23 +02:00
Fabien Potencier
07a0334947 feature #36599 [HttpKernel] make kernels implementing WarmableInterface be part of the cache warmup stage (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] make kernels implementing `WarmableInterface` be part of the cache warmup stage

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

This allows your kernel to return extra classes to preload also (which was my main motivation for creating this PR actually.)

```php
// ...
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
// ...

class Kernel ... implements ..., WarmableInterface
{
    // ...

    public function warmUp(string $cacheDir): array
    {
        // ...

        return [
            SomeClassToPreload::class,
            AnotherClassClassToPreload::class,
            $cacheDir.'/some-file-to-preload.php',
            // ...
        ];
    }

    // ...
}
```

Commits
-------

649e530356 [HttpKernel] make kernels implementing `WarmableInterface` be part of the cache warmup stage
2020-05-03 16:39:00 +02:00
Fabien Potencier
3a6f8ca3e4 bug #36578 [Form] deprecate not using a rounding mode (xabbuh)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Form] deprecate not using a rounding mode

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

Commits
-------

25ba1a241d deprecate not using a rounding mode
2020-05-03 16:35:45 +02:00
Fabien Potencier
669b7f132b feature #35992 [Mailer] Use AsyncAws to handle SES requests (jderusse)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Mailer] Use AsyncAws to handle SES requests

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #33183, #35468 and #35037
| License       | MIT
| Doc PR        | TODO

alternative to #33326

This PR replace the native code to call AWS SES by the new [AsyncAws](https://github.com/async-aws/aws) project maintained by @Nyholm and me.

This removes complexity of signing request, and adds new features likes:
- authentication via .aws/config.ini, Instance profile, WebIdentity (K8S service account)
- usesignature V4 (the one recommanded by the Official SDK )
- fully compatible with API (uses the official AWS SDK interface contract to generate classes)

Because it's based on `symfony/http-client`, it's fully integrable with Symfony application.

Commits
-------

21243874bc [Mailer] Use AsyncAws to handle SES requests
2020-05-03 16:23:47 +02:00
Jérémy Derussé
21243874bc [Mailer] Use AsyncAws to handle SES requests 2020-05-03 16:23:41 +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
Wouter de Jong
ac84a6c5d9 Removed AnonymousToken from the authenticator system
* Anonymous users are actual to unauthenticated users, both are now represented by no token
* Added a PUBLIC_ACCESS Security attribute to be used in access_control
* Deprecated "anonymous: lazy" in favor of "lazy: true"
2020-05-03 08:43:40 +02:00
Fabien Potencier
28bb74cd50 bug #36661 [SecurityBundle] Fixed entry point service ID resolving and multiple guard entry points (wouterj)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[SecurityBundle] Fixed entry point service ID resolving and multiple guard entry points

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

@fabpot I am not able to reproduce [the error you reported](https://github.com/symfony/symfony/pull/36575#issuecomment-622272051) in any of my demo applications or in the tests introduced in this PR. The error indicates that no entry point is configured in your application, can you maybe try out this patch (given it now makes a hard error when more than one guard is used)? If it still doesn't work, can you maybe share your firewall configuration?

---

_build failures are unrelated_

Commits
-------

c75659350e Do not make AbstractFactory internal and revert method rename
6870a18803 Fixed entry point resolving and guard entry point configuration
2020-05-03 08:36:54 +02:00
Marko Kaznovac
0da177a224
fix sr_Latn translation
*negative* translated as positive
2020-05-03 00:06:24 +02:00
Wouter de Jong
c75659350e Do not make AbstractFactory internal and revert method rename 2020-05-02 20:58:17 +02:00
Wouter de Jong
5ba4d1de86 Renamed VerifyAuthenticatorCredentialsEvent to CheckPassportEvent 2020-05-02 20:51:30 +02:00
Wouter de Jong
6870a18803 Fixed entry point resolving and guard entry point configuration 2020-05-02 15:04:30 +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
tien.xuan.vo
e66cd97ec3 [Messenger] Fix messenger:failed:remove can not remove single message 2020-05-02 11:26:03 +07: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
Vincent Langlet
9233efbe06 Add CustomUserMessageAccountStatusException 2020-05-01 19:29:52 +02:00
Nicolas Grekas
c5e5b2d019 [Debug][ErrorHandler] cleanup phpunit.xml.dist files 2020-05-01 18:55:10 +02:00
Wouter J
69784713bb
Fixed #36575 2020-05-01 09:50:12 +02:00
Fabien Potencier
ed1b6eaf83 bug #36609 Add missing port SQS Host Header request (jderusse)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Add missing port SQS Host Header request

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

When user provides a custom endpoint, the port is missing from the `Host` headers, leading to wrong URL when calling `getQueueUrl`

Commits
-------

41165beb48 Add missing port SQS Host Header request
2020-05-01 08:04:26 +02:00
Fabien Potencier
da6620c035 bug #36635 [Notifier] Fix 3 errors for bridge Mattermost (Sébastien COURJEAN)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Notifier] Fix 3 errors for bridge Mattermost

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36632
| License       | MIT
| Doc PR        | symfony/symfony-docs#...

Fix 3 errors for bridge mattermost in notifier component.

Commits
-------

ca9439ac43 [Notifier] Fix 3 errors for bridge Mattermost
2020-05-01 08:02:37 +02:00
Sébastien COURJEAN
ca9439ac43 [Notifier] Fix 3 errors for bridge Mattermost 2020-05-01 08:02:29 +02:00
Laurent VOULLEMIER
04fdf05cff Add support of PHP8 static return type for withers 2020-04-30 22:10:08 +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
649e530356 [HttpKernel] make kernels implementing WarmableInterface be part of the cache warmup stage 2020-04-30 19:43:15 +02:00
Nicolas Grekas
0633308bb3 minor #36644 [FrameworkBundle][CacheWarmupCommand] Append files to preload (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle][CacheWarmupCommand] Append files to preload

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

Files returned by the warmUp() method must be added to the preload file.

I also added checks to avoid empty preload calls in the preload file like this:
```
$classes = [];
Preloader::preload($classes);
```

Commits
-------

a82c7ab4c0 [FrameworkBundle][CacheWarmupCommand] Append files to preload
2020-04-30 19:42:17 +02:00
Nicolas Grekas
27c10f0f24 minor #36646 [HttpFoundation][HttpKernel] Add more preload always-needed symbols (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpFoundation][HttpKernel] Add more preload always-needed symbols

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Part of https://github.com/orgs/symfony/projects/1#card-37082675
| License       | MIT
| Doc PR        | -

`ConfigCache` is in the hot path because it is used for every request in the kernel boot (initializeContainer() method). I guess we can consider that every kernel is going to be booted so it should always be used.

`InputBag` should be added too - it is used in the Request initialization so it will likely be hit on every request as well - but maybe it wasn't added in the first place for a reason since other bags are already there?

Commits
-------

636a8bdf12 [HttpFoundation][HttpKernel] Add more preload always-needed symbols
2020-04-30 19:12:27 +02:00
Thomas Calvet
636a8bdf12 [HttpFoundation][HttpKernel] Add more preload always-needed symbols 2020-04-30 18:01:38 +02:00
Thomas Calvet
a82c7ab4c0 [FrameworkBundle][CacheWarmupCommand] Append files to preload 2020-04-30 16:30:59 +02:00
Fabien Potencier
a114f8d227 feature #36575 [Security] Require entry_point to be configured with multiple authenticators (wouterj)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Security] Require entry_point to be configured with multiple authenticators

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

See @weaverryan's comment at https://github.com/symfony/symfony/pull/33558#discussion_r403740402:

> I have it on my list to look at the entrypoint stuff more closely. But my gut reaction is this: let's fix them (or try to... or maybe in a PR after this) :). What I mean is this:
>
> -    It's always been confusing that your firewall may have multiple auth mechanisms that have their own "entry point"... and one is chosen seemingly at random :). I know it's not random, but why does the entrypoint from `form_login` "win" over `http_basic` if I have both defined under my firewall?
>
> -    Since we're moving to a new system, why not throw an exception the _moment_ that a firewall has multiple entrypoints available to it. Then we _force_ the user to choose the _one_ entrypoint that should be used.

---

**Before** (one authenticator)
```yaml
security:
  enable_authenticator_manager: true

  firewalls:
    main:
      form_login: ...

# form login is your entry point
```

**After**
Same as before

---

**Before** (multiple authenticators)
```yaml
security:
  enable_authenticator_manager: true

  firewalls:
    main:
      http_basic: ...
      form_login: ...

# for some reason, FormLogin is now your entry point! (config order doesn't matter)
```

**After**
```yaml
security:
  enable_authenticator_manager: true

  firewalls:
    main:
      http_basic: ...
      form_login: ...
      entry_point: form_login
```

---

**Before** (custom entry point service)
```yaml
security:
  enable_authenticator_manager: true

  firewalls:
    main:
      http_basic: ...
      form_login: ...
      entry_point: App\Security\CustomEntryPoint
```

**After**
Same as before

Commits
-------

7e861698e7 [Security] Require entry_point to be configured with multiple authenticators
2020-04-30 15:22:09 +02:00
Wouter de Jong
7e861698e7 [Security] Require entry_point to be configured with multiple authenticators 2020-04-30 15:22:03 +02:00
Fabien Potencier
8022f6c4eb Fxi missing use statement 2020-04-29 22:54:16 +02:00
Nicolas Grekas
b2d1ec5d34 [DI] fix synthetic services in ResolveNoPreloadPass 2020-04-29 19:41:01 +02:00
Nicolas Grekas
856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3 2020-04-29 17:41:38 +02:00
Nicolas Grekas
6dd52f9719 [DI] limit recursivity of ResolveNoPreloadPass 2020-04-29 16:29:53 +02:00
Fabien Potencier
4fc5895266 bumped Symfony version to 5.0.9 2020-04-28 20:57:42 +02:00
Fabien Potencier
a5cc4dd077 updated VERSION for 5.0.8 2020-04-28 20:53:25 +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
c699b9cb3d Merge branch '5.0'
* 5.0:
  [Validator] fix merge
2020-04-28 20:26:40 +02:00
Nicolas Grekas
270d204750 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] fix merge
2020-04-28 20:26:18 +02:00
Nicolas Grekas
dfc4a71eac [Validator] fix merge 2020-04-28 20:23:58 +02:00
Nicolas Grekas
be8adfaf99 Merge branch '5.0'
* 5.0:
  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
  Allow invalidateTags calls to be traced by data collector
  [YAML] escape DEL(\x7f)
  fix compatibility with phpunit 9
  [Cache] skip APCu in chains when the backend is disabled
  [Mailer] Add a comment to avoid more wrong PRs on this piece of code
  [Form] apply automatically step=1 for datetime-local input
  remove getContainer overwrites in tests
  Fixing a bug where class_alias would cause incorrect items in debug:autowiring
  [DependencyInjection][ServiceSubscriber] Support late aliases
  Fix profiler nullable string type
2020-04-28 20:01:52 +02:00
Nicolas Grekas
77cdbffcb3 Merge branch '4.4' into 5.0
* 4.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
  Allow invalidateTags calls to be traced by data collector
  [YAML] escape DEL(\x7f)
  fix compatibility with phpunit 9
  [Cache] skip APCu in chains when the backend is disabled
  [Mailer] Add a comment to avoid more wrong PRs on this piece of code
  [Form] apply automatically step=1 for datetime-local input
  Fixing a bug where class_alias would cause incorrect items in debug:autowiring
  [DependencyInjection][ServiceSubscriber] Support late aliases
2020-04-28 19:58:55 +02:00