Commit Graph

47107 Commits

Author SHA1 Message Date
Thomas Calvet 3a840a9796 [Routing] Fix using a custom matcher & generator dumper class 2020-01-08 15:00:15 +01:00
Islam93 b3a2173c8e [DI] deferred exceptions in ResolveParameterPlaceHoldersPass 2020-01-08 14:20:51 +03:00
Fabien Potencier ad7d24109c minor #35081 [Notifier] Add more specific types at documentation level when php engine can't (Philippe Segatori)
This PR was squashed before being merged into the 5.0 branch (closes #35081).

Discussion
----------

[Notifier] Add more specific types at documentation level when php engine can't

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

This an example of the proposal made in #35078 to document a narrower type when php type declaration cannot.

Commits
-------

b9931f571c [Notifier] Add more specific types at documentation level when php engine can't
2020-01-08 10:13:33 +01:00
Philippe Segatori b9931f571c [Notifier] Add more specific types at documentation level when php engine can't 2020-01-08 10:13:26 +01:00
Fabien Potencier 9589dee808 bug #35252 [Serializer] Fix cache in MetadataAwareNameConverter (bastnic)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Fix cache in MetadataAwareNameConverter

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

`isset` is used to test existence of values that is `null` by default, which result to always bypass the cache and force to do the calculation all the time.

This is a serious perf improvement in prod mode for an api.

![image](https://user-images.githubusercontent.com/84887/71933779-38c3ae80-31a3-11ea-8871-8e57cec87a89.png)

![image](https://user-images.githubusercontent.com/84887/71933675-074ae300-31a3-11ea-8e84-7adad3e6c96f.png)

Commits
-------

6449f9299c [Serializer] Fix cache in MetadataAwareNameConverter
2020-01-08 08:58:38 +01:00
Bastien Jaillot 6449f9299c [Serializer] Fix cache in MetadataAwareNameConverter
`isset` is used to test existence of values that is
`null` by default, which result to always bypass the cache
and force to do the calculate all the time.

This is a critical perf improvement in prod mode for an api.

Ref #35085
2020-01-07 23:30:39 +01:00
Nicolas Grekas 1e4e0ec979 minor #35250 [HttpClient] Added missing sprintf (TiGR)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Added missing sprintf

It was supposed to be there.

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

Commits
-------

08c1481b88 [HttpClient] Added missing sprintf
2020-01-07 22:30:00 +01:00
naitsirch eb69e135b2 [Dotenv] Fixed infinite loop with missing quote followed by quoted value
If there's a quote missing to end a value and in the next line there's again a quoted value Dotenv will run into an infinite loop. An .env file with the following content will result in this error:
```
FOO="foo
BAR="bar"
```
See #34642 for more details.
2020-01-07 21:29:45 +01:00
Igor Tarasov 08c1481b88
[HttpClient] Added missing sprintf
It was supposed to be there.
2020-01-07 23:22:51 +03:00
Fabien Potencier b9cc0c8985 bug #35200 [TwigBridge] do not render preferred choices as selected (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] do not render preferred choices as selected

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

Commits
-------

c5b8190424 do not render preferred choices as selected
2020-01-07 20:31:57 +01:00
Fabien Potencier 290ce00f96 bug #35243 [HttpKernel] release lock explicitly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] release lock explicitly

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

Commits
-------

6fb55812ab [HttpKernel] release lock explicitly
2020-01-07 20:30:23 +01:00
Fabien Potencier aaf6915661 bug #35193 [TwigBridge] button_widget now has its title attr translated even if its label = null or false (stephen-lewis)
This PR was squashed before being merged into the 3.4 branch (closes #35193).

Discussion
----------

[TwigBridge] button_widget now has its title attr translated even if its label = null or false

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

Duplicate of #34436 but changed to bugfix and applied to 3.4. Buttons with null or false 'label' options will now have their 'title' attribute translated against the current translation domain.

Commits
-------

2a5d9cb75a [TwigBridge] button_widget now has its title attr translated even if its label = null or false
2020-01-07 20:28:14 +01:00
Stephen Lewis 2a5d9cb75a [TwigBridge] button_widget now has its title attr translated even if its label = null or false 2020-01-07 20:28:09 +01:00
Nicolas Grekas c4c0b84366 bug #35219 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script (oleg-andreyev)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script

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

Locally using [phpenv](https://github.com/phpenv/phpenv) together [phpenv-composer](https://github.com/ngyuki/phpenv-composer) with for managing php versions and composer installations.

`which composer` is detecting wrapper instead of binary.
Before appending PHP executable to composer path need to validate that detected composer is not a wrapper otherwise PHP will simply return the content of a wrapper

Commits
-------

25c805ed56 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
2020-01-07 20:24:08 +01:00
Oleg Andreyev 25c805ed56 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script 2020-01-07 20:24:01 +01:00
Fabien Potencier 47a866bf7b bug #35150 [Messenger] Added check if json_encode succeeded (toooni)
This PR was squashed before being merged into the 4.3 branch (closes #35150).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

Similar PR as https://github.com/symfony/symfony/pull/35137 but for branch 4.3.

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

c2bdc4c4d3 [Messenger] Added check if json_encode succeeded
2020-01-07 20:21:24 +01:00
Toni Rudolf c2bdc4c4d3 [Messenger] Added check if json_encode succeeded 2020-01-07 20:21:19 +01:00
Fabien Potencier 0942e336aa bug #35137 [Messenger] Added check if json_encode succeeded (toooni)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead (closes #35137).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

a16a574ca8 [Messenger] Added check if json_encode succeeded
2020-01-07 20:20:31 +01:00
Toni Rudolf a16a574ca8 [Messenger] Added check if json_encode succeeded 2020-01-07 20:20:25 +01:00
Fabien Potencier 7fa87b46e3 bug #35170 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/34865#discussion_r362432040
| License       | MIT
| Doc PR        | -

Outputing everything on stderr seems wrong. I'm going to check upper branches.

Commits
-------

87212e41b3 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr
2020-01-07 20:18:41 +01:00
Fabien Potencier 9e7a4102ad bug #35245 [HttpClient] fix exception in case of PSR17 discovery failure (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix exception in case of PSR17 discovery failure

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

On symfony.com, we need to use HTTPlug for 3rd party libs. When `nyholm/psr7` is not installed, we currently see an exception saying `No HTTPlug clients found.` from `HttpClientDiscovery`.

This fixes the message by correctly suggesting `nyholm/psr7` instead, since there *is* an HTTPlug client: `HttplugClient` from our HttpClient component.

It's quite unfortunate that `guzzle/psr7` provides no PSR17 factory yet, because that would have solved some part of this deps mess. /cc @Nyholm @sagikazarmark FYI
Note that https://packagist.org/providers/psr/http-factory-implementation lists `guzzle/psr7` but this is a wrong solution: no tagged release of it is PSR17-compatible, which means installing it doesn't solve the issue.

Commits
-------

96e70a4080 [HttpClient] fix exception in case of PSR17 discovery failure
2020-01-07 20:17:11 +01:00
Fabien Potencier ada4c56a91 bug #35244 [Cache] fix processing chain adapter based cache pool (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] fix processing chain adapter based cache pool

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

Commits
-------

8d7fa32d15 fix processing chain adapter based cache pool
2020-01-07 20:15:45 +01:00
Fabien Potencier 6eb024b103 bug #35247 [FrameworkBundle][ContainerLintCommand] Only skip .errored. services (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Only skip .errored. services

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

This PR partially reverts https://github.com/symfony/symfony/pull/34935 that was a kind of a mistake. Skipping all removed ids cannot work because all private services are in the "removed" ids. So the command ends up not validating much.

To still fix the original issue https://github.com/symfony/symfony/issues/34858 we need to skip errored services. However, definition errors are not dumped / read (see https://github.com/symfony/symfony/pull/34928). So instead, even if it's bad, we can maybe rely on the name for this particular error since it's hardcoded 😕 At least it fixes this case in a simple way 😕

Commits
-------

d38cdc9dce [FrameworkBundle][ContainerLintCommand] Only skip .errored. services
2020-01-07 20:14:23 +01:00
Fabien Potencier de34f229a9 minor #35213 [Security\Guard] Fix missing typehints (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security\Guard] Fix missing typehints

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

Commits
-------

2ef8771ad7 [Security\Guard] Fix missing typehints
2020-01-07 20:10:35 +01:00
Thomas Calvet d38cdc9dce [FrameworkBundle][ContainerLintCommand] Only skip .errored. services 2020-01-07 17:40:07 +01:00
Nicolas Grekas 96e70a4080 [HttpClient] fix exception in case of PSR17 discovery failure 2020-01-07 13:55:38 +01:00
Nicolas Grekas ffd5d12045 bug #35225 [DependencyInjection] Handle ServiceClosureArgument for callable in container linting (shieldo)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Handle ServiceClosureArgument for callable in container linting

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (+)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | (none)
| License       | MIT

Making use of `ServiceClosureArgument` instances in service definitions was not accounted for in container linting when a service type-hints for `callable` in an argument - adding this check ensures that `ServiceClosureArgument` instances are recognised correctly as callables (once they are resolved).

Commits
-------

e48829e9b6 [DependencyInjection] Handle ServiceClosureArgument for callable in container linting
2020-01-07 11:57:32 +01:00
Douglas Greenshields e48829e9b6 [DependencyInjection] Handle ServiceClosureArgument for callable in container linting 2020-01-07 11:57:22 +01:00
Christian Flothmann 8d7fa32d15 fix processing chain adapter based cache pool 2020-01-07 11:39:48 +01:00
Nicolas Grekas 6fb55812ab [HttpKernel] release lock explicitly 2020-01-07 11:19:31 +01:00
Robin Chalas 9b711b87fe [Security] Prevent canceled remember-me cookie from being accepted 2020-01-06 22:59:17 +01:00
Nicolas Grekas 8c9e27834d Merge branch '4.4' into 5.0
* 4.4:
  Fix closing tag in mailer collector template
  [HttpClient] Don't read from the network faster than the CPU can deal with
  [DI] DecoratorServicePass should keep container.service_locator on the decorated definition
2020-01-06 14:04:40 +01:00
Nicolas Grekas b9a0b33540 minor #35221 [WebProfilerBundle] Fix closing tag in mailer collector template (norkunas)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebProfilerBundle] Fix closing tag in mailer collector template

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -
<!--
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 master.
-->

Commits
-------

c2d2e5a61d Fix closing tag in mailer collector template
2020-01-06 14:00:05 +01:00
Nicolas Grekas fb2d2577d9 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] Don't read from the network faster than the CPU can deal with
  [DI] DecoratorServicePass should keep container.service_locator on the decorated definition
2020-01-06 13:57:54 +01:00
Nicolas Grekas f9b36c754d bug #35223 [HttpClient] Don't read from the network faster than the CPU can deal with (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Don't read from the network faster than the CPU can deal with

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

Something I spotted while working on #35115: both the curl and native clients don't play well with heavily compressed HTTP streams: they decompress faster than userland can process chunks.

The attached patch moves the decompression logic to the chunk generator. This means internally we only deal with raw compressed chunks, and they are decompressed only when passing the value to userland.

Commits
-------

ac3d77a76a [HttpClient] Don't read from the network faster than the CPU can deal with
2020-01-06 13:56:11 +01:00
Nicolas Grekas 6fb2d52077 bug #35214 [DI] DecoratorServicePass should keep container.service_locator on the decorated definition (malarzm)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] DecoratorServicePass should keep container.service_locator on the decorated definition

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/33670#issuecomment-569917301
| License       | MIT
| Doc PR        | -

`container.service_locator` is special because it tells how the arguments of the constructor should be interpreted.

/cc @malarzm

Commits
-------

99dab87ada [DI] DecoratorServicePass should keep container.service_locator on the decorated definition
2020-01-06 13:55:46 +01:00
Fabien Potencier f1c9a7c335 minor #35220 [Notifier] Fix two minor issues (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[Notifier] Fix two minor issues

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

Commits
-------

4f80d4d639 [Notifier] Fix two minor issues
2020-01-06 13:35:53 +01:00
Thomas Calvet 87212e41b3 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr 2020-01-06 12:26:45 +01:00
Tomas c2d2e5a61d Fix closing tag in mailer collector template 2020-01-06 13:23:58 +02:00
Thomas Calvet 4f80d4d639 [Notifier] Fix two minor issues 2020-01-06 11:24:48 +01:00
Nicolas Grekas ac3d77a76a [HttpClient] Don't read from the network faster than the CPU can deal with 2020-01-06 10:53:56 +01:00
Maciej Malarz 99dab87ada [DI] DecoratorServicePass should keep container.service_locator on the decorated definition 2020-01-04 20:22:46 +01:00
Robin Chalas 2ef8771ad7 [Security\Guard] Fix missing typehints 2020-01-04 19:57:41 +01:00
Nicolas Grekas 905db59b3a minor #35186 [FrameworkBundle] Fix getUser() phpdoc in AbstractController (natewiebe13)
This PR was merged into the 5.0 branch.

Discussion
----------

[FrameworkBundle] Fix getUser() phpdoc in AbstractController

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

This imports the `Symfony\Component\Security\Core\User\UserInterface` as the docs state that it returns `UserInterface` but doesn't use a FQN or import the class. This makes `getUser()` appear to return `Symfony\Bundle\FrameworkBundle\Controller\UserInterface`

Commits
-------

bba9fd6ccf [FrameworkBundle] Fix getUser() phpdoc in AbstractController
2020-01-04 15:13:44 +01:00
Nicolas Grekas f673cdc6e2 minor #35158 Update year in license files (rosier)
This PR was merged into the 5.0 branch.

Discussion
----------

Update year in license files

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

Happy new year Notifier and String

Commits
-------

ef4426ae87 Update year in license files
2020-01-04 15:09:07 +01:00
Nicolas Grekas 581b439931 Merge branch '4.4' into 5.0
* 4.4: (26 commits)
  [HttpClient] NativeHttpClient should not send >1.1 protocol version
  [HttpClient] fix support for non-blocking resource streams
  [Mailer] Make sure you can pass custom headers to Mailgun
  [Mailer] Remove line breaks in email attachment content
  Update links to documentation
  [Validator] Add the missing translations for the Arabic (ar) locale
  ensure to expect no validation for the right reasons
  [Security-Guard] fixed 35203 missing name tag in param docblock
  [HttpClient] fix casting responses to PHP streams
  [PhpUnitBridge] Add test case for @expectedDeprecation annotation
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
  [Mailer] Fix addresses management in Sendgrid API payload
  [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
  [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
  [HttpClient] fix capturing SSL certificates with NativeHttpClient
  Update year in license files
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  Update year in license files
  fix version when "anonymous: lazy" was introduced
  ...
2020-01-04 15:08:26 +01:00
Nicolas Grekas 9d4c98ee17 bug #35209 [HttpClient] fix support for non-blocking resource streams (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix support for non-blocking resource streams

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

Commits
-------

c651f63813 [HttpClient] fix support for non-blocking resource streams
2020-01-04 15:05:21 +01:00
Nicolas Grekas 75c24bbdde Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] NativeHttpClient should not send >1.1 protocol version
2020-01-04 15:04:37 +01:00
Nicolas Grekas ccfc4b67b3 bug #35210 [HttpClient] NativeHttpClient should not send >1.1 protocol version (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] NativeHttpClient should not send >1.1 protocol version

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

Commits
-------

8b61c95685 [HttpClient] NativeHttpClient should not send >1.1 protocol version
2020-01-04 15:04:26 +01:00
Nicolas Grekas 8b61c95685 [HttpClient] NativeHttpClient should not send >1.1 protocol version 2020-01-04 15:00:37 +01:00