Commit Graph

36734 Commits

Author SHA1 Message Date
Kévin Dunglas
f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation 2019-10-30 08:50:22 +01:00
Robin Chalas
81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Yonel Ceruto
2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

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

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau
5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas
d08273236c feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

Re-allow to use "tagged" in service definitions

| 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       | n/a
| License       | MIT
| Doc PR        | n/a

Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.

Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)

Commits
-------

7b7dc0df9a Re-allow to use "tagged" in service definitions
2019-10-29 15:17:53 +01:00
Kévin Dunglas
7b7dc0df9a
Re-allow to use "tagged" in service definitions 2019-10-29 15:11:25 +01:00
Kévin Dunglas
e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Grégoire Pineau
31c402a003 [VarDumper] Do not dump the EventDispatcher 2019-10-29 14:41:12 +01:00
Jérémy Derussé
2db24cf582
Add missing lock connection string in FrameworkExtension 2019-10-29 14:34:12 +01:00
Nicolas Grekas
e2c625e78b feature #34057 [Lock][Cache] Allows URL DSN in PDO adapters (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock][Cache] Allows URL DSN in PDO adapters

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

This PR duplicate a feature from PdoSessionHandler that convert URL DSN ( ie. mysql://localhost/test) into PDO DSN (ie. mysql:host=localhost;dbname=test)

that would ease configuration by using the same well-known variable
```
framework:
  lock: '%env(DATABASE_URL)%'
```

note: I applied the same change on Cache component for consistency.

Commits
-------

474daf976e Allows URL DSN in Lock and Cache
2019-10-29 14:07:00 +01:00
Nicolas Grekas
a302d2050e [DI] fix regexp for anonymous services with no class set 2019-10-29 12:56:37 +01:00
Kévin Dunglas
54d46eef67
[DomCrawler] normalizeWhitespace should be true by default 2019-10-29 12:38:30 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Nicolas Grekas
452c863639 [Cache] add DeflateMarshaller - remove phpredis compression 2019-10-29 11:36:36 +01:00
Kévin Dunglas
42be5f8132
Merge branch '4.3' into 4.4
* 4.3:
  [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:04:46 +01:00
Kévin Dunglas
ee4b99f227
bug #33828 [DoctrineBridge] Auto-validation must work if no regex are passed (dunglas)
This PR was squashed before being merged into the 4.3 branch (closes #33828).

Discussion
----------

[DoctrineBridge] Auto-validation must work if no regex are passed

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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
| License       | MIT
| Doc PR        | n/a

Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).

Commits
-------

5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:03:42 +01:00
Kévin Dunglas
5ed7d6c759
[DoctrineBridge] Auto-validation must work if no regex are passed 2019-10-29 11:03:05 +01:00
Robin Chalas
662b35e30e Merge branch '4.3' into 4.4
* 4.3:
  remove outdated workflow test
  drop wrong test (fix merge)
2019-10-29 04:34:23 +01:00
Robin Chalas
f233259c68 remove outdated workflow test 2019-10-29 03:10:02 +01:00
Robin Chalas
6c2253415f drop wrong test (fix merge) 2019-10-29 02:54:26 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Yonel Ceruto
cc2858f7d0 bug #34158 [ErrorRenderer] Security fix: hide sensitive error messages (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] Security fix: hide sensitive error messages

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

This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials.
For instance, PDO and Doctrine throw exception with message such as `The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)` revealing internal details about the infrastructure usful for an attacker.

Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see https://github.com/symfony/symfony/pull/33650#issuecomment-534441889). I'll try to open some PRs to do that in tomorrow.

Commits
-------

d7d7f22 [ErrorRenderer] Security fix: hide sensitive error messages
2019-10-28 19:43:36 -04:00
Kévin Dunglas
d7d7f22dbe [ErrorRenderer] Security fix: hide sensitive error messages 2019-10-28 19:37:55 -04:00
Robin Chalas
fd0ed42adb [Security] Fix merge 2019-10-28 23:18:08 +01:00
Nicolas Grekas
0f5a7b8b41 Merge branch '4.3' into 4.4
* 4.3:
  Fix an error message to be more accurate
2019-10-28 22:57:16 +01:00
Nicolas Grekas
7b3d5cd615 minor #34157 [OptionsResolver] Fix an error message to be more accurate (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3

Commits
-------

1be68a752a Fix an error message to be more accurate
2019-10-28 22:53:11 +01:00
Yonel Ceruto
1be68a752a Fix an error message to be more accurate 2019-10-28 16:59:01 -04:00
Nicolas Grekas
05f7f4e147 Merge branch '4.3' into 4.4
* 4.3:
  [OptionsResolve] Revert change in tests for a not-merged change in code
  [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
  [Workflow] Made the configuration more robust for the 'property' key
  [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
  #30432 fix an error message
  fix paths to detect code owners
  [HttpClient] ignore the body of responses to HEAD requests
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  [SecurityBundle] Fix wrong assertion
  Remove unused local variables in tests
  [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
  Make sure to collect child forms created on *_SET_DATA events
  [WebProfilerBundle] Improve display in Email panel for dark theme
  do not render errors for checkboxes twice
2019-10-28 21:30:34 +01:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

<!--
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/roadmap):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Ryan Weaver
01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context" 2019-10-28 13:18:09 -04:00
Nicolas Grekas
15f08553be [OptionsResolve] Revert change in tests for a not-merged change in code 2019-10-28 18:16:45 +01:00
Nicolas Grekas
6d5c91bb47 Merge branch '3.4' into 4.3
* 3.4:
  #30432 fix an error message
  fix paths to detect code owners
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  Remove unused local variables in tests
  Make sure to collect child forms created on *_SET_DATA events
  do not render errors for checkboxes twice
2019-10-28 18:07:32 +01:00
Nicolas Grekas
48533ff3f1 bug #34152 [Workflow] Made the configuration more robust for the 'property' key (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Made the configuration more robust for the 'property' key

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

Commits
-------

0c31ff007e [Workflow] Made the configuration more robust for the 'property' key
2019-10-28 17:55:19 +01:00
Nicolas Grekas
fd5b8def49 bug #34154 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected

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

A `304` is the final response code.
This PR implements the same logic as curl.

Commits
-------

50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
2019-10-28 17:53:30 +01:00
Nicolas Grekas
50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected 2019-10-28 16:45:56 +01:00
Massimiliano Arione
1dc7ce1159
add missing translation for 94 (it) 2019-10-28 16:39:28 +01:00
Ryan Weaver
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
This reverts commit 3d4e59a10b.
2019-10-28 11:14:08 -04:00
Grégoire Pineau
0c31ff007e [Workflow] Made the configuration more robust for the 'property' key 2019-10-28 15:45:57 +01:00
Nicolas Grekas
799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible 2019-10-28 10:20:18 +01:00
Mathias Arlaud
f167c77eaf Handle non existent decorated services 2019-10-28 09:31:16 +01:00
Nicolas Grekas
d9d16d2ce7 [FrameworkBundle] make SodiumVault report bad decryption key accurately 2019-10-27 17:21:30 +01:00
Jérémy Derussé
474daf976e
Allows URL DSN in Lock and Cache 2019-10-27 15:23:49 +01:00
Nicolas Grekas
0a1de38a5b cs fix 2019-10-27 13:36:05 +01:00
Nicolas Grekas
b5a47df0b9 feature #34020 [Security] Allow to stick to a specific password hashing algorithm (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Allow to stick to a specific password hashing algorithm

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

Allows using `argon2i`, `argon2id` and `bcrypt`.

Commits
-------

6712d1e504 [Security] Allow to set a fixed algorithm
2019-10-27 13:33:51 +01:00
Robin Chalas
6712d1e504 [Security] Allow to set a fixed algorithm 2019-10-27 13:32:13 +01:00
Nicolas Grekas
60a4d8dc7a [Security/Core] make encodedLength computation more generic 2019-10-27 11:16:45 +01:00
Robin Chalas
32b227d004 minor #34138 [Security/Core] add fast path when encoded password cannot match anything (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Core] add fast path when encoded password cannot match anything

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

Only `MessageDigestPasswordEncoder` and `Pbkdf2PasswordEncoder` need this fast path: the sodium and the native encoders already implement it natively.

When a migrating encoder is used, a failed password validation fallbacks to all encoders. This makes the process slower than needed currently.

Commits
-------

c57f8f7f93 [Security/Core] add fast path when encoded password cannot match anything
2019-10-27 11:11:28 +01:00
Nicolas Grekas
c57f8f7f93 [Security/Core] add fast path when encoded password cannot match anything 2019-10-27 10:41:22 +01:00
Fabien Potencier
22230f7b8e feature #34131 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault

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

Right now, env vars that override encrypted secrets must en up with `_SECRET`.
This PR removes this convention. It also enforces that only vars defined in the vault can be overriden locally. This means one cannot set a local-only secret.

Commits
-------

2ec9647e75 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault
2019-10-27 09:05:59 +01:00
Robin Chalas
3fdaf970c3 [Messenger] Fix redis test 2019-10-27 07:53:30 +01:00
Fabien Potencier
b54997d1df bug #34126 [VarDumper] fix infinite recursion (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] fix infinite recursion

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

Commits
-------

56d9f47857 [VarDumper] fix infinite recursion
2019-10-26 21:52:16 +02:00
Tobias Schultze
75c674debc [Messenger] fix retry of messages losing the routing key and properties 2019-10-26 20:28:54 +02:00
Nicolas Grekas
2ec9647e75 [FrameworkBundle] Remove suffix convention when using env vars to override secrets from the vault 2019-10-26 15:06:32 +02:00
Yonel Ceruto
fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro
7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Thomas Calvet
6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change 2019-10-26 12:43:57 +02:00
Yonel Ceruto
2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

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

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Fabien Potencier
8eb17aa203 bug #34076 [HttpKernel] Avoid nested exceptions if errors occur when generating file links (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Avoid nested exceptions if errors occur when generating file links

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

Multiple exceptions are fired until the fallback error page is rendered without the FileLinkFormatter:
48282ce80f/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php (L79-L86)

**Before** (the reproducer is highlighted inside the picture or simply adds an undefined option to the `@Route()` annotation)
![error-page-before](https://user-images.githubusercontent.com/2028198/67356903-c8a17700-f529-11e9-9384-12a29e17b682.png)

**After** (I couldn't find a better solution to display this exception once)
![error-page-after](https://user-images.githubusercontent.com/2028198/67356941-db1bb080-f529-11e9-8808-d7f72dadc4d6.png)

Commits
-------

d91a5a067d Avoid nested exceptions if errors occur when generating file links
2019-10-26 10:25:48 +02:00
Nicolas Grekas
56d9f47857 [VarDumper] fix infinite recursion 2019-10-26 10:24:21 +02:00
Fabien Potencier
591ad2203c bug #34090 [WebProfilerBundle] Improve display in Email panel for dark theme (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle] Improve display in Email panel for dark theme

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

Improve the email panel readability when using dark theme

## before
<img width="496" alt="Capture d’écran 2019-10-23 à 19 54 59" src="https://user-images.githubusercontent.com/4977112/67420667-5d11e500-f5cf-11e9-91c6-75d2f55a32e7.png">

## after
<img width="492" alt="Capture d’écran 2019-10-23 à 19 53 26" src="https://user-images.githubusercontent.com/4977112/67420679-626f2f80-f5cf-11e9-8762-ad56978c1ac8.png">

Commits
-------

402fed02e7 [WebProfilerBundle] Improve display in Email panel for dark theme
2019-10-26 10:23:07 +02:00
Christian Flothmann
ccc5667df8 minor #34100 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method

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

This method is internal and unused. It was removed by a2ae6bf745 but was added back mistakenly by 1baac5a74f.

Commits
-------

49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
2019-10-26 09:13:46 +02:00
Christian Flothmann
48d189b46b minor #34112 [SecurityBundle] Fix wrong assertion (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix wrong assertion

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

Commits
-------

8e56f46150 [SecurityBundle] Fix wrong assertion
2019-10-26 09:11:52 +02:00
Yonel Ceruto
f7a242d705 Fix web debug toolbar z-index property 2019-10-25 20:47:58 -04:00
Tobias Schultze
0e3bae28ec remove experimental added in 4.3 as bugfix 2019-10-25 15:44:38 +02:00
Tobias Schultze
c950130fc2 Merge branch '4.3' into 4.4 2019-10-25 15:41:20 +02:00
Fabien Potencier
6c08ac599e bug #34116 [HttpClient] ignore the body of responses to HEAD requests (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] ignore the body of responses to HEAD requests

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

Commits
-------

0fc371e7df [HttpClient] ignore the body of responses to HEAD requests
2019-10-25 15:21:40 +02:00
Nicolas Grekas
0fc371e7df [HttpClient] ignore the body of responses to HEAD requests 2019-10-25 15:08:37 +02:00
Tobias Schultze
c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

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

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00
Tobias Schultze
8bf8c50363 bug #32456 [Messenger] use database platform to convert correctly the DateTime (roukmoute)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] use database platform to convert correctly the DateTime

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32427
| License       | MIT

In Doctrine Messenger the method `\Symfony\Component\Messenger\Transport\Doctrine\Connection::formatDateTime()` is used to format dateTime into this: `Y-m-d\TH:i:s`.
But this is not supported in all databases platform.

Here we use the database platform to convert correctly the dateTime.

Commits
-------

cfa11561d1 Format DateTime depending on database platform
2019-10-25 12:57:14 +02:00
Robin Chalas
8e56f46150 [SecurityBundle] Fix wrong assertion 2019-10-25 10:35:42 +02:00
Mathias STRASSER
cfa11561d1
Format DateTime depending on database platform 2019-10-25 10:13:54 +02:00
Tobias Schultze
4a6ec8554e [Messenger] remove nullable max retries 2019-10-24 23:51:16 +02:00
Tobias Schultze
d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
by republishing the redelivered messages as retries with a retry limit and potential delay
2019-10-24 18:35:41 +02:00
Thomas Calvet
c07cee8f61 Remove unused local variables in tests 2019-10-24 17:33:53 +02:00
Nicolas Grekas
c5024bdbd0 feature #34051 [HttpClient] allow option "buffer" to be a stream resource (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] allow option "buffer" to be a stream resource

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

Commits
-------

e87301603e [HttpClient] allow option "buffer" to be a stream resource
2019-10-24 15:27:54 +02:00
Tristan Bessoussa
332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading 2019-10-24 13:56:35 +02:00
Thomas Calvet
49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method 2019-10-24 12:09:03 +02:00
Yonel Ceruto
50efc1a923 Make sure to collect child forms created on *_SET_DATA events 2019-10-23 15:46:41 -04:00
Anto
402fed02e7
[WebProfilerBundle] Improve display in Email panel for dark theme 2019-10-23 19:52:52 +02:00
Tobias Schultze
b9f69441c5 bug #32341 [Messenger] Show exceptions after multiple retries (TimoBakx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Show exceptions after multiple retries

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32311
| License       | MIT
| Doc PR        | n/a

After retrying a failed message, the `RedeliveryStamp` looses it's exception information. This PR will remedy that.

Commits
-------

598bd92313 [Messenger] Show exceptions on after empty fails
2019-10-23 16:09:27 +02:00
Timo Bakx
598bd92313 [Messenger] Show exceptions on after empty fails 2019-10-23 15:04:40 +02:00
Tobias Schultze
3dbe924f47 Revert "[Messenger] Fix exception message of failed message is dropped on retry"
This reverts commit 8f9f44eb21.
2019-10-23 13:26:24 +02:00
Nicolas Grekas
840f7e7d88 [Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined 2019-10-23 12:57:33 +02:00
Douglas Greenshields
6b7044fc01
[SecurityBundle] correct types for default arguments for firewall configs 2019-10-23 10:40:35 +01:00
Nicolas Grekas
bfd308ff4a bug #34078 [FrameworkBundle] Don't reset the test container but the real one instead (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Don't reset the test container but the real one instead

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

After #31202 and #32056, the tearDown method keeps throwing deprecation notices about "Getting the container from a non-booted kernel". The reason is that resetting the test-container calls `$kernel->getContainer()` while the kernel has been shut down.

This fixes it and a few other glitches found meanwhile.

Commits
-------

8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead
2019-10-23 11:00:45 +02:00
Nicolas Grekas
5d82cf3fca minor #34060 [SecurityBundle] test with doctrine-bundle 2 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] test with doctrine-bundle 2

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

Commits
-------

e3261f4f7f [SecurityBundle] test with doctrine-bundle 2
2019-10-23 10:59:42 +02:00
Nicolas Grekas
8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead 2019-10-23 09:54:59 +02:00
Yonel Ceruto
d91a5a067d Avoid nested exceptions if errors occur when generating file links 2019-10-23 00:12:13 -04:00
Yonel Ceruto
e07a3d7bba Import missing classes 2019-10-22 22:46:01 -04:00
Fabien Potencier
28c9f48f7e bug #34072 [Debug] remove return types that break FC badly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] remove return types that break FC badly

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

The return type on Debug's FlattenException blocks creating a child class that is compatible with both v4.4 and v5.0.
Removing it fixes the issue with no BC break.
Adding `final` on `setPrevious` will allow updating its type hint in v5.0.

Commits
-------

cb5ef6ec18 [Debug] remove return types that break FC badly
2019-10-22 19:09:30 +02:00
Nicolas Grekas
cb5ef6ec18 [Debug] remove return types that break FC badly 2019-10-22 18:54:09 +02:00
Fabien Potencier
f00390ffd7 minor #33963 Add .gitignore to .gitattributes (reedy)
This PR was merged into the 4.4 branch.

Discussion
----------

Add .gitignore to .gitattributes

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

Commits
-------

246c5fdf43 Add .gitignore to .gitattributes
2019-10-22 17:44:54 +02:00
Fabien Potencier
8c5403e2dc bug #34015 [Mailer] Fix typo (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- 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 #34006
| License       | MIT
| Doc PR        | n/a

The XML is different depending on the way we are sending email. So, it's `SendEmailResult` when using the API and `SendRawEmailResult` when using the HTTP class (we are then sending the raw email).

Commits
-------

4bd7cb0368 [Mailer] Fix SES Message Id retrieval
2019-10-22 17:36:06 +02:00
Fabien Potencier
4f9d449885 feature #34028 [ExpressionLanguage][Lexer] Exponential format for number (tigr1991)
This PR was merged into the 4.4 branch.

Discussion
----------

[ExpressionLanguage][Lexer] Exponential format for number

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991

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

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Expressions:
0.1e+2 = 10
1e-2 = 0.01
(1 + 1.99E+3) = 1991
and etc...

Commits
-------

430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
2019-10-22 17:29:53 +02:00
Fabien Potencier
2931227cad bug #34034 [Mailer][MailchimpBridge] Don't send address names if empty string (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Don't send address names if empty string

| 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       | https://github.com/symfony/symfony/pull/34029#issuecomment-543804450 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string
2019-10-22 17:26:22 +02:00
Fabien Potencier
effae8a643 bug #34067 Use port 465 for SES SMTP transport (rimas-kudelis)
This PR was merged into the 4.4 branch.

Discussion
----------

Use port 465 for SES SMTP transport

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

Commits
-------

8492e260cb Use port 465 for SES SMTP transport
2019-10-22 17:23:40 +02:00
Fabien Potencier
591c71bb7e bug #34066 [Messenger] Fix worker-only Doctrine middleware from running always (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix worker-only Doctrine middleware from running always

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (or 4.3?, this is a bug fix)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32436 Depends on #34069
| License       | MIT
| Doc PR        | not needed

Several Doctrine middleware are only meant to be run in a "worker" context: we want to "ping" the connection, "close" the connection and "clear" the entity manager ONLY when we are receiving messages. Before this PR, it was done always, which causes bad behavior for sync messages (imagine your Doctrine connection being closed in the middle of a controller or see https://github.com/symfony/symfony/pull/31334#issuecomment-544288437).

This fixes that in a pragmatic way: no new system for "worker-only" middleware or anything like that: just make the middleware smart enough to only do their work when a message is being received async.

Commits
-------

290a72917b Fixing issue where worker-only middleware were run in all contexts
2019-10-22 17:22:21 +02:00
Fabien Potencier
eaaabb6011 bug #34070 [ErrorRenderer] FlattenException cannot be final (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] FlattenException cannot be final

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

Making it final forces tight coupling with the implementation as soon as one type-hints for the class.

That's a blocker on making e.g. `EasyAdminBundle` compatible with Symfony 5.

Commits
-------

b125835056 [ErrorRenderer] FlattenException cannot be final
2019-10-22 17:21:28 +02:00
Nicolas Grekas
b125835056 [ErrorRenderer] FlattenException cannot be final 2019-10-22 17:18:31 +02:00
Ryan Weaver
290a72917b Fixing issue where worker-only middleware were run in all contexts 2019-10-22 10:54:25 -04:00
Ryan Weaver
3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick 2019-10-22 10:49:37 -04:00
Rimas Kudelis
8492e260cb Use port 465 for SES SMTP transport
Fixes #34064
2019-10-22 16:29:52 +03:00
Nicolas Grekas
e3261f4f7f [SecurityBundle] test with doctrine-bundle 2 2019-10-22 11:22:01 +02:00
Nicolas Grekas
5da67f9126 minor #34052 [HttpClient] skip tests implemented in 4.4 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] skip tests implemented in 4.4

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

Needed after #34051 and #34044

Commits
-------

ae86ab18fa [HttpClient] skip tests implemented in 4.4
2019-10-22 08:53:15 +02:00
Nicolas Grekas
ec8e34f05e minor #34050 [VarDumper] improve displaying cut closures (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] improve displaying cut closures

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

Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label.

Commits
-------

2b0a11de02 [VarDumper] improve displaying cut closures
2019-10-22 08:52:31 +02:00
Nicolas Grekas
ebca10e252 minor #34036 [Lock] Set ReturnType of LockFactory to LockInterface (alexander-schranz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Set ReturnType of LockFactory to LockInterface

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

LockFactory I think should return a LockInterface and not the Lock class.

/cc @chalasr

Commits
-------

ff1fa57ef2 Set ReturnType of LockFactory to LockInterface
2019-10-22 08:44:12 +02:00
Nicolas Grekas
c86271e750 minor #34027 [EventDispatcher] handle lazy-callable invokable (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] handle lazy-callable invokable

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

Extracted from #34013, for consistency mostly.

Commits
-------

9df4c7d32b [EventDispatcher] handle lazy-callable invokable
2019-10-22 08:42:51 +02:00
Nicolas Grekas
5d097d2eb5 bug #34021 [TwigBridge] do not render errors for checkboxes twice (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not render errors for checkboxes twice

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

Commits
-------

9eddea97d8 do not render errors for checkboxes twice
2019-10-22 08:41:35 +02:00
Nicolas Grekas
3d12e46692 [DI] made the %env(base64:...)% processor able to decode base64url 2019-10-22 08:40:11 +02:00
Nicolas Grekas
13e15e2112 bug #34017 [Messenger] Fix ignored options in redis transport (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix ignored options in redis transport

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

Also fixes redis authentication failure handling (inline with invalid db index handling, borrowed from symfony/cache).
/cc @alexander-schranz

Commits
-------

c83ff94c37 [Messenger] Fix ignored options in redis transport
2019-10-22 08:39:15 +02:00
Nicolas Grekas
f5cef028f8 Merge branch '4.3' into 4.4
* 4.3:
  Fix small typo in Exception message
2019-10-22 08:26:21 +02:00
Nicolas Grekas
afbbea3d1b Merge branch '3.4' into 4.3
* 3.4:
  Fix small typo in Exception message
2019-10-22 08:25:19 +02:00
Nicolas Grekas
bbafd76c6c bug #34055 [Console] Revert wrong change (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Revert wrong change

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

This partially reverts #34012 as it breaks uses cases like this:

```
echo "foo\nbar\n" | SHELL_INTERACTIVE=1 symfony console something
```

Commits
-------

f592322251 [Console] Revert wrong change
2019-10-22 08:21:53 +02:00
Fabien Potencier
f592322251 [Console] Revert wrong change 2019-10-22 08:15:10 +02:00
Nicolas Grekas
ae86ab18fa [HttpClient] skip tests implemented in 4.4 2019-10-21 18:09:12 +02:00
Nicolas Grekas
e87301603e [HttpClient] allow option "buffer" to be a stream resource 2019-10-21 18:05:25 +02:00
Nicolas Grekas
2b0a11de02 [VarDumper] improve displaying cut closures 2019-10-21 17:47:54 +02:00
Yanick Witschi
bbb8ed11ff [HttpClient] Add a canceled state to the ResponseInterface 2019-10-21 17:46:23 +02:00
Menno Holtkamp
7c2b974e26 Fix small typo in Exception message 2019-10-21 17:42:36 +02:00
Fabien Potencier
16d528504c feature #33997 [FrameworkBundle] Add secrets:* commands and %env(secret:...)% processor to deal with secrets seamlessly (Tobion, jderusse, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Add `secrets:*` commands and `%env(secret:...)%` processor to deal with secrets seamlessly

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #27351
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/11396

This PR continues #31101, please see there for previous discussions. The attached patch has been fine-tuned on https://github.com/nicolas-grekas/symfony/pull/33 with @jderusse.

This PR is more opinionated and thus a lot simpler than #31101: only Sodium is supported to encrypt/decrypt (polyfill possible), and only local filesystem is available as a storage, with little to no extension point. That's on purpose: the goal here is to provide an experience, not software building blocks. In 5.1, this might be extended and might lead to a new component, but we'd first need reports from real-world needs. Having this straight-to-the-point in 4.4 will allow gathering these needs (if they exist) and will immediately provide a nice workflow for the need we do want to solve now: forwarding secrets from dev to prod using git in a secure way.

The workflow this will allow is the following:
- public/private key pairs are generated in the `config/secrets/%kernel.environment%/` folder using `bin/console secrets:generate-keys`
- for the prod env, the corresponding private key should be deployed to the server using whatever means the hosting provider allows - this key MUST NOT be committed
- the public key is used to encrypt secrets and thus *may* be committed in the git repository to allow anyone *that can commit* to add secrets - this is done using `bin/console secrets:set`

DI configuration can reference secrets using `%env(secret:...)%` in e.g `services.yaml`.
There is also `bin/console secrets:remove` and `bin/console debug:secrets` to complete the toolbox.

In terms of design, vs #31101, this groups the dual "encoder" + "storage" concepts in a single "vault" one. That's part of what makes this PR simpler.

That's all folks :)

Commits
-------

c4653e1f65 Restrict secrets management to sodium+filesystem
02b5d740e5 Add secrets management
8c8f62390a Proof of concept for encrypted secrets
2019-10-20 21:11:11 +02:00
Fabien Potencier
c50d0b6d1c Merge branch '4.3' into 4.4
* 4.3:
  [HttpKernel] fix wrong removal of the just generated container dir
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
  [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-20 14:38:12 +02:00
Fabien Potencier
5ce78ccbe1 Merge branch '3.4' into 4.3
* 3.4:
  [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:37:59 +02:00
Fabien Potencier
b38bde9cb1 bug #34041 [HttpKernel] fix wrong removal of the just generated container dir (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix wrong removal of the just generated container dir

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

The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.

/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)

Commits
-------

4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:36:59 +02:00
Nicolas Grekas
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir 2019-10-20 12:02:53 +02:00
Nicolas Grekas
c4653e1f65 Restrict secrets management to sodium+filesystem 2019-10-19 20:26:39 +02:00
Nicolas Grekas
568f4b4094 Merge branch '3.4' into 4.3
* 3.4:
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
2019-10-19 15:08:51 +02:00
Nicolas Grekas
a54ecb0fae bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:07:56 +02:00
Nicolas Grekas
4bd16d884a bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:04:41 +02:00
Gerhard Seidel
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty 2019-10-19 15:03:42 +02:00
Christian Flothmann
d91b87f483 bump Form component compatibility versions 2019-10-19 10:26:53 +02:00
Christian Flothmann
ff904f3ac0 Merge branch '4.3' into 4.4
* 4.3:
  execute all compatible tests across versions
2019-10-19 10:25:26 +02:00
Christian Flothmann
18cc561754 execute all compatible tests across versions 2019-10-19 10:14:32 +02:00
Alexander Schranz
ff1fa57ef2
Set ReturnType of LockFactory to LockInterface 2019-10-18 21:16:41 +02:00
Maxime Steinhausser
197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string 2019-10-18 18:16:47 +02:00
Maxime Steinhausser
f14d082fad [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths 2019-10-18 16:57:15 +02:00
Ivan
430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991
2019-10-18 16:56:45 +03:00
Jérémy Derussé
02b5d740e5 Add secrets management 2019-10-18 14:46:38 +02:00
Tobias Schultze
8c8f62390a Proof of concept for encrypted secrets 2019-10-18 14:46:38 +02:00
Nicolas Grekas
ccb03650a2 [DI] add LazyString for lazy computation of string values injected into services 2019-10-18 14:17:42 +02:00
Nicolas Grekas
9df4c7d32b [EventDispatcher] handle lazy-callable invokable 2019-10-18 14:16:09 +02:00
Nicolas Grekas
f771faf925 Merge branch '4.3' into 4.4
* 4.3:
  [Dotenv] allow LF in single-quoted strings
  [Yaml] Throw exception for tagged invalid inline elements
  [Mailer] Fix Mandrill Transport API payload with named addresses
2019-10-18 13:24:32 +02:00
Nicolas Grekas
0b4c37a36c Merge branch '3.4' into 4.3
* 3.4:
  [Dotenv] allow LF in single-quoted strings
  [Yaml] Throw exception for tagged invalid inline elements
2019-10-18 13:23:15 +02:00
Fabien Potencier
a054d88830 bug #34023 [Dotenv] allow LF in single-quoted strings (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Dotenv] allow LF in single-quoted strings

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

in a shell:
```sh
FOO='bar
baz'
```

is legal to set a value to (in PHP):
```php
"bar\nbaz"
```

Commits
-------

4d79116a0d [Dotenv] allow LF in single-quoted strings
2019-10-18 13:17:48 +02:00
Nicolas Grekas
4d79116a0d [Dotenv] allow LF in single-quoted strings 2019-10-18 12:00:34 +02:00
Christian Flothmann
52f8fc839c bug #33818 [Yaml] Throw exception for tagged invalid inline elements (gharlan)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] Throw exception for tagged invalid inline elements

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

At the moment the result for `!foo 'don't do somthin' like that'` is a `TaggedValue` with value "don".

Commits
-------

bed479c561 [Yaml] Throw exception for tagged invalid inline elements
2019-10-18 11:15:32 +02:00
Christian Flothmann
9eddea97d8 do not render errors for checkboxes twice 2019-10-18 10:33:13 +02:00
Robin Chalas
c83ff94c37 [Messenger] Fix ignored options in redis transport 2019-10-17 20:40:26 +02:00
Fabien Potencier
4bd7cb0368 [Mailer] Fix SES Message Id retrieval 2019-10-17 16:20:58 +02:00
Robin Chalas
b9ba0c5e86 minor #34012 Replace STDIN by php://stdin (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Replace STDIN by php://stdin

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

`STDIN` is SAPI-dependent.

Commits
-------

365d02be77 Replace STDIN by php://stdin
2019-10-17 15:41:25 +02:00
Nicolas Grekas
365d02be77 Replace STDIN by php://stdin 2019-10-17 14:23:42 +02:00
Gregor Harlan
bed479c561
[Yaml] Throw exception for tagged invalid inline elements 2019-10-16 00:10:41 +02:00
Michaël Perrin
6dbac13a07 [Mailer] Fix Mandrill Transport API payload with named addresses 2019-10-15 15:11:00 -05:00
Nicolas Grekas
ea52d1cea2 [HttpClient] improve StreamWrapper 2019-10-15 17:38:24 +02:00
Nicolas Grekas
cbc4efc345 [HttpKernel] fix leftover 2019-10-15 15:39:57 +02:00
Nicolas Grekas
fdb9181d67 Remove legacy changelog lines 2019-10-15 15:33:13 +02:00
Christian Flothmann
71a0b9b30b extend legacy exception for backwards compatibility 2019-10-15 15:25:17 +02:00
Nicolas Grekas
3723d03663 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] workaround curl_multi_select() issue
  [CI] fix building local packages
  Increase limits for flakey appveyor tests
2019-10-15 14:38:35 +02:00
Nicolas Grekas
e635491c96 [HttpClient] workaround curl_multi_select() issue 2019-10-15 14:30:03 +02:00
Fabien Potencier
62533690d5 feature #33961 [TwigBridge] Add show-deprecations option to the lint:twig command (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Add show-deprecations option to the lint:twig command

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #33957 (partially)
| License       | MIT
| Doc PR        | TODO

![lint-twig-deprecations](https://user-images.githubusercontent.com/2028198/66682028-fe994e00-ec41-11e9-91f3-43885c9ee48b.png)

Commits
-------

a676c7e4f7 Add show-deprecations option to lint:twig command
2019-10-14 21:50:00 +02:00
Nicolas Grekas
46e94d9425 feature #33973 [HttpClient] add HttpClient::createForBaseUri() (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] add HttpClient::createForBaseUri()

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

I've seen ppl use `HttpClient::create()` with default `base_uri` & `auth_bearer`. That's a security risk as the bearer would be sent to any hosts that the client requests.

Instead, ppl should use `ScopingHttpClient`.

The new method should help to discover and use it.

Commits
-------

1aa9a118d6 [HttpClient] add HttpClient::createForBaseUri()
2019-10-14 16:15:04 +02:00
Nicolas Grekas
ff3e32c442 bug #33966 [FrameworkBundle] Improve the sorting of tagged services (krome162504)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Improve the sorting of tagged services

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

Little DX improvement, to sort the tags inside each service tagged.
More details in linked issue.

Commits
-------

f892289351 [FrameworkBundle] Improve the sorting of tagged services
2019-10-14 15:11:20 +02:00
Nicolas Grekas
6b3bbe4cc2 minor #33969 Increase limits for flakey appveyor tests (ostrolucky)
This PR was merged into the 4.3 branch.

Discussion
----------

Increase limits for flakey appveyor tests

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

See https://ci.appveyor.com/project/fabpot/symfony/builds/28063471 and https://ci.appveyor.com/project/fabpot/symfony/builds/27945625

Commits
-------

8a04886f26 Increase limits for flakey appveyor tests
2019-10-14 15:09:55 +02:00
Nicolas Grekas
85c106558d feature #33980 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] try using php-http/discovery when nyholm/psr7 is not installed

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

In case one has `php-http/discovery`, we can leverage it...

Commits
-------

6e0cb581a1 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed
2019-10-14 15:04:42 +02:00
Yonel Ceruto
a676c7e4f7 Add show-deprecations option to lint:twig command 2019-10-14 08:41:58 -04:00
Christian Flothmann
ae808b0a74 Merge branch '4.3' into 4.4
* 4.3:
  fix PHP 5.6 compatibility
  [Cache] fixed TagAwareAdapter returning invalid cache
  Add plus character `+` to legal mime subtype
  Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
  bug #33942 [DI] Add extra type check to php dumper
  [Dotenv] search variable values in ENV first then env file
  [PropertyInfo] Respect property name case when guessing from public method name
  [VarDumper] fix resetting the "bold" state in CliDumper
  Missing argument in method_exists
  SCA: added missing break in a loop
2019-10-14 14:27:06 +02:00
Christian Flothmann
eb5e01e063 Merge branch '3.4' into 4.3
* 3.4:
  fix PHP 5.6 compatibility
  [Cache] fixed TagAwareAdapter returning invalid cache
  [PropertyInfo] Respect property name case when guessing from public method name
2019-10-14 14:12:55 +02:00
Nicolas Grekas
a876748d93 [Serializer] fix typo 2019-10-14 13:43:44 +02:00
Nicolas Grekas
6e0cb581a1 [HttpClient] try using php-http/discovery when nyholm/psr7 is not installed 2019-10-14 12:53:45 +02:00
Julien Turby
f892289351 [FrameworkBundle] Improve the sorting of tagged services 2019-10-14 09:29:16 +04:00
Fabien Potencier
805449d1f4 feature #33967 [Mailer] Add Message-Id to SentMessage when sending an email (fabpot)
This PR was squashed before being merged into the 4.4 branch (closes #33967).

Discussion
----------

[Mailer] Add Message-Id to SentMessage when sending an email

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

This adds `SentMessage::getMessageId()` to retrieve the message id as generated internally OR by the provider sending the email.

Commits
-------

d97d1f9bb4 [Mailer] Fix Message ID for Postmark SMTP
b42c269760 Add Message-Id to SentMessage when sending an email
2019-10-13 21:48:43 +02:00
Fabien Potencier
004ee73665 feature #33896 [Serializer][CSV] Add context options to handle BOM (malarzm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer][CSV] Add context options to handle BOM

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #33684
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12461

This allows BOM handling in en/decoded CSV files. To keep current behaviour intact both skipping BOM at the beginning of the CSV and outputting BOM are an opt-in feature.

Personally I'd propose to make `SKIP_INPUT_BOM` default to `false` in 5.0 so the BOM is transparent and people that for some reasons expect BOM characters to be present in the parsed text explicitly opt-out of trimming it.

Commits
-------

3eb36684d8 Add context options to handle BOM
2019-10-13 21:13:17 +02:00
Christian Flothmann
5c82d301a7 fix PHP 5.6 compatibility 2019-10-13 20:43:12 +02:00
Nicolas Grekas
1aa9a118d6 [HttpClient] add HttpClient::createForBaseUri() 2019-10-13 19:52:56 +02:00
Nicolas Grekas
8230a1543e Make it really work on real apps 2019-10-13 15:20:26 +02:00
Gabriel Ostrolucký
8a04886f26
Increase limits for flakey appveyor tests 2019-10-13 14:02:04 +02:00
Maciej Malarz
3eb36684d8 Add context options to handle BOM 2019-10-13 10:45:12 +02:00
Fabien Potencier
0065f7579b bug #33948 [PropertyInfo] Respect property name case when guessing from public method name (antograssiot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyInfo] Respect property name case when guessing from public method name

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

Using camelCase, with an attribute `$aFooBar`, naming the getter/setter `getAFooBar()`/`setAFooBar()`,  returns the property name as AFooBar instead of aFooBar.

# Before
Property name `'AFooBar'`

# After
Property name `'aFooBar'` as expected

Commits
-------

843bb76f8a [PropertyInfo] Respect property name case when guessing from public method name
2019-10-13 10:38:57 +02:00
Fabien Potencier
d97d1f9bb4 [Mailer] Fix Message ID for Postmark SMTP 2019-10-13 09:31:33 +02:00
Guilhem Niot
4b3e9d4c96 Fix comments, improve the feature 2019-10-12 12:35:35 +02:00
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
1201085f72 bug #33962 [Cache] fixed TagAwareAdapter returning invalid cache (v-m-i)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fixed TagAwareAdapter returning invalid cache

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

This PR fixes `TagAwareAdapter` returning `CacheItem` when item-tags pair is missing tag key in pool. Currently `TagAwareAdapter` returns `CacheItem` with empty tags and `isHit` set to `true`. With this PR it returns `CacheItem` with `isHit` set to `false` as we can't know if item is valid or invalid when it's missing tag entry so we treat it as cache miss.

Commits
-------

946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache
2019-10-12 11:36:31 +02:00
Vedran Mihočinec
946f0a1e11 [Cache] fixed TagAwareAdapter returning invalid cache 2019-10-12 11:36:03 +02:00
Nicolas Grekas
6f54733a9c minor #33964 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract (reedy)
This PR was merged into the 4.3 branch.

Discussion
----------

Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract

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

Commits
-------

c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
2019-10-12 11:16:01 +02:00
Nicolas Grekas
831b00ff89 bug #33958 [DI] Add extra type check to php dumper (gquemener)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Add extra type check to php dumper

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

This PR adds a missing type check in the PHP Dumper. The bug has been detected while working on the https://github.com/prooph/service-bus-symfony-bundle and I haven't been able to reproduce it within a minimalist testcase.

I would like to add a unit test to cover it once I have figured out the exact context in which the bug occurs.

Any help would be greatly appreciated to do so, especially from "senior" contributors of the DependencyInjection component, many thanks in advance!

You will find more information about this bug in the linked ticket above.

Commits
-------

b17ebdf081 bug #33942 [DI] Add extra type check to php dumper
2019-10-12 11:12:58 +02:00
Nicolas Grekas
8d8a10c699 Merge branch '3.4' into 4.3
* 3.4:
  Add plus character `+` to legal mime subtype
  [Dotenv] search variable values in ENV first then env file
  [VarDumper] fix resetting the "bold" state in CliDumper
  SCA: added missing break in a loop
2019-10-12 11:11:50 +02:00
Ilia Lazarev
56895f12b9 Add plus character + to legal mime subtype
For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip`
2019-10-12 10:55:17 +02:00
Nicolas Grekas
ea0be07a33 [HttpClient] resolve promise chains on HttplugClient::wait() 2019-10-12 10:50:39 +02:00
Fabien Potencier
b42c269760 Add Message-Id to SentMessage when sending an email 2019-10-12 10:43:49 +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
Reedy
c2dd804a24 Make Symfony\Contracts\Service\Test\ServiceLocatorTest abstract
Also make getServiceLocator protected

As per https://github.com/symfony/symfony/issues/33946#issuecomment-541100439
2019-10-12 01:38:35 +01:00
Reedy
246c5fdf43 Add .gitignore to .gitattributes 2019-10-12 01:35:04 +01:00
Nicolas Grekas
0613c227ec [Cache] fix 2RTT + race condition in AbstractTagAwareAdapter::deleteItems() 2019-10-11 20:45:35 +02:00
Gildas Quéméner
b17ebdf081
bug #33942 [DI] Add extra type check to php dumper 2019-10-11 18:58:45 +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
soufianZantar
3018041782 [Dotenv] search variable values in ENV first then env file 2019-10-11 15:36:17 +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
49ad46e283 bug #33943 [VarDumper] fix resetting the "bold" state in CliDumper (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix resetting the "bold" state in CliDumper

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

Commits
-------

21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper
2019-10-11 15:34:05 +02:00
Nicolas Grekas
5a4a30c6ef [Cache] add TagAwareMarshaller to optimize data storage when using AbstractTagAwareAdapter 2019-10-11 14:17:27 +02:00
Anto
843bb76f8a
[PropertyInfo] Respect property name case when guessing from public method name 2019-10-11 06:14:16 +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
21645a5b96 [VarDumper] fix resetting the "bold" state in CliDumper 2019-10-10 13:03:19 +02:00
Nicolas Grekas
6e7f3257ce [HttpClient] fix merge 2019-10-10 10:55:24 +02:00
detinkin
d2a8e94c79 Missing argument in method_exists 2019-10-10 10:41:55 +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
Yonel Ceruto
928363c408 Keeping backward compatibility with legacy FlattenException usage 2019-10-09 19:29:06 -04:00
Vladimir Reznichenko
6af04bbac6 SCA: added missing break in a loop 2019-10-09 21:00:06 +02: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
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
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
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
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
Harald Tollefsen
5baa3ea8d4 Adds missing translations for no nb 2019-10-08 11:13:14 +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
František Maša
78b515f049 Prevent ProgressBar redraw when message is same 2019-10-07 18:46:23 +02:00
Nicolas Grekas
cdc7446051 [DI] enable improved syntax for defining method calls in Yaml 2019-10-07 18:41:11 +02:00
Fabien Potencier
a4f90e8258 bumped Symfony version to 4.3.6 2019-10-07 17:19:44 +02:00
Fabien Potencier
a87f8f983a updated VERSION for 4.3.5 2019-10-07 17:06:41 +02:00
Fabien Potencier
dce0c183b4 bug #33742 [Crawler] document $default as string|null (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Crawler] document $default as string|null

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

This has been introduced in 4.3

Commits
-------

e96add4787 [Crawler] document $default as string|null
2019-10-07 16:56:32 +02:00
Fabien Potencier
e3624e7086 bumped Symfony version to 3.4.33 2019-10-07 16:51:28 +02:00
Fabien Potencier
83b90c2e00 updated VERSION for 3.4.32 2019-10-07 16:41:56 +02:00
Fabien Potencier
38b3dc898e bug #32308 [Messenger] DoctrineTransport: ensure auto setup is only done once (bendavies)
This PR was squashed before being merged into the 4.3 branch (closes #32308).

Discussion
----------

[Messenger] DoctrineTransport: ensure auto setup is only done once

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Setup is done for every invocation of `get`, `find`, and `findAll`.

For `get`, this causes message consumption to be very slow, as slow as 1 message per second on my moderately sized schema, because a schema diff is done in `setup` every `get`.

I'm not sure what the desired behaviour is here, but it seems like we should try performing a query, fail once, `setup`, and retry. This will the same approach taken by the PDO Cache.

However, we still need auto setup in `get`, as `get` starts a transaction, so the auto setup in `executeQuery` won't be called.

Further more, the same problem seems to exist for the AMPQ Transport, but the performance impact should be less there, but i have not tried.

Commits
-------

02414027e1 [Messenger] DoctrineTransport: ensure auto setup is only done once
2019-10-07 16:35:38 +02:00
Ben Davies
02414027e1 [Messenger] DoctrineTransport: ensure auto setup is only done once 2019-10-07 16:35:32 +02:00
Alexander M. Turek
6f32584c76 [EventDispatcher] Allow to omit the event name when registering listeners. 2019-10-07 15:29:43 +02:00