Commit Graph

44770 Commits

Author SHA1 Message Date
Julien Maulny
a6292b917b [DI] Add compiler pass to check arguments type hint 2019-10-12 11:48:25 +02:00
Nicolas Grekas
211c651d2a bug #33944 [HttpClient] resolve promise chains on HttplugClient::wait() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] resolve promise chains on HttplugClient::wait()

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

Follow up of #33743

Right now, keeping a reference to promise objects returned by `HttplugClient::sendAsyncRequest()`, then calling their `wait()` method is the only way to actually resolve the promises. That's why when these promises are destructed, we cancel the corresponding HTTP request.

But thanks to the `HttplugClient::wait()` method, we have a hook to tick the event loop managed by the Symfony client.

I added a test case to run into this situation.

~It fails currently. I'd like asking @joelwurtz, @dbu and/or maybe @Nyholm if you could have a look and finish this PR? I'm not that familiar with promises and you might get faster and better to the goal. Anyone else is welcome also of course. Thank you for having a look :) PR welcome on my fork or as a separate one on this repos.~

Commits
-------

ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait()
2019-10-12 11:46:32 +02:00
Nicolas Grekas
0e84d3d8c2 bug #33959 [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()

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

A final improvement to `AbstractTagAwareAdapter::deleteItems()`: this PR makes `deleteItems()` operate in 1RTT instead of 2.

Commits
-------

0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems()
2019-10-12 11:45:08 +02:00
Nicolas Grekas
ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait() 2019-10-12 10:50:39 +02:00
Fabien Potencier
a84ec3a636 feature #33883 [Mailer] added ReplyTo option for PostmarkApiTransport (pierregaste)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] added ReplyTo option for PostmarkApiTransport

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

Supports "ReplyTo" option with Postmark transport

Commits
-------

d49a7387de [Mailer] added ReplyTo option for PostmarkApiTransport
2019-10-12 08:51:40 +02:00
Nicolas Grekas
0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems() 2019-10-11 20:45:35 +02:00
Tobias Schultze
38b9a27976 feature #33053 [ErrorHandler] Rework fatal errors (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Rework fatal errors

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32605
| License       | MIT
| Doc PR        | -

Built on top of https://github.com/symfony/symfony/pull/33038 so review only the second commit : d5c3f7ed48

The goals of this PR is to replace current "fatal error handlers" with "error enhancers" since all our current fatal error handlers works on \Error since PHP7.

That means we won't use the FatalErrorException anymore, so we will be able to remove it (once we don't need it in the rest of the codebase).

The final goal btw is to handle \Throwable everywhere in the code so we can remove FatalThrowableError & FatalErrorException classes.

Commits
-------

aaa0cdf523 [ErrorHandler] Rework fatal error handlers
2019-10-11 16:10:55 +02:00
Nicolas Grekas
28f95361c6 feature #33939 [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter

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

This is the final touch in my series of PR that fixes the linked issue.

Remarkably, the solutions I implemented for this issue are completely different than the one I described there. Fortunately, the issues themselves were correctly identified.

Plannification of implementation is gambling :)

/cc @andrerom

Commits
-------

5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter
2019-10-11 15:35:39 +02:00
Nicolas Grekas
5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter 2019-10-11 14:17:27 +02:00
Fabien Potencier
1c81349b42 feature #33941 Keeping backward compatibility with legacy FlattenException usage (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Keeping backward compatibility with legacy FlattenException usage

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

Commits
-------

928363c408 Keeping backward compatibility with legacy FlattenException usage
2019-10-11 06:10:30 +02:00
Fabien Potencier
b1ea2cd7a6 bug #33910 [Mime] added image/svg MIME support (0xB4LINT)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] added image/svg MIME support

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

Added `image/svg` MIME type to `svg` extension.
More @#33909.

Commits
-------

015eb6625c added image/svg MIME support
2019-10-10 21:26:50 +02:00
Nicolas Grekas
6e7f3257ce [HttpClient] fix merge 2019-10-10 10:55:24 +02:00
Nicolas Grekas
f93b3a3653 Merge branch '4.3' into 4.4
* 4.3:
  [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
  [HttpClient] send `Accept: */*` by default, fix removing it when needed
2019-10-10 09:38:51 +02:00
Nicolas Grekas
76f44df8ff bug #33937 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()

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

Making things more robust, part of #33924

Commits
-------

a1f334c1b7 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete()
2019-10-10 09:36:50 +02:00
Nicolas Grekas
585a7a4caf bug #33935 [HttpClient] send Accept: */* by default, fix removing it when needed (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] send `Accept: */*` by default, fix removing it when needed

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

Reported on Slack.

Commits
-------

aff4e56fc5 [HttpClient] send `Accept: */*` by default, fix removing it when needed
2019-10-10 09:36:13 +02:00
Yonel Ceruto
928363c408 Keeping backward compatibility with legacy FlattenException usage 2019-10-09 19:29:06 -04:00
Nicolas Grekas
a1f334c1b7 [Cache] ignore unserialization failures in AbstractTagAwareAdapter::doDelete() 2019-10-09 20:33:00 +02:00
Nicolas Grekas
aff4e56fc5 [HttpClient] send Accept: */* by default, fix removing it when needed 2019-10-09 18:19:03 +02:00
Nicolas Grekas
c216f7f268 cs fix 2019-10-09 16:35:36 +02:00
Nicolas Grekas
93aa54ed57 Merge branch '4.3' into 4.4
* 4.3:
  [Validator] sync NO and NB translations
2019-10-09 16:34:05 +02:00
Nicolas Grekas
1292d8da7c Merge branch '3.4' into 4.3
* 3.4:
  [Validator] sync NO and NB translations
2019-10-09 16:33:56 +02:00
Nicolas Grekas
31fcf93253 [Validator] sync NO and NB translations 2019-10-09 16:33:48 +02:00
Nicolas Grekas
41dfd98bbe bug #33921 [Cache] improve perf of pruning for fs-based adapters (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] improve perf of pruning for fs-based adapters

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

Thank you [Blackfire.io](https://blackfire.io)

https://blackfire.io/profiles/compare/8044c3cf-1541-4a24-9804-5670c63fcb4c/graph

![image](https://user-images.githubusercontent.com/243674/66465435-22f9fc80-ea81-11e9-83fc-2444434a33e6.png)

![image](https://user-images.githubusercontent.com/243674/66465462-2d1bfb00-ea81-11e9-827a-4c0502cb5f4a.png)

Commits
-------

0302b1d8b0 [Cache] improve perf of pruning for fs-based adapters
2019-10-09 16:30:25 +02:00
Nicolas Grekas
0302b1d8b0 [Cache] improve perf of pruning for fs-based adapters 2019-10-09 16:21:42 +02:00
Nicolas Grekas
1010910bab Merge branch '4.3' into 4.4
* 4.3:
  [Cache] cs fix
2019-10-09 15:27:43 +02:00
Nicolas Grekas
20fd92571e [Cache] cs fix 2019-10-09 15:27:34 +02:00
Nicolas Grekas
f52d900d00 Merge branch '4.3' into 4.4
* 4.3:
  [Cache] clean tags folder on invalidation
  [Cache] remove implicit dependency on symfony/filesystem
  Allow to set cookie_samesite to 'none'
  [VarDumper] fix array key error for class SymfonyCaster
  Adds missing translations for no nb
  [HttpKernel] fix $dotenvVars in data collector
  Add the missing translations for the Swedish ("sv") locale
  bumped Symfony version to 4.3.6
  updated VERSION for 4.3.5
  updated CHANGELOG for 4.3.5
  bumped Symfony version to 3.4.33
  updated VERSION for 3.4.32
  update CONTRIBUTORS for 3.4.32
  updated CHANGELOG for 3.4.32
  [Messenger] DoctrineTransport: ensure auto setup is only done once
  [Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available
  [Crawler] document $default as string|null
2019-10-09 15:24:13 +02:00
Nicolas Grekas
fd50d687cc Merge branch '3.4' into 4.3
* 3.4:
  Adds missing translations for no nb
  Add the missing translations for the Swedish ("sv") locale
  bumped Symfony version to 3.4.33
  updated VERSION for 3.4.32
  update CONTRIBUTORS for 3.4.32
  updated CHANGELOG for 3.4.32
2019-10-09 15:22:34 +02:00
Nicolas Grekas
6f58438f7c bug #33922 [Cache] remove implicit dependency on symfony/filesystem (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] remove implicit dependency on symfony/filesystem

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

/cc @andrerom for review

Commits
-------

85f27f270e [Cache] remove implicit dependency on symfony/filesystem
2019-10-09 15:16:32 +02:00
Nicolas Grekas
ac422dbd07 bug #33927 Allow to set SameSite config to 'none' (ihmels)
This PR was merged into the 4.3 branch.

Discussion
----------

Allow to set SameSite config to 'none'

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

Commits
-------

eec7e8cc61 Allow to set cookie_samesite to 'none'
2019-10-09 15:16:03 +02:00
Nicolas Grekas
49dfa8ac85 bug #33930 [Cache] clean tags folder on invalidation (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] clean tags folder on invalidation

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

/cc @andrerom for review :)

Commits
-------

b377e41a2c [Cache] clean tags folder on invalidation
2019-10-09 15:15:31 +02:00
Nicolas Grekas
b377e41a2c [Cache] clean tags folder on invalidation 2019-10-09 14:56:36 +02:00
Nicolas Grekas
85f27f270e [Cache] remove implicit dependency on symfony/filesystem 2019-10-09 12:18:12 +02:00
Yannick Ihmels
eec7e8cc61 Allow to set cookie_samesite to 'none' 2019-10-09 11:59:43 +02:00
Nicolas Grekas
02c571d9d3 bug #32980 [Dotenv] support setting default env var values (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Dotenv] support setting default env var values

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

Commits
-------

2dd41e7f24 [Dotenv] support setting default env var values
2019-10-09 09:20:53 +02:00
Christian Flothmann
2dd41e7f24 [Dotenv] support setting default env var values 2019-10-09 09:19:40 +02:00
Nicolas Grekas
0094884b17 feature #33851 [EventDispatcher] Allow to omit the event name when registering listeners (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] Allow to omit the event name when registering listeners

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | #33453 (kind of)
| License       | MIT
| Doc PR        | TODO

After #30801 and #33485, this is another attempt at taking advantage of FQCN events for simplifying the registration of event listeners by inferring the event name from the parameter type declaration of the listener. This is my last attempt, I promise. 🙈

This time, I'd like to make the `event` attribute of the `kernel.event_listener` tag optional. This would allow us to build listeners like the following one without adding any attributes to the `kernel.event_listener` tag.

```php
namespace App\EventListener;

final class MyRequestListener
{
    public function __invoke(RequestEvent $event): void
    {
        // do something
    }
}
```

This in turn allows us to register a whole namespace of such listeners without having to configure each listener individually:

```YAML
services:
    App\EventListener\:
        resource: ../src/EventListener/*
        tags: [kernel.event_listener]
```

Commits
-------

6f32584c76 [EventDispatcher] Allow to omit the event name when registering listeners.
2019-10-09 09:04:55 +02:00
Nicolas Grekas
332d9e9067 bug #33919 [VarDumper] fix array key error for class SymfonyCaster (zcodes)
This PR was squashed before being merged into the 4.3 branch (closes #33919).

Discussion
----------

[VarDumper] fix array key error for class SymfonyCaster

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

Commits
-------

1f20f35f74 [VarDumper] fix array key error for class SymfonyCaster
2019-10-09 08:54:10 +02:00
zcodes
1f20f35f74 [VarDumper] fix array key error for class SymfonyCaster 2019-10-09 08:53:52 +02:00
Bálint Szekeres
015eb6625c added image/svg MIME support 2019-10-08 14:15:27 +02:00
Nicolas Grekas
0d4914149d bug #33885 [Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available

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

For PHP >= 7.3, we should use [\DateTime::createFromImmutable()](https://www.php.net/manual/en/datetime.createfromimmutable.php) directly.

This patch also preserves the `\DateTime` microseconds when the conversion is done with `\DateTime::createFromFormat()`.

Commits
-------

dfa23034c3 [Form][DateTimeImmutableToDateTimeTransformer] Preserve microseconds and use \DateTime::createFromImmutable() when available
2019-10-08 13:04:26 +02:00
Nicolas Grekas
4223a5b361 bug #33900 [HttpKernel] Fix to populate $dotenvVars in data collector when not using putenv() (mynameisbogdan)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpKernel] Fix to populate $dotenvVars in data collector when not using putenv()

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT

Fix to populate $dotenvVars in data collector when not using putenv()

Before:
<img width="618" alt="Screen Shot 2019-10-08 at 03 53 49" src="https://user-images.githubusercontent.com/707714/66360303-49397280-e983-11e9-98b9-5272b9762dda.png">
After:
<img width="614" alt="Screen Shot 2019-10-08 at 03 55 43" src="https://user-images.githubusercontent.com/707714/66360304-4b9bcc80-e983-11e9-82de-46d484daa585.png">

Commits
-------

ca3fb258bf [HttpKernel] fix $dotenvVars in data collector
2019-10-08 13:02:48 +02:00
Nicolas Grekas
fbf55c2057 feature #33461 [Cache] Improve RedisTagAwareAdapter invalidation logic & requirements (andrerom)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Improve RedisTagAwareAdapter invalidation logic & requirements

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes, _and improvment_
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        |

Changes logic of invalidation in RedisTagAwareAdapter in order to:
- Delete the  tag key on invalidation => _avoiding possible left behind empty tag keys that Redis is not allowed to evict, gradually consuming more and more memory_

Positive side effects of no longer using sPOP:
- Lowered requirements to Redis 2.8, and no specific version constraint for phpredis
- Lift limitation of 2 billion keys per tag _(Now only limited by Redis Set datatype: 4 billion)_

Commits
-------

3d38c58b42 [Cache] Improve RedisTagAwareAdapter invalidation logic & requirements
2019-10-08 12:16:35 +02:00
André R
3d38c58b42 [Cache] Improve RedisTagAwareAdapter invalidation logic & requirements 2019-10-08 12:08:50 +02:00
Fabien Potencier
c281b3b248 minor #33907 [Validator] Adds missing translations for the Norwegian Bokmål ("nb") locale (Harald Tollefsen)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Adds missing translations for the Norwegian Bokmål ("nb") locale

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

Commits
-------

5baa3ea8d4 Adds missing translations for no nb
2019-10-08 11:22:35 +02:00
Harald Tollefsen
5baa3ea8d4 Adds missing translations for no nb 2019-10-08 11:13:14 +02:00
Fabien Potencier
986975469e minor #33893 [Validator] Add the missing translations for the Swedish ("sv") locale (terdia)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Swedish ("sv") locale

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

This PR adds missing Swedish ("sv") locale translations
 to [src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf](src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf) file.

Ref: https://github.com/symfony/symfony/issues/33629

Commits
-------

0db883888c Add the missing translations for the Swedish ("sv") locale
2019-10-08 07:50:00 +02:00
bogdan
ca3fb258bf [HttpKernel] fix $dotenvVars in data collector 2019-10-08 04:19:00 +03:00
Ogbemudia Terry Osayawe
0db883888c Add the missing translations for the Swedish ("sv") locale 2019-10-07 21:31:56 +02:00
Robin Chalas
e3b513b5a1 minor #33884 Prevent ProgressBar redraw when message is same (fmasa)
This PR was squashed before being merged into the 4.4 branch (closes #33884).

Discussion
----------

Prevent ProgressBar redraw when message is same

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

This PR prevents ProgressBar from performing unnecessary redrawes if new output is same as current one. This is mostly useful when working with multiple progress bars. Same behavior can enforced by carefully setting redraw frequency, but I don't see any downsides for smarter redrawing by default.

This can be moved to `if ($this->overwrite)` if necessary, so it's applied only in case overwriting is enabled.

Commits
-------

78b515f049 Prevent ProgressBar redraw when message is same
2019-10-07 18:46:30 +02:00