Commit Graph

30393 Commits

Author SHA1 Message Date
Fabien Potencier
33e7130d65 minor #37761 [Validator] Add missing translations for german and vietnamese (jschaedl)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Add missing translations for german and vietnamese

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT
<!--
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
-------

f4bd34a1a8 [Validator] Add missing translations for german and vietnamese
2020-08-09 10:39:00 +02:00
Jan Schädlich
f4bd34a1a8 [Validator] Add missing translations for german and vietnamese 2020-08-09 10:38:59 +02:00
Fabien Potencier
83b1d71f7f bug #37774 [Console] Make sure we pass a numeric array of arguments to call_user_func_array() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Make sure we pass a numeric array of arguments to call_user_func_array()

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

On php 8, the unit tests fail with the following error:

```
ArgumentCountError: array_merge() does not accept unknown named parameters
```

This PR should fix the issue.

Commits
-------

67102c32e6 [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
2020-08-09 10:16:57 +02:00
Fabien Potencier
5c6727211d minor #37773 Modernized deprecated PHPUnit assertion calls (derrabus)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Modernized deprecated PHPUnit assertion calls

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

Some assertions have been renamed in PHPUnit 9. PhpUnitBridge should already have polyfills in place for those methods, so it should be save to use them.

Commits
-------

ab417f7040 Modernized deprecated PHPUnit assertion calls
2020-08-09 10:13:56 +02:00
Alexander M. Turek
ab417f7040 Modernized deprecated PHPUnit assertion calls 2020-08-09 10:13:48 +02:00
Fabien Potencier
f8aa85b7e2 minor #37779 [Console] The message of "class not found" errors has changed in php 8 (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] The message of "class not found" errors has changed in php 8

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

The error message that php emits if an unknown class is accessed has changed in php 8. Two tests were failing because of this. But since those tests weren't really about missing classes, I tried to find a more resilient way to implement them.

Commits
-------

8bd861bbc6 [Console] The message of "class not found" errors has changed in php 8.
2020-08-09 10:09:51 +02:00
Alexander M. Turek
8bd861bbc6 [Console] The message of "class not found" errors has changed in php 8. 2020-08-08 21:42:49 +02:00
Alexander M. Turek
8b801c1269 The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. 2020-08-08 21:12:02 +02:00
Alexander M. Turek
67102c32e6 [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). 2020-08-08 17:34:42 +02:00
Alexander M. Turek
46e2a0c517 [String] We cannot have a "provides" function in test cases. 2020-08-08 15:51:54 +02:00
Vladyslav Startsev
32b5b9e1d7 make return type correct 2020-08-08 12:33:44 +03:00
mihail.krasilnikov
3ba8d8f135 [Notifier] added telegram options 2020-08-07 22:08:56 +03:00
Christian Flothmann
235920a388 fix mapping errors from unmapped forms 2020-08-07 15:17:26 +02:00
Fabien Potencier
5e02d86074 Fix CS 2020-08-07 10:44:47 +02:00
Fabien Potencier
7520884bc2 feature #35773 [Notifier] Change notifier recipient handling (jschaedl)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Change notifier recipient handling

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

According to @wouterj's reasoning in #35558 I did the following to merge the `AdminRecipient` with the `Recipient` class:

- introduced a `EmailRecipientInterface` with `getEmail(): string` methods
- introduced a `RecipientInterface` that is extended by `EmailRecipientInterface` and `SmsRecipientInterface`
- changed `Recipient` class which now holds an email and a phone number property and implements the `EmailRecipientInterface` and the `SmsRecipientInterface`
- changed `NoRecipient` class which now implements the `RecipientInterface`
- removed the `AdminRecipient` and fixed all related type-hints
- introduced an `EmailRecipient` and `SmsRecipient`
- changed the type-hint of the `$recipient` argument in `NotifierInterface::send()`, `Notifier::getChannels()`, `ChannelInterface::notifiy()` and `ChannelInterface::supports()` to `RecipientInterface`
- changed the type hint of the `$recipient` argument in the `as*Message()` of the  `EmailNotificationInterface` and `SmsNotificationInterface` which now uses the introduced interfaces
- changed the type hint of the `$recipient` argument in the static `fromNotification()` factory methods in `EmailMessage` and `SmsMessage` which now uses the introduced interfaces
- changed `EmailChannel` to only support recipients which implement the `EmailRecipientInterface`
- changed `SmsChannel` only supports recipients which implement the `SmsRecipientInterface`

Commits
-------

588607bdd1 [Notifier] Change notifier recipient handling
2020-08-07 10:44:01 +02:00
Jan Schädlich
588607bdd1 [Notifier] Change notifier recipient handling 2020-08-07 10:43:53 +02:00
Jérôme TAMARELLE
c4cda758b5 [Notifier] Add Google Chat bridge 2020-08-07 08:31:44 +02:00
Jérémy Derussé
080f1149a1
Reduce log verbosity for CombinedStore 2020-08-06 10:03:26 +02:00
Fabien Potencier
d66a0a76e2 feature #36692 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events (soyuka)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] add EventSourceHttpClient to consume Server-Sent Events

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

<details>
 <summary>First implementation</summary>
This patch implements the [w3c Server-Sent Events specification](https://www.w3.org/TR/eventsource/#eventsource) on top of symfony's http client. It provides an `EventSource` class that allows you to interact of server sent events.

Comparing to the Javascript implementation, we won't be able to use the same API. Indeed, in php listeners need to be setup before we connect to the HTTP stream.
I'm not fond of adding a dependency to EventDispatcher from HTTP Client, therefore I'm all ears if you have better solutions.
About event parsing, I wanted to avoid using regular expression and it uses smart data split. Note that I had to concatenate an internal buffer and only handle the data when a newline is found to cover long chunks. This is an alternative to this [react php eventsource](https://github.com/clue/reactphp-eventsource). Note that this implementation is closer to the specification in some cases that are still to be covered by tests (`retry`, `data:value` without space after colon is valid etc.).
</details>

This is an implementation of the [Server-Sent Events specification](https://html.spec.whatwg.org/multipage/server-sent-events.html) based on symfony's HTTP Client. After a few suggestions on the first implementation (see details above), I've implemented a chunk generator with this kind of API:

```php
$client = new EventSourceHttpClient($client, 10);
$source = $client->connect('GET', "http://localhost:8080/events");
while($source) {
    foreach ($client->stream($source, 2) as $r => $chunk) {
        if ($chunk->isTimeout()) {
            dump([
                'timeout' => [
                    'retry' => 1 + count($r->getInfo('previous_info') ?? [])
                ],
            ]);
            continue;
        }
        if ($chunk->isLast()) {
            dump([
                'eof' => [
                    'retries' => count($r->getInfo('previous_info') ?? [])
                ],
            ]);
            $source = null;
            return;
        }

        dump($chunk);
    }
}
```

TODO:
- [x] validate implementation (~~don't use EventDispatcher ?~~, need to be implemented as `stream` instead of `message`)
- [x] default timeout value
- [x] implement retry/reconnection
- [x] tests (do test with super long chunk, retry, bad http content-type response)
- [ ] update changelog
- [ ] document

Commits
-------

12ccca3cd4 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events
2020-08-06 08:59:15 +02:00
soyuka
12ccca3cd4 [HttpClient] add EventSourceHttpClient to consume Server-Sent Events 2020-08-06 08:59:09 +02:00
Fabien Potencier
5e2abc66c2 Fix previous merge 2020-08-06 08:17:52 +02:00
Mohammad Emran Hasan
bd4fd32121 Adds Zulip notifier bridge 2020-08-06 08:16:18 +02:00
Fabien Potencier
b968497770 bug #37748 [Notifier] Fix SentMessage implementation (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Fix SentMessage implementation

| 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       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

#36611 broke the Notifier when used with Messenger.

/cc @jeremyFreeAgent

Commits
-------

92c28de41b [Notifier] Fix SentMessage implementation
2020-08-06 07:19:29 +02:00
Fabien Potencier
9db0f20c85 feature #37747 [Notifier] Make Freemobile config more flexible (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Make Freemobile config more flexible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a<!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

As Freemobile only supports French phone numbers, let's support French numbers without the international code.

Commits
-------

4dfde6ae7c [Notifier] Make Freemobile config more flexible
2020-08-06 07:18:22 +02:00
Fabien Potencier
e43d6b3baf Merge branch '5.1'
* 5.1:
  fail properly when the required service is not defined
  Fix typo
  [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
  Update UPGRADE-5.0.md
  Added the missing reset tag to mailer.logger_message_listener
  Fix invalid option sslmode
  Updated README for the Mailer component
  fix error with custom function and web profiler routing tab
2020-08-06 07:13:39 +02:00
Fabien Potencier
ea69524de9 Merge branch '4.4' into 5.1
* 4.4:
  fail properly when the required service is not defined
  Fix typo
  [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
  Update UPGRADE-5.0.md
  Added the missing reset tag to mailer.logger_message_listener
  Updated README for the Mailer component
  fix error with custom function and web profiler routing tab
2020-08-06 07:08:30 +02:00
Fabien Potencier
92c28de41b [Notifier] Fix SentMessage implementation 2020-08-06 06:53:52 +02:00
Fabien Potencier
4dfde6ae7c [Notifier] Make Freemobile config more flexible 2020-08-06 06:52:01 +02:00
Gonzalo Vilaseca
81ca1f00a3 [HttpKernel] Provide status code in fragment handler exception 2020-08-04 11:02:58 +02:00
Fabien Potencier
995d784a0d bug #37701 [Serializer] Fix that it will never reach DOMNode (TNAJanssen)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix that it will never reach DOMNode

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

When providing the DOMNode object, the is_object check will return true. This way it will never reach the DOMNode check.

So i moved this check to above the is_object check.

Commits
-------

38787ac785 [Serializer] Fix that it will never reach DOMNode
2020-08-04 08:15:33 +02:00
Alexander Janssen
38787ac785 [Serializer] Fix that it will never reach DOMNode 2020-08-04 08:15:26 +02:00
Fabien Potencier
c0a707f0db feature #37718 [Security] class Security implements AuthorizationCheckerInterface (SimonHeimberg)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] class Security implements AuthorizationCheckerInterface

The class has the method of AuthorizationCheckerInterface already.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| 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 #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->

The class Security has the method for interface AuthorizationCheckerInterface already. By implementing the interface, Security can be passed to methods typehinted with AuthorizationCheckerInterface.

Commits
-------

cea6ebda5b [Security] class Security implements AuthorizationCheckerInterface
2020-08-04 08:13:57 +02:00
Fabien Potencier
6d2ee19b60 Fix CS 2020-08-04 08:11:14 +02:00
Fran Moreno
27bb1c499d Fix typehint phpdoc 2020-08-03 20:22:34 +02:00
Robin Chalas
63407d8201 [Console] Allow disabling auto-exit for single command apps 2020-08-03 17:23:43 +02:00
Christian Flothmann
b7d2b6042b [Validator] sync translations 2020-08-03 15:22:15 +02:00
Fabien Potencier
2ddacad477 Fix typehint 2020-08-02 10:17:48 +02:00
Fabien Potencier
681c66675e feature #37480 [Messenger] add redeliveredAt in RedeliveryStamp construct (qkdreyer)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Messenger] add redeliveredAt in RedeliveryStamp construct

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

---

this would allows one to correctly unserialize a RedeliveryStamp with a custom serializer not using the php serialize function

Commits
-------

64d26836da [Messenger] add redeliveredAt in RedeliveryStamp construct
2020-08-02 10:17:01 +02:00
Quentin Dreyer
64d26836da [Messenger] add redeliveredAt in RedeliveryStamp construct 2020-08-02 10:16:56 +02:00
Fabien Potencier
4105e935ac minor #37669 [EventDispatcher] Minor: Avoid not needed null check in dispatch() (brainexe)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[EventDispatcher] Minor: Avoid not needed null check in dispatch()

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

Just found a not needed null check in the heavyly called EventDispatcher::dispatch() method - the $eventName get's always a string now - no null anymore, as it gets the class name instead.

Commits
-------

0d36c11f28 [EventDispatcher] Avoid not needed null check in dispatch()
2020-08-02 10:13:42 +02:00
Fabien Potencier
f76ac74b20 feature #37565 [Validator] Add Isin validator constraint (lmasforne)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Validator] Add Isin validator constraint

Co-Authored-By: Yannis Foucher <33806646+YaFou@users.noreply.github.com>

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

Rebase of https://github.com/symfony/symfony/pull/36368

I asked him by mail and he didn't have time to finish the PR and allowed me to do it.

Commits
-------

8e1ffc8b99 Feature #36362 add Isin validator constraint
2020-08-02 10:06:13 +02:00
Vitaliy Ryaboy
eea41d9655 [Lock] downgrade log.info to log.debug 2020-08-02 09:57:41 +02:00
Laurent Masforné
8e1ffc8b99 Feature #36362 add Isin validator constraint
Feature #36362 typo

Fix PR feedbacks

Fix coding standard

ticket 36362 fix PR feedbacks

Update src/Symfony/Component/Validator/Constraints/IsinValidator.php

Co-Authored-By: Yannis Foucher <33806646+YaFou@users.noreply.github.com>
2020-08-01 14:37:35 +02:00
Simon Heimberg
cea6ebda5b [Security] class Security implements AuthorizationCheckerInterface
The class has the method of AuthorizationCheckerInterface already.
2020-07-31 19:01:17 +02:00
Fabien Potencier
b61fa4480b bug #37671 [Cache] fix saving no-expiry items with ArrayAdapter (philipp-kolesnikov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix saving no-expiry items with ArrayAdapter

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

0 is a special value that means "infinity".

Commits
-------

bdec105a72 [Cache] Fix #37667
2020-07-31 09:57:22 +02:00
Fabien Potencier
de39dbae8f Fix previous merge 2020-07-31 09:51:09 +02:00
marie
859b692240 [Console] add console.signal event 2020-07-31 09:49:38 +02:00
Fabien Potencier
b8529a03a6 Fix CHANGELOG 2020-07-31 09:45:25 +02:00
Jules Pietri
f4679ef08a [Validator] Added support for cascade validation on typed properties 2020-07-31 09:44:26 +02:00
Fabien Potencier
f1dc422394 feature #37243 [DependencyInjection] Resolve parameters in tag arguments (rpkamp)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[DependencyInjection] Resolve parameters in tag arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35337
| License       | MIT
| Doc PR        | None, yet, will follow if this is accepted

Arguably this could be a BC break if people are actively relying on parameters not being resolved in tag parameters, although I can't come up with a sensible use case for that scenario.

Commits
-------

3dba1fe7bf [DependencyInjection] Resolve parameters in tag arguments
2020-07-31 09:38:46 +02:00
Remon van de Kamp
3dba1fe7bf [DependencyInjection] Resolve parameters in tag arguments 2020-07-31 09:38:40 +02:00
Fabien Potencier
7aaf99d9f2 feature #37415 [Console] added info method to symfony style (titospeakap, titomiguelcosta)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] added info method to symfony style

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

It would be nice to have an info method as part of the SymfonyStyle class. This would prevent having to use the \<INFO\> tag, and it is consistent with other methods like warning and error (similar to the types available in monolog)

Commits
-------

4cf1a1e8e6 fixed docblock
204cd739d3 added info method to symfony style
2020-07-31 09:37:19 +02:00
Fabien Potencier
5256323bbb feature #36929 Added a FrenchInflector for the String component (Alexandre-T)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Added a FrenchInflector for the String component

I read in [this blog post](https://symfony.com/blog/new-in-symfony-5-1-deprecated-the-inflector-component) this sentence

> Symfony Inflector component converts words between their singular and plural forms (**for now, only in English**)

So I created a FrenchInflector class implementing the InflectorInterface from the String component. This inflector uses regular expressions and it is tested in the FrenchInflectorTest with a lot of the french exceptions.

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

Changelog has been updated, but I'm not sure I did it in the good paragraph.

I don't know if I should update the symfony/symfony-docs, but I have created an example and I could create a PR with it, if you want.

```php
<?php

use Symfony\Component\String\Inflector\FrenchInflector;

$inflector = new FrenchInflector();

$result = $inflector->singularize('dents');     // ['dent']
$result = $inflector->singularize('souris');    // ['souris']
$result = $inflector->singularize('messieurs'); // ['monsieur']

$result = $inflector->pluralize('cinquante'); // ['cinquante']
$result = $inflector->pluralize('pou');       // ['poux']
$result = $inflector->pluralize('cheval');    // ['chevaux']
```

**fabbot.io** is detecting a typo, but this is not. The patch done by fabpot suggests to replace the french 'embarras' word by 'embarrass'. I shall not remove or replace it, because "embarras" is an invariant word.

Commits
-------

d903d9a757 Added a FrenchInflector for the String component French inflector implements InflectorInterface, it uses regexp and it is tested in the FrenchInflectorTest
2020-07-31 09:11:18 +02:00
Fabien Potencier
281a7522dc minor #37538 Add the name of the env to RuntimeException (Simon Frost)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Add the name of the env to RuntimeException

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

if you have the name of the env in the exception message it is much easier to find the error

from -> https://github.com/symfony/dependency-injection/pull/20

Commits
-------

00ab757cbb Add the name of the env to RuntimeException
2020-07-31 08:57:38 +02:00
Simon Frost
00ab757cbb Add the name of the env to RuntimeException 2020-07-31 08:57:33 +02:00
Fabien Potencier
4c40ff8392 Fix typo 2020-07-31 08:55:54 +02:00
Fabien Potencier
203ed71ec1 minor #37542 [Mailer] Updated README for the Mailer component (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Updated README for the Mailer component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#13945

I think it's worth adding a second example showcasing the twig integration for 2 reasons:

* If you're used to use this component in the framework, I think it's likely you want Twig integration in standalone apps.
* The integration actually lives in `symfony/twig-bridge`, it won't be very easy to catch while reading the component code - unless you're very comfortable with the Symfony architecture.

Commits
-------

696560c690 Updated README for the Mailer component
2020-07-31 08:54:29 +02:00
Fabien Potencier
bea431935f bug #37560 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account (Jeroeny)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account

| Q             | A
| ------------- | ---
| Branch?       |  4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/37424
| License       | MIT

The new regex is made per positive `.gitignore` line. Which is a match group followed by a negative lookbehind with all the negations that were on lines after that line. This also fixes some other bugs that didn't match the `.gitignore` spec and two incorrect tests. I think it's likely that there are more edge cases this PR may not cover, but I haven't found them yet.

See the issue for more info.

Commits
-------

609dcf6b08 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account
2020-07-31 08:51:39 +02:00
Jeroeny
609dcf6b08 [Finder] Fix GitIgnore parser when dealing with (sub)directories and take order of lines into account 2020-07-31 08:51:32 +02:00
Fabien Potencier
374d70568c feature #37620 [Security] Use NullToken while checking authorization (wouterj)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Use NullToken while checking authorization

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

This allows voters to grant access to unauthenticated users. E.g. some objects can be viewed by anyone, in this case the voter has to be able to grant access to unauthenticated users.

This *does break* the interface PHPdoc of `TokenInterface`: `getUser()` returns `null` instead of `string|UserInterface`. This is only true when using the new system, so not a real BC break. I think the only thing we can do to "guide" users is to add some custom handling for type errors related to `null` and `UserInterface` methods ("Did you forgot to check for `null` in the Voter?"). Is this something I should add to this PR?

Commits
-------

e37091541c Use NullToken while checking authorization
2020-07-31 08:44:47 +02:00
Fabien Potencier
bd591057e4 feature #37711 [Router] allow to use \A and \z as regex start and end (zlodes)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Router] allow to use \A and \z as regex start and end

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | —
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Some people are using `\A` and `\z` as alternative for `^` and `$` for route requirements.

E.g.: UUID pattern in ramsey/uuid (many routes broke after updating the lib):
569e93ac4e (diff-23c8536f7d61e7d839fd1c93ce0dd354L30-R31)

References:
https://www.rexegg.com/regex-anchors.html#A
https://www.rexegg.com/regex-anchors.html#z

P.S.: It is my first PR into Symfony. Maybe I should fix something, just let me know.

Commits
-------

f752eeeaa6 [Router] allow to use \A and \z as regex start and end
2020-07-31 08:30:16 +02:00
Zlatoslav Desyatnikov
f752eeeaa6 [Router] allow to use \A and \z as regex start and end 2020-07-31 08:30:09 +02:00
Fabien Potencier
bfc0351da6 bug #37654 [Messenger] Fix invalid option sslmode in AmazonSqs bridge (jderusse)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Fix invalid option sslmode in AmazonSqs bridge

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

The sslmode option allows people to use AmazonSqs with non-offical endpoint like the [asyncaws/testing-sqs](https://hub.docker.com/r/asyncaws/testing-sqs) docker image

By fixing precedence of DNS options in https://github.com/symfony/symfony/pull/37269 I introduced a bug that trigger an exception `Unknown option found: [sslmode]`. I apologize for this

This PR adds `sslmode` in list of allowed options

Commits
-------

afbd51b368 Fix invalid option sslmode
2020-07-31 08:25:05 +02:00
Fabien Potencier
13a5e47b97 feature #37703 Update StopwatchPeriod.php (ThomasLandauer)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Update StopwatchPeriod.php

Adding `__toString()`, analogous to [`StopwatchEvent`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Stopwatch/StopwatchEvent.php#L242)

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

Commits
-------

d3c2911f46 Update StopwatchPeriod.php
2020-07-31 08:22:10 +02:00
Thomas Landauer
d3c2911f46 Update StopwatchPeriod.php 2020-07-31 08:22:04 +02:00
Fabien Potencier
e411c96718 feature #37696 [Routing] Allow inline definition of requirements and defaults for host (julienfalque)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Routing] Allow inline definition of requirements and defaults for host

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14007

This PR extends the support of inline routing requirements and defaults to the host part, which can also contain parameters.

Commits
-------

1501476d52 [Routing] Allow inline definition of requirements and defaults for host
2020-07-30 10:44:46 +02:00
Julien Falque
1501476d52
[Routing] Allow inline definition of requirements and defaults for host 2020-07-29 18:19:41 +02:00
Laurent VOULLEMIER
cef16f591f [VarDumper] Improve previous fix on light array coloration 2020-07-29 17:09:23 +02:00
Nicolas Grekas
e983035e1a Merge branch '5.1'
* 5.1:
  reduce column length for MySQL 5.6 compatibility
  Minor improvement
  Removed redundant strtolower in ConsumeMessagesCommand
  getContainer cannot return null anymore
  HttpClient profiler error
  Fix RedisStore constructor signature
  Bump Symfony version to 5.1.4
  Update VERSION for 5.1.3
  Update CHANGELOG for 5.1.3
  Bump Symfony version to 4.4.12
  Update VERSION for 4.4.11
  Update CHANGELOG for 4.4.11
  Bump Symfony version to 3.4.44
  updated VERSION for 3.4.43
  update CONTRIBUTORS for 3.4.43
  updated CHANGELOG for 3.4.43
  Fix author for class CachePoolClearerCacheWarmer
2020-07-29 16:54:40 +02:00
Nicolas Grekas
ffa50acd3a Merge branch '4.4' into 5.1
* 4.4:
  reduce column length for MySQL 5.6 compatibility
  Minor improvement
  Removed redundant strtolower in ConsumeMessagesCommand
  Fix RedisStore constructor signature
  Bump Symfony version to 4.4.12
  Update VERSION for 4.4.11
  Update CHANGELOG for 4.4.11
  Bump Symfony version to 3.4.44
  updated VERSION for 3.4.43
  update CONTRIBUTORS for 3.4.43
  updated CHANGELOG for 3.4.43
2020-07-29 16:51:18 +02:00
Christian Flothmann
bc5f35c609 reduce column length for MySQL 5.6 compatibility 2020-07-29 10:26:17 +02:00
Valentin Udaltsov
e288834cda
Removed redundant strtolower in ConsumeMessagesCommand 2020-07-29 04:50:45 +03:00
Anatoly Pashin
6831271feb
Fix RedisStore constructor signature
This is a fix for a regression from #37590
2020-07-27 11:39:16 +10:00
Philipp Kolesnikov
bdec105a72 [Cache] Fix #37667 2020-07-26 15:13:16 +10:00
Matthias Dötsch
0d36c11f28 [EventDispatcher] Avoid not needed null check in dispatch() 2020-07-25 23:01:31 +02:00
Jérémy Derussé
afbd51b368
Fix invalid option sslmode 2020-07-24 13:53:49 +02:00
Fabien Potencier
fd6181c8b5 Bump Symfony version to 5.1.4 2020-07-24 06:28:10 +02:00
Fabien Potencier
b1ce16147c Update VERSION for 5.1.3 2020-07-24 06:22:56 +02:00
Fabien Potencier
f3cfae8ea7 Bump Symfony version to 4.4.12 2020-07-24 06:14:13 +02:00
Fabien Potencier
3cfbf521a4 Update VERSION for 4.4.11 2020-07-24 06:10:09 +02:00
Fabien Potencier
81fadc9cc1 Bump Symfony version to 3.4.44 2020-07-24 06:07:51 +02:00
Fabien Potencier
5012c9237f updated VERSION for 3.4.43 2020-07-24 05:48:59 +02:00
Nicolas Grekas
0ab5eeddf9 Merge branch '5.1'
* 5.1:
  Allows RedisClusterProxy instance in Lock RedisStore
2020-07-23 19:22:39 +02:00
Nicolas Grekas
ef1566e999 Merge branch '5.0' into 5.1
* 5.0:
  Allows RedisClusterProxy instance in Lock RedisStore
2020-07-23 19:22:30 +02:00
Nicolas Grekas
9f67dd8a7c Merge branch '4.4' into 5.0
* 4.4:
  Allows RedisClusterProxy instance in Lock RedisStore
2020-07-23 19:20:42 +02:00
Nicolas Grekas
0eae7a6578 bug #37590 Allows RedisClusterProxy instance in Lock RedisStore (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

Allows RedisClusterProxy instance in Lock RedisStore

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

This PR allow clients instance of RedisClusterProxy created by the StoreFactory in #28691 /cc @nicolas-grekas

Commits
-------

8ef63cd6bc Allows RedisClusterProxy instance in Lock RedisStore
2020-07-23 19:20:20 +02:00
Nicolas Grekas
36933f2962 minor #37638 [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest (brentybh)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest

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

Issues in the test:
1. `TransportExceptionInterface` is not `use`d (imported)
2. The catch block will not be executed (even the above 1 is fixed) because
the exception (of `chunked-broken`) will be thrown only when `getContent()` is called
The header is OK, status is 200, and we only asserted `getStatusCode()`
So this test made no sense.

Commits
-------

585536a688 [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest
2020-07-23 19:01:53 +02:00
Bohan Yang
585536a688 [HttpClient] Fix bad testRetryTransportError in AsyncDecoratorTraitTest 2020-07-23 19:01:21 +02:00
Nicolas Grekas
91487707db Merge branch '5.1'
* 5.1:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:56:54 +02:00
Nicolas Grekas
20cf5df00b Merge branch '5.0' into 5.1
* 5.0:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:55:47 +02:00
Nicolas Grekas
081ad138f7 Merge branch '4.4' into 5.0
* 4.4:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:54:02 +02:00
Alexander M. Turek
cd22fe6c92 Allow doctrine/persistence 2 2020-07-23 18:49:41 +02:00
Jérémy Derussé
f524c85161
Fix Redis tests 2020-07-23 14:42:41 +02:00
Jérémy Derussé
8ef63cd6bc
Allows RedisClusterProxy instance in Lock RedisStore 2020-07-23 13:31:42 +02:00
Nicolas Grekas
e213cc76eb Merge branch '5.1'
* 5.1:
  [Messenger] fix computing the id of same-name middleware
2020-07-23 12:40:28 +02:00
Nicolas Grekas
ea258254d0 Merge branch '5.0' into 5.1
* 5.0:
  [Messenger] fix computing the id of same-name middleware
2020-07-23 12:40:24 +02:00
Nicolas Grekas
da30c7a4e8 Merge branch '4.4' into 5.0
* 4.4:
  [Messenger] fix computing the id of same-name middleware
2020-07-23 12:40:15 +02:00
Nicolas Grekas
b7c6d20181 [Messenger] fix computing the id of same-name middleware 2020-07-23 12:40:00 +02:00
Nicolas Grekas
ec38464335 Merge branch '5.1'
* 5.1:
  Connect to RedisCluster with password auth
  Fix PHPUnit 8.5 deprecations.
  Fix EmailHeaderSame to make use of decoded value
  Allow same middleware to be used multiple times with different arguments
2020-07-23 12:04:35 +02:00
Nicolas Grekas
62dbb9a39a Merge branch '5.0' into 5.1
* 5.0:
  Connect to RedisCluster with password auth
  Fix PHPUnit 8.5 deprecations.
  Fix EmailHeaderSame to make use of decoded value
  Allow same middleware to be used multiple times with different arguments
2020-07-23 12:04:31 +02:00
Nicolas Grekas
7373802d04 Merge branch '4.4' into 5.0
* 4.4:
  Connect to RedisCluster with password auth
  Fix PHPUnit 8.5 deprecations.
  Fix EmailHeaderSame to make use of decoded value
  Allow same middleware to be used multiple times with different arguments
2020-07-23 12:04:24 +02:00
Nicolas Grekas
df1a1ff069 bug #37583 [Mime] Fix EmailHeaderSame to make use of decoded value (evertharmeling)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fix EmailHeaderSame to make use of decoded value

Fixes #35062

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

Commits
-------

8a3f50746d Fix EmailHeaderSame to make use of decoded value
2020-07-23 11:59:39 +02:00
Nicolas Grekas
0d867bcc0d bug #37569 [Messenger] Allow same middleware to be used multiple times with different arguments (HypeMC)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Allow same middleware to be used multiple times with different arguments

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

Middleware service names now take into account arguments as well to allow the same middleware to be used multiple times with different arguments:
```yaml
framework:
    messenger:
        buses:
            messenger.bus.default:
                middleware:
                    - doctrine_ping_connection: ['main']
                    - doctrine_ping_connection: ['logs']
```

Commits
-------

d10e43d085 Allow same middleware to be used multiple times with different arguments
2020-07-23 11:57:42 +02:00
Michal Forbak
e873ddd72c Connect to RedisCluster with password auth
Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example) https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails

```
RedisAdapter::createConnection(
    'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'
);
```

See RedisCluster usage here https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#declaring-a-cluster-with-an-array-of-seeds
2020-07-23 11:54:41 +02:00
Nicolas Grekas
c971a27f9e Merge branch '3.4' into 4.4
* 3.4:
  Fix PHPUnit 8.5 deprecations.
2020-07-23 11:48:09 +02:00
Alexander M. Turek
ec525e6e04 Fix PHPUnit 8.5 deprecations. 2020-07-23 11:37:51 +02:00
Nicolas Grekas
b72e9c28da Merge branch '5.1'
* 5.1:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Removed @internal from Composite
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Messenger] fix ignore account & endpoint options amazon sqs connection
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:44 +02:00
Nicolas Grekas
1b7714a05c Merge branch '5.0' into 5.1
* 5.0:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:24 +02:00
Nicolas Grekas
5d79383028 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:09 +02:00
Nicolas Grekas
8103b307c8 fix merge 2020-07-23 10:35:20 +02:00
Nicolas Grekas
50505cb9d2 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [SCA] Minor fixes on tests
2020-07-23 10:31:43 +02:00
Nicolas Grekas
ee6b5145bf [Cache] fix catching auth errors 2020-07-23 10:10:45 +02:00
Fabien Potencier
6b92038e1c bug #37629 [Messenger] fix ignored account & endpoint options amazon sqs connection (surikman)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] fix ignored account & endpoint options amazon sqs connection

| Q             | A
| ------------- | ---
| Branch?       | 5.1<!-- see below -->
| 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 #37598   <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
<!--
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
-------

fc90a3b7c6 [Messenger] fix ignore account & endpoint options amazon sqs connection
2020-07-23 08:50:17 +02:00
vudaltsov
8958ce12a1 Removed @internal from Composite 2020-07-23 08:35:25 +02:00
Evert Harmeling
8a3f50746d
Fix EmailHeaderSame to make use of decoded value
Fixes #35062
2020-07-22 14:10:07 +02:00
Juraj Surman
fc90a3b7c6 [Messenger] fix ignore account & endpoint options amazon sqs connection 2020-07-21 17:23:14 +02:00
Jeroen Noten
324ad95fee [Serializer] Support multiple levels of discriminator mapping 2020-07-21 17:17:25 +02:00
Wouter de Jong
e37091541c Use NullToken while checking authorization
This allows to e.g. have some objects that can be viewed by anyone (even unauthenticated users).
2020-07-20 21:46:53 +02:00
Fabien Potencier
8a7c776b92 Merge branch '5.1'
* 5.1:
  [Mailer] Fix failover transport
2020-07-20 18:31:06 +02:00
Fabien Potencier
8b673f5a81 [Mailer] Fix failover transport 2020-07-20 16:15:11 +02:00
Arek Bochinski
e9f7769111 Use hexadecimal numerals instead of hexadecimals in strings to represent error codes. 2020-07-20 09:00:36 +02:00
Thomas Calvet
b352ff08ad [SCA] Minor fixes on tests 2020-07-16 11:41:49 +02:00
efelo
715c793070 [HttpKernel] added password hiding in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content

[HttpKernel] added password hiding in request data collector raw content

The password was already hidden in POST parameters, but still remained visible in raw content

[HttpKernel] added password hiding in request data collector raw content

The password was already hidden in POST parameters, but still remained visible in raw content
2020-07-15 14:56:16 +02:00
Fabien Potencier
8308861b70 bug #36888 [Mailer] Fix mandrill raw http request setting from email/name (JohJohan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix mandrill raw http request setting from email/name

| Q             | A
| ------------- | ---
| Branch?       | 4.4, 5.0, 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36879
| License       | MIT
| Doc PR        | None

As describe in https://github.com/symfony/symfony/issues/36879 there is a bug in sending raw http request to mandrill it will not set from email/name correct.

As you can see i make sure to set `from_email` and `from_name` correct now and changed the unit test to check correct you can see the doc that the format is correct https://mandrillapp.com/api/docs/messages.curl.html#method-send-raw

Commits
-------

6128dd0b75 ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-15 14:27:58 +02:00
Fabien Potencier
a4550dac6a feature #37479 [HttpFoundation] Added File::getContent() (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] Added File::getContent()

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

---

This is a very simple PR but I think it increases the DX when working
with uploaded files: I looked at for this method and I did not found it.
So I had to check witch method returns the "pathname" or to remember I
can cast the object to string to get its pathname.

It's a small detail, but IMHO it's better with it.

About file_get_contents vs stream: let's be simple here. If one want a
stream, they can use the code they always used for it :)

Commits
-------

50d5167a66 [HttpFoundation] Added File::getContent()
2020-07-15 14:24:15 +02:00
Fabien Potencier
fd13f5f8e9 bug #37527 [Mailer] Fix reply-to functionality in the SendgridApiTransport (jt2k)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix reply-to functionality in the SendgridApiTransport

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

When sending a message using the `SendgridApiTransport`, the reply-to address was being ignored. In other transports, the reply to can be set using headers, but SendGrid requires that certain fields be added explicitly to the API payload. This is already handled for From, To, Cc, Bcc, and Subject, but was not handled for Reply-To. This change extracts the reply to address from the `Email` object and adds it to the payload.

Note that the `Email` object allows for multiple Reply-To addresses, but SendGrid only supports a single one, so I am just using the first element of the array.

I also fixed a link in a comment to SendGrid's documentation explaining the reserved headers that are not allowed.

Commits
-------

2cf25d1055 [Mailer] Fix reply-to functionality in the SendgridApiTransport
2020-07-15 14:22:44 +02:00
Jason Tan
2cf25d1055 [Mailer] Fix reply-to functionality in the SendgridApiTransport 2020-07-15 14:22:36 +02:00
Fabien Potencier
f617380af5 bug #37581 [Mime] Fix compat with HTTP requests (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fix compat with HTTP requests

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| 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 #37500, Fix #36738, Fix #35443
| License       | MIT
| Doc PR        | n/a

Commits
-------

52e7d7cf17 [Mime] Fix compat with HTTP requests
2020-07-15 14:00:31 +02:00
Fabien Potencier
502d6fba75 Merge branch '5.1'
* 5.1:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:59:44 +02:00
Fabien Potencier
28e072a8ec Merge branch '5.0' into 5.1
* 5.0:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:53:22 +02:00
Fabien Potencier
ba1b05e1b6 Merge branch '4.4' into 5.0
* 4.4:
  [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values
  [Mime] Keep Sender full address when used by non-SMTP transports
  Update MimeTypes.php
2020-07-15 12:53:08 +02:00
Fabien Potencier
b34abaff98 bug #37580 [Mime] Keep Sender full address when used by non-SMTP transports (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Keep Sender full address when used by non-SMTP transports

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

refs #36178

The `Envelope` is an SMTP concept. The Sender is used in the `MAIL FROM` SMTP command, where only an address is supported. But we are also supporting non-SMTP transports, where the Sender might also be used as the `From` header, where a full mailbox is supported.

To take into account the 2 usages, this PR keeps the full mailbox in the Envelope and let the SMTP class only use the address (which was already the case anyway).

Commits
-------

1ca9be77aa [Mime] Keep Sender full address when used by non-SMTP transports
2020-07-15 12:52:19 +02:00
Fabien Potencier
52e7d7cf17 [Mime] Fix compat with HTTP requests 2020-07-15 12:07:33 +02:00
Nicolas Grekas
5a61446c3c minor #37422 [Mime] switching source of mime types from Apache to "MIME-db" (Daniel González)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Mime] switching source of mime types from Apache to "MIME-db"

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

Commits
-------

ebea452f57 [Mime] switching source of mime types from Apache to "MIME-db"
2020-07-15 10:28:50 +02:00
Daniel González
ebea452f57 [Mime] switching source of mime types from Apache to "MIME-db" 2020-07-15 10:28:42 +02:00
Thomas Calvet
3d754ad688 [DependencyInjection][Config] Use several placeholder unique prefixes for dynamic placeholder values 2020-07-15 10:27:46 +02:00
Fabien Potencier
1ca9be77aa [Mime] Keep Sender full address when used by non-SMTP transports 2020-07-15 08:28:59 +02:00
jersoe
f6b71cfa97 Update MimeTypes.php
Typo in exception message on line 140.
2020-07-14 10:23:12 +02:00
HypeMC
d10e43d085 Allow same middleware to be used multiple times with different arguments 2020-07-13 20:19:17 +02:00
Nicolas Grekas
ba4d57bb5f Merge branch '5.1'
* 5.1:
  [Cache] fix merge
2020-07-13 11:17:24 +02:00
Nicolas Grekas
85da081614 [Cache] fix merge 2020-07-13 11:17:19 +02:00
Nicolas Grekas
d8338dc358 minor #36799 Remove some magic from TypeValidator logic and OptionsResolver type verify logic (drealecs)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Remove some magic from TypeValidator logic and OptionsResolver type verify logic

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

Following discussion on https://twitter.com/Ocramius/status/1260236117129015297
The changes in this PR could ensure that types that can be verified by the TypeValidator is limited and there is no way to magically use it.
For example you can break it by defining you own function like:
```php
function is_usercollection {
    return true;
}
```
that will validate any value that have the validator type as 'UserCollection'.

Another example would be defining `is_lower` or `ctype_int` that would also break the implementation.

Commits
-------

e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic
2020-07-13 11:15:52 +02:00
Alexandru Patranescu
e8c9049a5a Remove some magic from TypeValidator logic and OptionsResolver type verify logic 2020-07-13 11:15:37 +02:00
Nicolas Grekas
ef19a03b2b Merge branch '5.1'
* 5.1:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:15 +02:00
Nicolas Grekas
c87847c361 Merge branch '5.0' into 5.1
* 5.0:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:00 +02:00
Nicolas Grekas
afd9760357 Merge branch '4.4' into 5.0
* 4.4:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:51:51 +02:00
Nicolas Grekas
701161eb40 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] Use the default expiry when saving (not when creating) items
2020-07-12 14:49:36 +02:00
Nicolas Grekas
a397c490b0 bug #37562 [Cache] Use the default expiry when saving (not when creating) items (philipp-kolesnikov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Use the default expiry when saving (not when creating) items

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

This PR is for align expiration handling in ChainAdapter with ChainCache as proposed in #37263.

Commits
-------

49e9f3229c [Cache] Use the default expiry when saving (not when creating) items
2020-07-12 14:39:01 +02:00
Philipp Kolesnikov
49e9f3229c [Cache] Use the default expiry when saving (not when creating) items 2020-07-12 14:37:39 +02:00
Nicolas Grekas
c4e47fdd65 Merge branch '3.4' into 4.4
* 3.4:
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  add vietnamese translation for html5 color validation
2020-07-12 12:34:29 +02:00
Nicolas Grekas
4273aedfae Fix DBAL deprecation 2020-07-12 12:21:23 +02:00
Nicolas Grekas
a56f6482a5 bug #37521 [Form] Fix ChoiceType translation domain (VincentLanglet)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Form] Fix ChoiceType translation domain

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

When using
```
->add('foo', ChoiceType::class, [
    'label'       => 'label',
    'translation_domain' => false,
    'choices'     => [
        'choice.no'  => false,
        'choice.yes' => true,
    ],
    'choice_translation_domain' => 'messages',
    'expanded'    => true,
    'required'    => false,
    'placeholder' => false,
]);
```

I discovered that the choices was not translated.

Seems like it's because the subForm is using the `translation_domain` instead of the `choice_translation_domain`.

Commits
-------

2effda79ea [Form] Fix ChoiceType translation domain
2020-07-12 11:52:47 +02:00
Vincent Langlet
2effda79ea [Form] Fix ChoiceType translation domain 2020-07-12 11:52:40 +02:00
Nicolas Grekas
a10ff4cb00 bug #37550 [OptionsResolver] Fix force prepend normalizer (hason)
This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Fix force prepend normalizer

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

Commits
-------

6eb836b6f9 [OptionsResolver] Fix force prepend normalizer
2020-07-12 11:44:05 +02:00
Nicolas Grekas
ae91683ba4 minor #37552 [Form] sync translations from master (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] sync translations from master

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

Commits
-------

acea9be6d3 sync translations from master
2020-07-12 11:42:44 +02:00
Nicolas Grekas
d705b21def minor #37555 Add Tagalog translations for new form messages (ocrampete16)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Add Tagalog translations for new form messages

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

This PR adds Tagalog translations for the new form messages @xabbuh added in https://github.com/symfony/symfony/pull/37552.

~~As I'm not aware of any Filipinos that regularly review Symfony pull requests, I'm going to ask my mother to proof-read this first before I remove the "WIP" label from the title. :)~~

Commits
-------

1809b7c5eb Add Tagalog translations for new form messages
2020-07-12 11:42:01 +02:00
Marco Petersen
1809b7c5eb Add Tagalog translations for new form messages 2020-07-12 11:41:55 +02:00
Jan Schädlich
68e2b34a9f [Form] Add missing vietnamese translations 2020-07-12 11:41:09 +02:00
Fabien Potencier
63f8827cf0 feature #36178 [Mime] allow non-ASCII characters in local part of email (dmaicher)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Mime] allow non-ASCII characters in local part of email

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/34932
| License       | MIT
| Doc PR        | -

This fixes https://github.com/symfony/symfony/issues/34932 by allowing non-ASCII characters in the local part of emails.

I tried this using 3 different smtp servers (gmail, mailgun and local postfix) and for me this just works in case there are non-ASCII characters in the local part of emails. Emails are correctly delivered.

PHPMailer does this in the same way: https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L1411

This is also in line with the behavior of Swiftmailer (< 6.1) **before** this commit that introduced the `IdnAddressEncoder`: 6a87efd39b (diff-e5f85d26733017e183b2633ae3c433f0R31)

I'm not an expert when it comes to SMTP and all the different RFCs out there 😕 But for me this exception seems not needed.

Maybe @c960657 can help here?

Commits
-------

d057dffcd6 [Mime] allow non-ASCII characters in local part of email
2020-07-10 18:20:57 +02:00
Christian Flothmann
acea9be6d3 sync translations from master 2020-07-10 16:23:16 +02:00
Hidde Wieringa
8728927a22 Improve invalid messages for form types 2020-07-10 11:35:53 +02:00
Martin Hasoň
6eb836b6f9 [OptionsResolver] Fix force prepend normalizer 2020-07-10 11:12:14 +02:00
Christian Flothmann
44226b378a Merge branch '5.1'
* 5.1:
  fix PropertyAccess version constraints
2020-07-10 10:14:54 +02:00
Christian Flothmann
5a84bae822 Merge branch '5.0' into 5.1
* 5.0:
  fix PropertyAccess version constraints
2020-07-10 10:14:24 +02:00
Christian Flothmann
16b5e8a203 Merge branch '4.4' into 5.0
* 4.4:
  fix PropertyAccess version constraints
2020-07-10 10:13:40 +02:00
Christian Flothmann
6fa19242ed fix PropertyAccess version constraints 2020-07-10 10:02:08 +02:00
Jan Schädlich
89314b5992 add vietnamese translation for html5 color validation 2020-07-10 08:36:00 +02:00
Carlos Pereira De Amorim
bfe07dda83 Added Context to Workflow Event
There's also a default context for the initial marking event.
2020-07-10 00:08:44 +02:00
Nicolas Grekas
be81e3d513 Merge branch '5.1'
* 5.1:
  cs fix
  add german translation of the html5 color validation
  Fix PHP 8 deprecations
  ensure compatibility with PHP 8 stack traces
  clean up HHVM instructions
  sync translations from master branch
  silently ignore uninitialized properties when mapping data to forms
2020-07-09 18:48:43 +02:00
Nicolas Grekas
8ecd0c9040 Merge branch '5.0' into 5.1
* 5.0:
  cs fix
  add german translation of the html5 color validation
  Fix PHP 8 deprecations
  ensure compatibility with PHP 8 stack traces
  clean up HHVM instructions
  sync translations from master branch
  silently ignore uninitialized properties when mapping data to forms
2020-07-09 18:47:40 +02:00
Nicolas Grekas
6e59119f81 Merge branch '4.4' into 5.0
* 4.4:
  cs fix
  add german translation of the html5 color validation
  Fix PHP 8 deprecations
  ensure compatibility with PHP 8 stack traces
  clean up HHVM instructions
  sync translations from master branch
  silently ignore uninitialized properties when mapping data to forms
2020-07-09 18:47:28 +02:00
Nicolas Grekas
ecb5f7c875 Merge branch '3.4' into 4.4
* 3.4:
  cs fix
  add german translation of the html5 color validation
  sync translations from master branch
  silently ignore uninitialized properties when mapping data to forms
2020-07-09 18:43:26 +02:00
Nicolas Grekas
6bfdb92736 bug #37520 [Form] silently ignore uninitialized properties when mapping data to forms (ph-fritsche)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] silently ignore uninitialized properties when mapping data to forms

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

Commits
-------

b4616c810c silently ignore uninitialized properties when mapping data to forms
2020-07-09 18:41:59 +02:00
Nicolas Grekas
87e28f77b9 minor #37524 [Form] sync translations from master branch (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] sync translations from master branch

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

Commits
-------

d962202c5f sync translations from master branch
2020-07-09 18:41:07 +02:00
Wouter de Jong
696560c690 Updated README for the Mailer component 2020-07-09 18:20:35 +02:00
Ahmad El-Bardan
f41c03b8aa add german translation of the html5 color validation 2020-07-09 10:22:35 +02:00
Nicolas Grekas
07c11399ae Merge branch '3.4' into 4.4
* 3.4:
  Fix PHP 8 deprecations
  ensure compatibility with PHP 8 stack traces
2020-07-08 19:09:45 +02:00
Nicolas Grekas
3db0684037 Fix PHP 8 deprecations 2020-07-08 19:07:26 +02:00
Christian Flothmann
8ba34dafd3 ensure compatibility with PHP 8 stack traces 2020-07-08 18:57:10 +02:00
Christian Flothmann
d962202c5f sync translations from master branch 2020-07-08 15:48:29 +02:00
Philipp Fritsche
b4616c810c silently ignore uninitialized properties when mapping data to forms 2020-07-08 12:40:29 +02:00
Nicolas Grekas
2c43183f2c Merge branch '5.1'
* 5.1:
  [String] Added a help message when translation-contracts is not installed
  Add: ExcludeList usage for PHPUnit 9.4
  [Cache] Fix compat wth DBAL v3
  [String] throw when Alpine is used and translit fails
2020-07-08 10:28:10 +02:00
Nicolas Grekas
f07b187e6e Merge branch '5.0' into 5.1
* 5.0:
  [String] Added a help message when translation-contracts is not installed
  Add: ExcludeList usage for PHPUnit 9.4
  [Cache] Fix compat wth DBAL v3
  [String] throw when Alpine is used and translit fails
2020-07-08 10:27:49 +02:00
Grégoire Pineau
904fb1ae21 [String] Added a help message when translation-contracts is not installed 2020-07-08 10:26:26 +02:00
Nicolas Grekas
e8fb0d133e Merge branch '4.4' into 5.0
* 4.4:
  Add: ExcludeList usage for PHPUnit 9.4
  [Cache] Fix compat wth DBAL v3
2020-07-08 10:06:16 +02:00
Nicolas Grekas
ddf795390a Merge branch '3.4' into 4.4
* 3.4:
  [Cache] Fix compat wth DBAL v3
2020-07-08 10:03:32 +02:00
Nicolas Grekas
e67c6d8886 bug #37506 [HttpClient] fix buffering AsyncResponse with no passthru (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] fix buffering AsyncResponse with no passthru

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

Commits
-------

1ffeba3f09 [HttpClient] fix buffering AsyncResponse with no passthru
2020-07-08 09:52:00 +02:00
Nicolas Grekas
d08524330a [Cache] Fix compat wth DBAL v3 2020-07-08 09:40:56 +02:00
Nicolas Grekas
98f5d50945 [String] throw when Alpine is used and translit fails 2020-07-07 19:07:07 +02:00
Grégoire Pineau
50d5167a66 [HttpFoundation] Added File::getContent() 2020-07-07 13:52:54 +02:00
Fabien Potencier
70ebf7e912 feature #37492 [ErrorHandler] Allow override of the default non-debug template (PhilETaylor)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[ErrorHandler] Allow override of the default non-debug template

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

Add new feature to allow the default hardcoded non-debug template to be overridden when `symfony/error-handler`used as a component in other projects.

Currently, when used as a component, its not possible (that I could see) to override the standard default template of `views/error.html.php` therefore the look and feel, and text is hard coded. There is much written on how to customise the error pages when using the full symfony stack, but not when using individual `symfony/error-handler` component on its own.

This PR is related to the use of `symfony/error-handler` as a component in other projects - specifically the Joomla Content Management System, where, in non debug mode, a generic template **needs to be translatable, and customisable** even though most of the time when the error occurs will bt at boot time and not much available to it. https://github.com/joomla/joomla-cms/issues/29968

This PR allows the use of code such as

```php
<?php

require 'vendor/autoload.php';

use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;

ErrorHandler::register();
HtmlErrorRenderer::setTemplate('/path/to/custom/mine.php');

throw new Exception('myException is this', 500);
```

and then for further customisation of the "look and feel" to be done in `mine.php`

Due to the unique way the error handler component is init'ed, the use of static calls has been employed rather than any DI approach, I hope this is ok.

Commits
-------

6e1d16b44d [ErrorHandler] Allow override of the default non-debug template
2020-07-07 10:33:05 +02:00
Phil E. Taylor
6e1d16b44d [ErrorHandler] Allow override of the default non-debug template 2020-07-07 10:32:58 +02:00
Nicolas Grekas
1ffeba3f09 [HttpClient] fix buffering AsyncResponse with no passthru 2020-07-06 20:08:07 +02:00
Nicolas Grekas
c046229c9e Merge branch '5.1'
* 5.1:
  minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
  [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
  fix handling null as empty data
  [Security\Http] Skip remember-me logout on empty token
  Missing return in loadValuesForChoices method
  No need to create an issue when creating a PR
  Use ">=" for the "php" requirement
  [HttpClient] Fix promise behavior in HttplugClient
  [Console] Fixes question input encoding on Windows
2020-07-06 15:25:45 +02:00
Nicolas Grekas
361bf335e2 bug #37504 [Security\Http] Skip remember-me logout on empty token (chalasr)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security\Http] Skip remember-me logout on empty token

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

Commits
-------

551f9418a3 [Security\Http] Skip remember-me logout on empty token
2020-07-06 15:25:09 +02:00
Nicolas Grekas
7da6d710cf Merge branch '5.0' into 5.1
* 5.0:
  minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
  [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
  fix handling null as empty data
  No need to create an issue when creating a PR
  Use ">=" for the "php" requirement
  [HttpClient] Fix promise behavior in HttplugClient
  [Console] Fixes question input encoding on Windows
2020-07-06 15:23:11 +02:00
Nicolas Grekas
564af6436a Merge branch '4.4' into 5.0
* 4.4:
  minor #37121 [Contracts] Add missing "extra.thanks" entries in composer.json (nicolas-grekas)
  [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
  fix handling null as empty data
  No need to create an issue when creating a PR
  [Console] Fixes question input encoding on Windows
2020-07-06 15:22:03 +02:00
Nicolas Grekas
2f65991a9d Merge branch '3.4' into 4.4
* 3.4:
  [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
  fix handling null as empty data
  No need to create an issue when creating a PR
  [Console] Fixes question input encoding on Windows
2020-07-06 15:18:39 +02:00
Nicolas Grekas
c0181c7667 bug #37461 [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows (JasonStephensTAMU)
This PR was merged into the 3.4 branch.

Discussion
----------

[Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows

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

Passes current Process unit tests.

On Windows systems, a new set of sf_proc_## files are generated in the system temp directory for each WindowsPipes object. These files are removed when the WindowsPipes object is destroyed.

This avoids receiving a permission denied error when attempting to write to sf_proc_## files between multiple sites running as different users, when the users do not have permissions to modify each others files.

Changes
- [Process] WindowsPipes always creates new sf_proc_## files in constructor
- [Process] WindowsPipes removes its sf_proc_## files in destructor

Commits
-------

220be89f5c [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
2020-07-06 15:15:39 +02:00
Jason Stephens
220be89f5c [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows 2020-07-06 15:15:13 +02:00
Nicolas Grekas
091fd5016d bug #37505 [Form] fix handling null as empty data (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] fix handling null as empty data

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

Commits
-------

b5aa55dab9 fix handling null as empty data
2020-07-06 15:09:26 +02:00
Christian Flothmann
b5aa55dab9 fix handling null as empty data 2020-07-06 14:28:35 +02:00
Robin Chalas
551f9418a3 [Security\Http] Skip remember-me logout on empty token 2020-07-06 12:10:25 +02:00
Robin Chalas
4297897869 bug #37385 [Console] Fixes question input encoding on Windows (YaFou)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fixes question input encoding on Windows

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| 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 #35842, Fix #36324, Fix #37495 and Fix #37278 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/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.
-->

To ask a question to a user, the [QuestionHelper](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/QuestionHelper.php) use [`fgets`](https://www.php.net/manual/en/function.fgets.php). However, special characters are not supported on Windows with this function (like accents: `é`, `à`, `ö`). The solution is to set a special encoding with [`sapi_windows_cp_get`](https://www.php.net/manual/en/function.sapi-windows-cp-get).

> Before
```php
$stream = fopen('php://stdin', 'r');
$input = fgets($stream);
echo $input;

// input: "Bonjour à tous"
// output: 'Bonjour \ tous" or "Bonjour   tous"
```

> After
```php
// Check if the function exists because it only exists on Windows
if(function_exists('sapi_windows_cp_set')) {
    sapi_windows_cp_get(437);
}

$stream = fopen('php://stdin', 'r');
$input = fgets($stream);
echo $input;

// input: "Bonjour à tous"
// output: 'Bonjour à tous"
```

*Thanks to @bnjmnfnk for the solution 😉*

Commits
-------

4288df4f74 [Console] Fixes question input encoding on Windows
2020-07-06 10:57:31 +02:00
Yonel Ceruto
6075debead Missing return in loadValuesForChoices method 2020-07-05 20:50:18 -04:00
Nicolas Grekas
085e66cfc2 Merge branch '4.4' into 5.0
* 4.4:
  Use ">=" for the "php" requirement
  [HttpClient] Fix promise behavior in HttplugClient
2020-07-05 11:43:09 +02:00
Alex Pott
4a360766cc Use ">=" for the "php" requirement 2020-07-05 11:39:30 +02:00
Nicolas Grekas
32707260f9 bug #37491 [HttpClient] Fix promise behavior in HttplugClient (brentybh)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix promise behavior in HttplugClient

| Q             | A
| ------------- | ---
| Branch?       | 4.4 & up <!-- see below -->
| 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 #37488 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/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.
-->

## The Problem
Promises have 2 important methods: `then` and `wait`.
To implement Httplug's promise interface, we built `HttplugPromise` on top of Guzzle promise.
However, when an error occurred (Httplug `NetworkException` thrown) while init the request/before actually sending the request,
`HttplugClient::sendAsyncRequest` will return a `Http\Promise\RejectedPromise`, which is a dummy implementation.

If the `then` callable returns a promise-like object, `Http\Promise\RejectedPromise` will treat it as plain value.
Guzzle promise will try to resolve the promise-like value, which is an object that has `then` method on it.

bbf3b200bc/src/Promise.php (L116)

To fix this, I edited `src/Symfony/Component/HttpClient/HttplugClient.php`.

Next, let me explain why to edit `src/Symfony/Component/HttpClient/Response/HttplugPromise.php`.
After the previous fix, when a Guzzle promise returned by the `then` callable, things will work.
However, If I return a `HttplugPromiseInterface`, it doesn't work, because Guzzle promise `wait` the return value (result)
only if it's a Guzzle promise.

bbf3b200bc/src/Promise.php (L63)

To fix this, I referenced the `wait` code of Guzzle promise and edited our `HttplugPromise`.

## How this fix make sense

So, why to return a promise from the `then` callable?
This let us change the promise chain according to current promise's result (fulfilled/rejected).

For example, we can retry an HTTP request if it failed.
Please take a look at my test code.

Commits
-------

147b6adc39 [HttpClient] Fix promise behavior in HttplugClient
2020-07-04 11:37:25 +02:00
Bohan Yang
147b6adc39 [HttpClient] Fix promise behavior in HttplugClient 2020-07-04 11:37:14 +02:00
Nicolas Grekas
e6e1ca38c0 Merge branch '5.1'
* 5.1:
  [Console] fix reading from STDIN
2020-07-04 11:30:53 +02:00
Nicolas Grekas
5de5b7d82e Merge branch '5.0' into 5.1
* 5.0:
  [Console] fix reading from STDIN
2020-07-04 11:30:46 +02:00
Nicolas Grekas
c2c4d4dc12 Merge branch '4.4' into 5.0
* 4.4:
  [Console] fix reading from STDIN
2020-07-04 11:30:38 +02:00
Nicolas Grekas
5da153603b [Console] fix reading from STDIN 2020-07-04 11:30:27 +02:00
Nicolas Grekas
901e938da3 Merge branch '5.1'
* 5.1:
  [HttpClient][CurlHttpClient] Fix http_version option usage
  [HttpClient] fix parsing response headers in CurlResponse
  [PropertyAccess] Remove inflector component
  [Console] Do not check for "stty" using "exec" if that function is disabled
  [Console] always use stty when possible to ask hidden questions
2020-07-03 20:06:54 +02:00
Nicolas Grekas
a815bc2b41 Merge branch '5.0' into 5.1
* 5.0:
  [HttpClient][CurlHttpClient] Fix http_version option usage
  [HttpClient] fix parsing response headers in CurlResponse
  [Console] Do not check for "stty" using "exec" if that function is disabled
  [Console] always use stty when possible to ask hidden questions
2020-07-03 20:06:49 +02:00
Nicolas Grekas
f9225109e4 Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient][CurlHttpClient] Fix http_version option usage
  [HttpClient] fix parsing response headers in CurlResponse
  [Console] Do not check for "stty" using "exec" if that function is disabled
  [Console] always use stty when possible to ask hidden questions
2020-07-03 20:06:40 +02:00
Nicolas Grekas
fec23313e7 bug #37469 [Console] always use stty when possible to ask hidden questions (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] always use stty when possible to ask hidden questions

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

The current code doesn't make much sense: we check `hasSttyAvailable()`, and if the answer is `false`, we still use `stty` directly.

This PR relies on `stream_isatty` and equivalent fallback checks to decide if the password can be hidden or not.

Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/37469/files?w=1).

Commits
-------

055b605e30 [Console] always use stty when possible to ask hidden questions
2020-07-03 20:04:21 +02:00
Nicolas Grekas
b3df84c857 minor #37470 [Workflow] Normalize workflow changelog (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Normalize workflow changelog

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

Commits
-------

e1de806050 [Workflow] Normalize workflow changelog
2020-07-03 14:54:52 +02:00
Nicolas Grekas
ee0e37b47d bug #37486 [HttpClient] fix parsing response headers in CurlResponse (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix parsing response headers in CurlResponse

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

This fixes rare notices that look like:
`Argument 2 passed to Symfony\Component\HttpClient\Chunk\DataChunk::__construct() must be of the type string, null given`

I'm unable to provide a test case since I'm unable to provide a simple reproducer.

It happens that curl can call the header-function with multiple lines at once apparently, while most of the time it does so with one at a time.

Commits
-------

eb70fb2f26 [HttpClient] fix parsing response headers in CurlResponse
2020-07-03 14:36:03 +02:00
Thomas Calvet
2676902a77 [HttpClient][CurlHttpClient] Fix http_version option usage 2020-07-03 13:44:40 +02:00
Nicolas Grekas
eb70fb2f26 [HttpClient] fix parsing response headers in CurlResponse 2020-07-03 13:27:27 +02:00
Mponos George
8942d5a5b8
[PropertyAccess] Remove inflector component
[PropertyAccess] Remove inflector component as a requirements since the component is deprecated.
2020-07-03 10:49:29 +03:00
Nicolas Grekas
3a4a58385e [HttpClient] always yield a LastChunk in AsyncResponse on destruction 2020-07-02 21:33:50 +02:00
David Maicher
d057dffcd6 [Mime] allow non-ASCII characters in local part of email 2020-07-01 19:26:13 +02:00
Nicolas Grekas
659699b9ce Merge branch '3.4' into 4.4
* 3.4:
  [Console] Do not check for "stty" using "exec" if that function is disabled
2020-07-01 19:14:21 +02:00
Michael Voříšek
02124b6b3b [Console] Do not check for "stty" using "exec" if that function is disabled 2020-07-01 19:13:52 +02:00
Nicolas Grekas
055b605e30 [Console] always use stty when possible to ask hidden questions 2020-07-01 17:27:01 +02:00
Fabien Potencier
8cc90b9845 feature #36364 [HttpKernel][WebProfilerBundle] Add session profiling (mtarld)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpKernel][WebProfilerBundle] Add session profiling

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

This PR proposes to add session profiling.
It provides stateless checking status and session usage backtraces.

Under are screesnhots of provided profiling:
![Screenshot from 2020-04-06 13-42-41](https://user-images.githubusercontent.com/4955509/78581189-d6c32580-7833-11ea-9de5-d1e4f8e60c27.png)
![Screenshot from 2020-04-06 13-43-04](https://user-images.githubusercontent.com/4955509/78581193-d88ce900-7833-11ea-90a4-85d07c64d47e.png)
![Screenshot from 2020-04-06 17-43-17](https://user-images.githubusercontent.com/4955509/78581159-cca12700-7833-11ea-98d2-38306ec9ea37.png)
![Screenshot from 2020-04-06 17-43-35](https://user-images.githubusercontent.com/4955509/78581238-e8a4c880-7833-11ea-89e2-ff4fdea8dce5.png)

Commits
-------

5dbaef8883 Add session profiling
2020-07-01 16:42:25 +02:00
Grégoire Pineau
e1de806050 [Workflow] Normalize workflow changelog 2020-07-01 15:44:40 +02:00
Mathias Arlaud
5dbaef8883 Add session profiling 2020-07-01 14:40:41 +02:00
Fabien Potencier
5b6139f488 feature #37428 [Workflow] Added Function (and Twig extension) to retrieve a specific transition (Carlos Pereira De Amorim)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Added Function (and Twig extension) to retrieve a specific transition

You can now easily retrieve a specific transition. Useful when you want the metadata of a specific transition.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | hmmmm, should I create a ticket first ?
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/13907

I needed to get the metadata of a transition, but in order to do that, you need the transition object. So here is a PR to easily get the transition object

Commits
-------

0eebe74259 [Workflow] Added Function (and Twig extension) to retrieve a specific transition
2020-07-01 14:24:19 +02:00
Carlos Pereira De Amorim
0eebe74259 [Workflow] Added Function (and Twig extension) to retrieve a specific transition 2020-07-01 14:24:18 +02:00
Fabien Potencier
d8082fa2f8 feature #36487 [HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent (javespi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent

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

---

As same as the `MockResponse` class has `getRequestOptions()` when doing a request; I've added:
* `getRequestUrl()` - returns the URL used when doing the request
* `getRequestMethod()` - returns the HTTP method used when doing the request

With these two getters, we would be able to assert that the method and URL passed to the `HttpClient` were well generated. I've tried to assert the URL generated in a unit test of a class with a `SymfonyHttpClient` injected and it wasn't possible. Calling `$mock->getInfo('url')` returns `null`.

Example, if we have a class with `HttpClientInterface` injected like this:

```php
final class SymfonyHttpUserClient
{
    private HttpClientInterface $httpClient;
    private string $baseUri;

    public function __construct(
        HttpClientInterface $httpClient,
        string $baseUri
    ) {
        $this->httpClient = $httpClient;
        $this->baseUri = $baseUri;
    }

    public function getById(string $userId): void
    {
        $this->httpClient->request(
            'GET',
            $this->baseUri . $customerId
        );
    }
}
```

And if we want to do a unit test of `SymfonyHttpUserClient` right now we are not able to check if the URL of the request was well-formed passing a `MockResponse`. Also, we weren't able to assert the HTTP method (maybe this piece is not so critical to assert in the unit test).

```php
class SymfonyHttpUserClientTests extends TestCase
{
    public function testGetById(): void
    {
        $baseUri = 'https://user-api.test/api/v1/users/';
        $mockResponse = new MockResponse();
        $symfonyHttpUserClient = new SymfonyHttpUserClient(
            new MockHttpClient(
                [$mockResponse],
                $baseUri
            ),
            $baseUri
        );

        // test get by id:
        $symfonyHttpUserClient->getById('some-user-id');

        // cannot be asserted right now:
        $this->assertSame($mockResponse->getInfo('url'), $baseUri . 'some-user-id'); // fail
        $this->assertSame($mockResponse->getInfo('http_method'), 'GET'); // fail

        // it could be with the new getters:
        $this->assertSame($mockResponse->getRequestUrl(), $baseUri . 'some-user-id');
        $this->assertSame($mockResponse->getRequestMethod(), 'GET');
    }
}
```

This only happens if the class has injected the HttpClient and if it is used inside void methods with no being able to return the response. If the class returns the response, `url` and `http_method` are available with `$response->getInfo()` call. But this response object is a new one, is not the mock passed by argument when you instance the MockHttpClient.

Var dumps of `getInfo` array:

```
$response->getInfo() from MockClient:

..array(10) {
  ["start_time"]=>
  float(1587109014.7985)
  ["user_data"]=>
  NULL
  ["http_code"]=>
  int(200)
  ["response_headers"]=>
  array(0) {
  }
  ["error"]=>
  NULL
  ["canceled"]=>
  bool(false)
  ["redirect_count"]=>
  int(0)
  ["redirect_url"]=>
  NULL
  ["http_method"]=>
  string(3) "GET"
  ["url"]=>
  string(47) "https://user-api.test/api/v1/users/some-user-id"
}

$mock->getInfo()

array(4) {
  ["http_code"]=>
  int(200)
  ["response_headers"]=>
  array(0) {
  }
  ["error"]=>
  NULL
  ["canceled"]=>
  bool(false)
}
```

This is a minor change, I opened the PR with `4.4` as base branch; but not sure if it should be opened with `5.0` as base branch or even `master` taking account is a feature (add two new getters in MockResponse class). Let me know if I didn't follow right the instructions (first PR on Symfony project 😃)

Thanks!

Commits
-------

7a250d80c1 [HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent
2020-07-01 14:18:06 +02:00
Fabien Potencier
501542a0dd feature #37295 Move event alias mappings to their components (derrabus)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Move event alias mappings to their components

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

For a small console tool, I wanted to use the Console, EventDispatcher and DI components standalone. In order to make use of aliased events, I had to copy over the mapping information from FrameworkBundle, which was a bit unfortunate.

With this PR, I'd like to suggest to store all alias mappings on the `*Events` classes of each component instead. This change will make the mapping reusable outside of the full-stack framework.

Note: I've bumped the dependencies of FrameworkBundle/SercurityBundle in order to gain access to the moved mapping information. If any of the bumps is too heavy, please tell me and I'll implement a fallback instead.

Commits
-------

28e6f6f72c Move event alias mappings to their components.
2020-07-01 14:12:45 +02:00
YaFou
4288df4f74
[Console] Fixes question input encoding on Windows 2020-07-01 11:10:10 +02:00
Nicolas Grekas
1bbfde581f Merge branch '5.1'
* 5.1:
  [ErrorHandler] fix throwing from __toString()
  Removed comments and requirements relative to php <5.5 (not supported anymore)
  Fix caching of parent locales file in translator
  fix validating lazy properties that evaluate to null
2020-06-30 19:42:41 +02:00
Nicolas Grekas
85d471bf05 Merge branch '5.0' into 5.1
* 5.0:
  [ErrorHandler] fix throwing from __toString()
  Removed comments and requirements relative to php <5.5 (not supported anymore)
  Fix caching of parent locales file in translator
  fix validating lazy properties that evaluate to null
2020-06-30 19:42:22 +02:00
Nicolas Grekas
23fcbd4dd5 Merge branch '4.4' into 5.0
* 4.4:
  [ErrorHandler] fix throwing from __toString()
  Removed comments and requirements relative to php <5.5 (not supported anymore)
  Fix caching of parent locales file in translator
  fix validating lazy properties that evaluate to null
2020-06-30 19:40:59 +02:00
Nicolas Grekas
450034c986 Merge branch '3.4' into 4.4
* 3.4:
  [ErrorHandler] fix throwing from __toString()
  Removed comments and requirements relative to php <5.5 (not supported anymore)
  fix validating lazy properties that evaluate to null
2020-06-30 19:40:09 +02:00
Nicolas Grekas
52ddce1a74 bug #37447 [Validator] fix validating lazy properties that evaluate to null (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] fix validating lazy properties that evaluate to null

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

Commits
-------

776daf28b4 fix validating lazy properties that evaluate to null
2020-06-30 19:35:43 +02:00
Nicolas Grekas
aeb4637341 [ErrorHandler] fix throwing from __toString() 2020-06-30 19:28:29 +02:00
Javier Espinosa
7a250d80c1 [HttpClient] Add MockResponse::getRequestMethod() and getRequestUrl() to allow inspecting which request has been sent 2020-06-30 18:39:01 +02:00
Dmitrii Lozhkin
0a4ef897b7 [VarDumper] improve rendering HTML 2020-06-30 16:43:42 +02:00
Alexander M. Turek
28e6f6f72c Move event alias mappings to their components. 2020-06-30 16:13:44 +02:00
Nicolas Grekas
78e6fc4b42 bug #37449 [Translation] Fix caching of parent locales file in translator (jvasseur)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] Fix caching of parent locales file in translator

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (this is the lowest maintained branch with this code)
| 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        |

The `parentLocales` property was probably meant as a cache for the content of the `parents.json` file but instead the content is stored in a local variable and the property stays `null`. This means the file is read on each call to `computeFallbackLocales`.

This PR update the code to what was probably meant to be.

(Ref https://github.com/symfony/symfony/pull/28070)

Commits
-------

02c9ac68a4 Fix caching of parent locales file in translator
2020-06-30 15:55:33 +02:00
Grégoire Pineau
5c5ea7500e Removed comments and requirements relative to php <5.5 (not supported anymore) 2020-06-30 14:50:28 +02:00
Nicolas Grekas
d555112fbf feature #37443 [HttpClient] add StreamableInterface to ease turning responses into PHP streams (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] add StreamableInterface to ease turning responses into PHP streams

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

Commits
-------

de103b31a9 [HttpClient] add StreamableInterface to ease turning responses into PHP streams
2020-06-30 14:30:51 +02:00
Nicolas Grekas
3ce43915bd minor #37433 Console ProgressBar: Change redraw default value to 25fps (flack)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Console ProgressBar: Change redraw default value to 25fps

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

`ProgressBar` has a default value of `0.1` for `$minSecondsBetweenRedraws` which works out to 10 fps, so below the threshhold at which the human eye perceives it as a moving image instead of a series of individual images. Of course, the console's progress bar is not really an animation tool, but it seems like a low-hanging fruit to change the redraw frequency to something that can be perceived as a fluid motion. So I'm proposing to change `$minSecondsBetweenRedraws` to `0.016666666666667`, i.e. 60 fps, which is a fairly typical refresh rate for computer screens, so redrawing more often than that would be pointless. It means of course to redraw six times more often than currently, but i guess performance is not such a big concern here, right?

Commits
-------

b1c38bada7 Console ProgressBar: Change redraw default value to 25fps
2020-06-30 11:12:36 +02:00
flack
b1c38bada7 Console ProgressBar: Change redraw default value to 25fps 2020-06-30 11:11:53 +02:00
Christian Flothmann
6aecad7438 Merge branch '5.1'
* 5.1:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
  Added missing license headers
2020-06-29 16:32:23 +02:00
Christian Flothmann
eb58ea6a26 Merge branch '5.0' into 5.1
* 5.0:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
2020-06-29 16:31:29 +02:00
Christian Flothmann
5a91e51154 Merge branch '4.4' into 5.0
* 4.4:
  fix compatibility with Doctrine DBAL 3.0
  skip test if guesser is not supported
2020-06-29 16:24:36 +02:00
Christian Flothmann
f194602c30 minor #37450 [Mime] skip test if guesser is not supported (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] skip test if guesser is not supported

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

fixes tests on AppVeyor

Commits
-------

3b77abea65 skip test if guesser is not supported
2020-06-29 16:24:11 +02:00
Christian Flothmann
b17df8cdd7 fix compatibility with Doctrine DBAL 3.0 2020-06-29 15:55:34 +02:00
Christian Flothmann
3b77abea65 skip test if guesser is not supported 2020-06-29 15:46:05 +02:00
Jérôme
02c9ac68a4
Fix caching of parent locales file in translator 2020-06-29 15:31:43 +02:00
Christian Flothmann
776daf28b4 fix validating lazy properties that evaluate to null 2020-06-29 12:55:42 +02:00
Fabien Potencier
f706d6a276 minor #37445 [Security] Added missing license headers (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Added missing license headers

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

See 3be6ce121b

Seems like the fabbot reviews (and I) missed quite a lot of these in my big security PR.

Commits
-------

ea81b61e5f Added missing license headers
2020-06-29 10:19:14 +02:00
Wouter de Jong
ea81b61e5f Added missing license headers 2020-06-28 20:41:01 +02:00
Nicolas Grekas
de103b31a9 [HttpClient] add StreamableInterface to ease turning responses into PHP streams 2020-06-28 17:56:16 +02:00
Nicolas Grekas
75031a1230 Merge branch '5.1'
* 5.1:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [HttpClient] fix casting TraceableResponse to php streams
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Fix the 'supports' method argument type of the security voter
  Use the driverConnection executeUpdate method
2020-06-28 17:36:15 +02:00
Nicolas Grekas
009961795b bug #37440 [HttpClient] fix casting TraceableResponse to php streams (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] fix casting TraceableResponse to php streams

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

We'd better replace these checks by an `instanceof` one, but that'd be for master.

Commits
-------

5733289278 [HttpClient] fix casting TraceableResponse to php streams
2020-06-28 17:33:45 +02:00
Nicolas Grekas
4ad5079082 Merge branch '5.0' into 5.1
* 5.0:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Fix the 'supports' method argument type of the security voter
  Use the driverConnection executeUpdate method
2020-06-28 17:32:35 +02:00
Nicolas Grekas
55768b18c9 Merge branch '4.4' into 5.0
* 4.4:
  Fix test that fails on old distros
  Fix: compatibility with phpunit 9.3
  [DoctrineBridge] work around Connection::ping() deprecation
  [MimeType] Duplicated MimeType due to PHP Bug
  [DI] fix parsing of argument type=binary in xml
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
  Use the driverConnection executeUpdate method
2020-06-28 17:28:17 +02:00
Nicolas Grekas
27290714b7 Merge branch '3.4' into 4.4
* 3.4:
  Fix test that fails on old distros
2020-06-28 17:22:55 +02:00
Nicolas Grekas
b344f6d7db Fix test that fails on old distros 2020-06-28 17:22:27 +02:00
Nicolas Grekas
2e2fac8766 Merge branch '3.4' into 4.4
* 3.4:
  [MimeType] Duplicated MimeType due to PHP Bug
  fix guessing form types for DateTime types
  fix handling typed properties as constraint options
2020-06-28 17:07:02 +02:00
Nicolas Grekas
6ef3fee863 bug #37291 [MimeType] Duplicated MimeType due to PHP Bug (juanmrad)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[MimeType] Duplicated MimeType due to PHP Bug

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| 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 #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

## Issue:

Currently there is a PHP bug https://bugs.php.net/bug.php?id=77784 that is causing several MimeTypes to be given as duplicated:

```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```
Instead of:
```
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```

This Patch will fix the Issues by checking if a returned MimeType is duplicated and return appropriate MimeType.

This patch should be reverted if the PHP Bug is ever fixed.

Commits
-------

7cb29c8b4b [MimeType] Duplicated MimeType due to PHP Bug
2020-06-28 16:49:48 +02:00
Juan Mrad
7cb29c8b4b [MimeType] Duplicated MimeType due to PHP Bug 2020-06-28 16:49:36 +02:00
Nicolas Grekas
5733289278 [HttpClient] fix casting TraceableResponse to php streams 2020-06-28 16:07:40 +02:00
Nicolas Grekas
0492099432 Merge branch '5.1'
* 5.1:
  [Notifier] Notifier 5.2 is incompatible with 5.1 bridges.
  [DI] fix minor perf regression when creating non-shared services
2020-06-28 15:35:06 +02:00
Nicolas Grekas
b57f414d4a minor #37438 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Notifier 5.2 is incompatible with 5.1 bridges

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

#36611 introduced a breaking change that made the Notifier 5.2 incompatible with all Notifier bridges 5.0-5.1. Because of this, the tests are currently failing on Travis. This PR attempts to fix this.

Commits
-------

1b6bbc2e71 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges.
2020-06-28 15:31:24 +02:00
Tito Miguel Costa
4cf1a1e8e6 fixed docblock 2020-06-28 15:18:51 +02:00
Alexander M. Turek
1b6bbc2e71 [Notifier] Notifier 5.2 is incompatible with 5.1 bridges. 2020-06-27 23:56:40 +02:00
Alexandre Tranchant
d903d9a757 Added a FrenchInflector for the String component
French inflector implements InflectorInterface, it uses regexp and it is tested in the FrenchInflectorTest
2020-06-27 22:18:36 +02:00
Nicolas Grekas
75e2ee17b0 [DI] fix minor perf regression when creating non-shared services 2020-06-27 15:48:04 +02:00
Tobias Schultze
70b6a00148 [DI] fix parsing of argument type=binary in xml 2020-06-26 19:49:20 +02:00
Christian Flothmann
9ba90bf1f8 fix guessing form types for DateTime types 2020-06-26 14:15:21 +02:00
Fabien Potencier
9660e6b1e2 bug #37392 [Validator] fix handling typed properties as constraint options (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] fix handling typed properties as constraint options

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

Commits
-------

4a66a6098f fix handling typed properties as constraint options
2020-06-25 12:06:33 +02:00
Tito Costa
204cd739d3 added info method to symfony style 2020-06-25 12:05:17 +02:00
Christian Flothmann
4a66a6098f fix handling typed properties as constraint options 2020-06-25 11:23:26 +02:00
François Pluchino
b8192eecab Fix the 'supports' method argument type of the security voter 2020-06-25 11:01:55 +02:00
Fabien Potencier
7bac792328 Fix logic 2020-06-25 10:39:34 +02:00
Fabien Potencier
73596ef4f7 bug #37358 Directly use the driverConnection executeUpdate method (TristanPouliquen)
This PR was merged into the 4.4 branch.

Discussion
----------

Directly use the driverConnection executeUpdate method

executeUpdate & executeQuery methods do not throw a TableNotFoundException. No need for the try/catch as it is done for executeQuery

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/37355
| License       | MIT

As explained in https://github.com/symfony/symfony/issues/37355, when doing a write operation, one should avoid using the `executeQuery` method of a Connection, as Doctrine's MasterSlaveConnection can pick a slave instance (usually read-only) for these operations.

Commits
-------

eec12ecd23 Use the driverConnection executeUpdate method
2020-06-25 10:28:26 +02:00
Fabien Potencier
213c6ab6d5 bug #36347 [Notifier][Slack] Error trown when having more than 10 fields specified #36346 (birkof)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Notifier][Slack] Error trown when having more than 10 fields specified #36346

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| 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 #36346 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

As written in [docs](https://api.slack.com/reference/block-kit/blocks#section) of Section block, for fields we have to had maximum 10 items specified.

Commits
-------

68b2490ee2 [Notifier][Slack] Error trown when having more than 10 fields specified #36346
2020-06-25 09:24:04 +02:00
Daniel STANCU
68b2490ee2 [Notifier][Slack] Error trown when having more than 10 fields specified #36346 2020-06-25 09:23:57 +02:00
Robin Chalas
a184e54cb3 Merge branch '5.1'
* 5.1:
  fix merge
  Fix merge
2020-06-24 17:21:47 +02:00
Robin Chalas
5355172c10 Merge branch '5.0' into 5.1
* 5.0:
  fix merge
  Fix merge
2020-06-24 17:21:02 +02:00
Robin Chalas
2caadf17b4 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
  Fix merge
2020-06-24 17:19:54 +02:00
Tobias Schultze
40890b14e4 minor #37302 [Form] Move configuration to PHP (misekai)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Form] Move configuration to PHP

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.4, 5.0 or 5.1 for bug fixes <!-- see below -->
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #37186
| License       | MIT
| Doc PR        | -

Commits
-------

9e2e8eeb29 [Form] Move configuration to PHP
2020-06-24 16:38:26 +02:00
Alex Vo
9e2e8eeb29 [Form] Move configuration to PHP 2020-06-24 16:38:17 +02:00
Fabien Potencier
fb123e4fca feature #37272 [HttpFoundation] add HeaderUtils::parseQuery(): it does the same as parse_str() but preserves dots in variable names (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpFoundation] add `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names

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

Inspired by https://github.com/symfony/psr-http-message-bridge/pull/80
/cc @drupol

Related to #9009, #29664, #26220 but also https://github.com/api-platform/core/issues/509 and https://www.drupal.org/project/drupal/issues/2984272
/cc @dunglas @alexpott

Commits
-------

dd81e32ec1 [HttpFoundation] add `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names
2020-06-24 15:46:31 +02:00
Fabien Potencier
550ab6fd8c Fix merge 2020-06-24 15:38:36 +02:00
Fabien Potencier
809b4d6748 Merge branch '5.1'
* 5.1:
  [HttpClient] Support for cURL handler objects.
  [HttpClient] unset activity list when creating CurlResponse
  Fixed typo in test name
  [DI] Fix call to sprintf in ServicesConfigurator::stack()
  add .body wrapper element
  [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
  [VarDumper] Support for cURL handler objects.
  Check whether path is file in DataPart::fromPath()
  [DI][FrameworkBundle] Remove whitelist occurrences
  Avoid accessibility errors on debug toolbar
  Resolve event bubbling logic in a compiler pass
  update cookie test
2020-06-24 15:36:31 +02:00
Fabien Potencier
01872c7fe3 Merge branch '5.0' into 5.1
* 5.0:
  [HttpClient] Support for cURL handler objects.
  [HttpClient] unset activity list when creating CurlResponse
  Fixed typo in test name
  add .body wrapper element
  [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
  [VarDumper] Support for cURL handler objects.
  Check whether path is file in DataPart::fromPath()
  [DI][FrameworkBundle] Remove whitelist occurrences
  Avoid accessibility errors on debug toolbar
  update cookie test
2020-06-24 15:36:18 +02:00
Fabien Potencier
d1c1973bb4 Merge branch '4.4' into 5.0
* 4.4:
  [HttpClient] Support for cURL handler objects.
  [HttpClient] unset activity list when creating CurlResponse
  Fixed typo in test name
  add .body wrapper element
  [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
  [VarDumper] Support for cURL handler objects.
  Check whether path is file in DataPart::fromPath()
  [DI][FrameworkBundle] Remove whitelist occurrences
  Avoid accessibility errors on debug toolbar
2020-06-24 15:36:01 +02:00
Fabien Potencier
378894d64d Merge branch '3.4' into 4.4
* 3.4:
  Fixed typo in test name
  [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
  [VarDumper] Support for cURL handler objects.
  [DI][FrameworkBundle] Remove whitelist occurrences
  Avoid accessibility errors on debug toolbar
2020-06-24 15:34:53 +02:00
Fabien Potencier
40152c37ce bug #37389 [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3" (YaFou)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| 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 #36068 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no
<!--
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.
-->

`.mp3` files are more common than `.mpga` files.

Commits
-------

76a744ad91 [HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3"
2020-06-24 15:26:36 +02:00
Fabien Potencier
de0563d8cd minor #37242 [BrowserKit] update cookie test for cookie values with double quotes (gabrielsolomon)
This PR was merged into the 5.0 branch.

Discussion
----------

[BrowserKit] update cookie test for cookie values with double quotes

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | noâ
| Deprecations? | no
| Tickets       | Fix #37161
| License       | MIT
| Doc PR        | symfony/symfony-docs#

Provide a test for cookie values with double quotes

Commits
-------

a50c660823 update cookie test
2020-06-24 11:01:43 +02:00
Alexander M. Turek
7ccc2e1f28 [HttpClient] Support for cURL handler objects. 2020-06-24 10:43:17 +02:00