Commit Graph

49990 Commits

Author SHA1 Message Date
Fabien Potencier 4d6ea775b7 bug #37966 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response

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

The current message is `TypeError: Argument 4 passed to Symfony\Component\HttpClient\Response\MockResponse::fromRequest() must implement interface Symfony\Contracts\HttpClient\ResponseInterface, instance of Generator given`.

I lost some time with this because I was passing a callable that returns a \Generator instead of passing the resulting \Generator directly. We could support that case but I guess with the added exception message, it is clear we don't support it at all.

Commits
-------

564dce39f8 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response
2020-08-30 08:55:38 +02:00
Fabien Potencier 943cbd804e minor #37967 [FrameworkBundle] Do not pass the base uri twice to scoped http clients (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Do not pass the base uri twice to scoped http clients

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

I looked at my dumped scoped http client PHP file and I noticed the base uri was passed two times. I thought there was a bug somewhere in my configuration. Actually, we only need to pass it as the method argument here.

Commits
-------

e2fce0d89f [FrameworkBundle] Do not pass the base uri twice to scoped http clients
2020-08-30 08:53:37 +02:00
Fabien Potencier 5189571300 Merge branch '4.4' into 5.1
* 4.4:
  Fix typo
2020-08-28 18:19:35 +02:00
Fabien Potencier 4dc9ac0acc Fix typo 2020-08-28 18:19:28 +02:00
Fabien Potencier f6c0706762 Merge branch '4.4' into 5.1
* 4.4:
  [PhpUnitBridge] Create a predictable symlink pointing to the local install
  [PropertyInfo] Backport support for typed properties (PHP 7.4)
  [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
  [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
  [PhpUnit] Add polyfill for assertMatchesRegularExpression()
2020-08-28 18:18:32 +02:00
Thomas Calvet 564dce39f8 [HttpClient][MockHttpClient][DX] Throw when the response factory callable does not return a valid response 2020-08-28 14:30:47 +02:00
Fabien Potencier 03d494ddde bug #37971 [PropertyInfo] Backport support for typed properties (PHP 7.4) (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] Backport support for typed properties (PHP 7.4)

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

Backports #34557 as suggested.

One of my workmate hit this issue with the Serializer component and it was not obvious for him why it was not working, without hint.

Commits
-------

1b19f255a3 [PropertyInfo] Backport support for typed properties (PHP 7.4)
2020-08-28 12:27:56 +02:00
Fabien Potencier ac96fdacd3 minor #37974 [PhpUnitBridge] Create a predictable symlink pointing to the local install (dunglas)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Create a predictable symlink pointing to the local install

| 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

Static analysis tools such as PHPStan need to be able to autoload classes provided by to work. It's also useful to use the assertions provided by PHPUnit with other testing tools such as Behat.
When using `simple-phpunit`, PHPUnit isn't installed in the `vendor/` directory, consequently other tools cannot autoload its classes.

A workaround is to configure these tools to load the autoloader installed by `simple-phpunit`. Example with PHPstan:

```neon
parameters:
	bootstrapFiles:
		- vendor/bin/.phpunit/phpunit-9.2-0/vendor/autoload.php
```

However, the path of the autoloader isn't predictable: it depends of PHPUnit version.

This PR changes `simple-phpunit` to create a symlink with a predictable path (`vendor/.phpunit/phpunit`) pointing to the currently used version of PHPUnit, so it is possible to hardcode this value in config files.

The symlink is recreated before every run, so if a different version of PHPUnit must be used because the PHP version in use is different from the previous run (frequent when developing libraries compatible with multiple PHP versions), it still works.

Commits
-------

bf7654f245 [PhpUnitBridge] Create a predictable symlink pointing to the local install
2020-08-28 12:27:13 +02:00
Kévin Dunglas bf7654f245 [PhpUnitBridge] Create a predictable symlink pointing to the local install 2020-08-28 12:27:07 +02:00
Kévin Dunglas 1b19f255a3 [PropertyInfo] Backport support for typed properties (PHP 7.4) 2020-08-28 10:21:30 +02:00
Fabien Potencier f4115e7717 bug #37970 [PhpUnitBridge] Polyfill new phpunit 9.1 assertions (phpfour)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Polyfill new phpunit 9.1 assertions

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

Backport of #37567, follows the discussion on #37960.

Commits
-------

d945b88c1a [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
2020-08-28 09:51:20 +02:00
Mohammad Emran Hasan d945b88c1a [PhpUnitBridge] Polyfill new phpunit 9.1 assertions 2020-08-28 09:39:33 +02:00
Thomas Calvet e2fce0d89f [FrameworkBundle] Do not pass the base uri twice to scoped http clients 2020-08-27 18:01:08 +02:00
Fabien Potencier 831966981b minor #37964 [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait

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

Move the polyfill method introduced in #37960 in the `Assert` trait. Sorry I noticed this trait later.

Commits
-------

0426113eda [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
2020-08-27 16:50:42 +02:00
Kévin Dunglas 0426113eda
[PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait 2020-08-27 16:43:53 +02:00
Fabien Potencier 7da56f31ba bug #37960 [PhpUnit] Add polyfill for assertMatchesRegularExpression() (dunglas)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnit] Add polyfill for assertMatchesRegularExpression()

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

`assertRegExp()` is now deprecated in favor of `assertMatchesRegularExpression`.

Commits
-------

33eccd2a00 [PhpUnit] Add polyfill for assertMatchesRegularExpression()
2020-08-27 16:03:12 +02:00
Kévin Dunglas 33eccd2a00 [PhpUnit] Add polyfill for assertMatchesRegularExpression() 2020-08-27 16:03:04 +02:00
Fabien Potencier 4d0ebc6b04 minor #37962 Update Notifier bridge DSN in readme (jeremyFreeAgent)
This PR was merged into the 5.1 branch.

Discussion
----------

Update Notifier bridge DSN in readme

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

Add missing DSN documentation in README for 5.1

Commits
-------

17c0784c44 Update Notifier bridge readme
2020-08-27 15:16:49 +02:00
Jérémy Romey 17c0784c44
Update Notifier bridge readme 2020-08-27 14:59:47 +02:00
Nicolas Grekas 9c86cd2b4e bug #37941 [TwigBridge] allow null for $message of filter method `trans` (Flinsch)
This PR was merged into the 5.1 branch.

Discussion
----------

[TwigBridge] allow null for $message of filter method `trans`

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

With Symfony 5.0, filter method `trans` of Symfony Twig Bridge does not allow null values for `$message` parameter anymore, breaking backward compatibility. See also #37931. The included commit provides a fix to this BC break by allowing null values again.

Commits
-------

039fc80d6c [TwigBridge] Fix #37931: BC break where filter method `trans` did not allow null values for `$message` parameter anymore
2020-08-26 16:33:20 +02:00
Flinsch 039fc80d6c [TwigBridge] Fix #37931: BC break where filter method `trans` did not allow null values for `$message` parameter anymore 2020-08-26 16:33:04 +02:00
Fabien Potencier 92cb709222 bug #37622 [PropertyAccess] Fix accessing dynamic properties (andreyserdjuk)
This PR was submitted for the master branch but it was squashed and merged into the 5.1 branch instead.

Discussion
----------

[PropertyAccess] Fix accessing dynamic properties

| Q             | A
| ------------- | ---
| Branch?       | 5.1 (to be switched when merging)
| 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 #37026 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

Commits
-------

47bd0180d1 [PropertyAccess] Fix accessing dynamic properties
2020-08-26 15:25:49 +02:00
Andrii Serdiuk 47bd0180d1 [PropertyAccess] Fix accessing dynamic properties 2020-08-26 15:25:42 +02:00
Fabien Potencier fc3095ff2f bug #37927 [HttpClient] fix chaining promises returned by HttplugClient (CthulhuDen)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] fix chaining promises returned by HttplugClient

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

Guzzle runtime does not play too well with foreign promises, which can be fixed by wrapping them with `promise_for`.
Added failing test case from #37925 and suggested fix.
Should not break BC because `then` callback results get resolved before being passed to next `then` callback or returned from `wait`.

Commits
-------

75043a1fb0 [HttpClient] fix chaining promises returned by HttplugClient
2020-08-26 13:34:52 +02:00
cthulhu 75043a1fb0 [HttpClient] fix chaining promises returned by HttplugClient 2020-08-26 12:50:35 +02:00
Fabien Potencier 885390fbaf bug #37953 [DI] fix dumping lazy non-shared services (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI] fix dumping lazy non-shared services

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

Commits
-------

a4f4ca74a7 [DI] fix dumping lazy non-shared services
2020-08-26 11:10:33 +02:00
Nicolas Grekas a4f4ca74a7 [DI] fix dumping lazy non-shared services 2020-08-26 10:54:37 +02:00
Fabien Potencier 216f2fa94e Merge branch '4.4' into 5.1
* 4.4:
  Backport: Improve link script with rollback when using symlink
  fix more numeric cases changing in PHP 8
2020-08-26 10:30:57 +02:00
Fabien Potencier 6d850e04be Merge branch '3.4' into 4.4
* 3.4:
  Backport: Improve link script with rollback when using symlink
  fix more numeric cases changing in PHP 8
2020-08-26 10:30:46 +02:00
Fabien Potencier a430ccbcf1 minor #37952 Backport: Improve link script with rollback when using symlink (noniagriconomie)
This PR was merged into the 3.4 branch.

Discussion
----------

Backport: Improve link script with rollback when using symlink

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

Backports #37915 to 3.4.

Even if it's a new feature, it's a contributors tool that can be used for any version to try out.

Commits
-------

ab92e9f4c3 Backport: Improve link script with rollback when using symlink
2020-08-26 10:30:29 +02:00
noniagriconomie ab92e9f4c3 Backport: Improve link script with rollback when using symlink 2020-08-26 10:20:55 +02:00
Fabien Potencier b98f2afe5e bug #37949 [Yaml] fix more numeric cases changing in PHP 8 (xabbuh)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Yaml] fix more numeric cases changing in PHP 8

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | 968ffcfa65 (r41697638)
| License       | MIT
| Doc PR        |

see also https://wiki.php.net/rfc/saner-numeric-strings

Commits
-------

7cd5106041 fix more numeric cases changing in PHP 8
2020-08-26 08:48:07 +02:00
Christian Flothmann 7cd5106041 fix more numeric cases changing in PHP 8 2020-08-26 08:32:27 +02:00
Fabien Potencier df7950d0e3 bug #37943 [Security] Fixed RememberMeAuthenticator::autoLogin() logic in the authenticator (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Fixed RememberMeAuthenticator::autoLogin() logic in the authenticator

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

The `RememberMeAuthenticator` wrongly assumed the implementation details of `AbstractRememberMeServices::autoLogin()`. This means that (a) the authenticator did not work with other - custom - implementations of `RememberMeServicesInterface` and (b) there was a potentional to get an "Call to a member function getUser() on null" error.

This code removes all assumptions of the `autoLogin()` logic, other than that stated in the PHPdoc: 32ca714e93/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php (L43-L53)

Commits
-------

93aea910d9 Fixed autoLogin() returning null
2020-08-25 21:08:41 +02:00
Wouter de Jong 93aea910d9 Fixed autoLogin() returning null 2020-08-25 17:26:05 +02:00
Fabien Potencier 32ca714e93 minor #37922 [Notifier] backport documentation changes (noniagriconomie)
This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] backport documentation changes

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

I think #37809 should have been merged into the `5.1` branch.

Commits
-------

ff768fbdd9 [Notifier] add doc for free mobile dsn
2020-08-23 11:47:18 +02:00
Fabien Potencier d24a181e55 Merge branch '4.4' into 5.1
* 4.4:
  account for is_numeric() behavior changes in PHP 8
  fix expected exception messages on PHP 8
2020-08-23 11:22:34 +02:00
Fabien Potencier 77418e712e Merge branch '3.4' into 4.4
* 3.4:
  account for is_numeric() behavior changes in PHP 8
  fix expected exception messages on PHP 8
2020-08-23 11:22:13 +02:00
Fabien Potencier 7b865eaeba Fix constraint 2020-08-23 11:12:48 +02:00
noniagriconomie ff768fbdd9 [Notifier] add doc for free mobile dsn 2020-08-23 11:06:47 +02:00
Fabien Potencier 4b3d5b6c00 bug #37921 [Yaml] account for is_numeric() behavior changes in PHP 8 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] account for is_numeric() behavior changes in PHP 8

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

Commits
-------

05db8e0fef account for is_numeric() behavior changes in PHP 8
2020-08-23 11:03:06 +02:00
Fabien Potencier 6adb66789e bug #37913 [Mailer] Support Return-Path in SesApiAsyncAwsTransport (cvmiert)
This PR was merged into the 5.1 branch.

Discussion
----------

[Mailer] Support Return-Path in SesApiAsyncAwsTransport

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

Enable sending `SendEmailRequest`s with a `Return-Path` configured in
`SesApiAsyncAwsTransport`.

Commits
-------

61754cb891 [Mailer] Support Return-Path in SesApiAsyncAwsTransport
2020-08-23 11:01:08 +02:00
Christian Flothmann 05db8e0fef account for is_numeric() behavior changes in PHP 8 2020-08-23 09:58:10 +02:00
Clara van Miert 61754cb891
[Mailer] Support Return-Path in SesApiAsyncAwsTransport
Enable sending `SendEmailRequest`s with a `Return-Path` configured in
`SesApiAsyncAwsTransport`.
2020-08-22 13:41:45 +02:00
Fabien Potencier 86310deed2 minor #37911 [Cache] fix expected exception message on PHP 8 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix expected exception message on PHP 8

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

Commits
-------

2c9af570a2 fix expected exception messages on PHP 8
2020-08-22 08:24:01 +02:00
Fabien Potencier 0611b6331c Merge branch '4.4' into 5.1
* 4.4:
  fix passing arguments to call_user_func_array() on PHP 8
  allow Doctrine DBAL 3
  [Filesystem] fix test on PHP 8
2020-08-21 19:19:47 +02:00
Fabien Potencier 4da3ece1b5 Merge branch '3.4' into 4.4
* 3.4:
  fix passing arguments to call_user_func_array() on PHP 8
  [Filesystem] fix test on PHP 8
2020-08-21 19:19:37 +02:00
Fabien Potencier 2abf876260 bug #37912 [ExpressionLanguage] fix passing arguments to call_user_func_array() on PHP 8 (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[ExpressionLanguage] fix passing arguments to call_user_func_array() on PHP 8

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

Commits
-------

a55ce7c8bb fix passing arguments to call_user_func_array() on PHP 8
2020-08-21 18:53:32 +02:00
Christian Flothmann 2c9af570a2 fix expected exception messages on PHP 8 2020-08-21 16:26:21 +02:00
Christian Flothmann a55ce7c8bb fix passing arguments to call_user_func_array() on PHP 8 2020-08-21 16:15:51 +02:00