Commit Graph

52204 Commits

Author SHA1 Message Date
Alexander M. Turek
2a453c2c89 Merge branch '5.2' into 5.x
* 5.2:
  remove unreachable code
  [Browserkit] Add changelog entry for request parameters string cast
  Update ExceptionEvent.php
  fix firebase transport factory DI tag type
  [Validator] Resolve IsinValidator's dependency on the validator.
  [HttpFoundation] Fix for virtualhosts based on URL path
2020-11-16 00:08:54 +01:00
Alexander M. Turek
5a9a7be6e5 Merge branch '5.1' into 5.2
* 5.1:
  remove unreachable code
  Update ExceptionEvent.php
  fix firebase transport factory DI tag type
  [HttpFoundation] Fix for virtualhosts based on URL path
2020-11-16 00:02:13 +01:00
Alexander M. Turek
a71bce881a Merge branch '4.4' into 5.1 2020-11-15 23:55:04 +01:00
Alexander M. Turek
091265bbbb bug #38614 [HttpFoundation] Fix for virtualhosts based on URL path (mvorisek)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix for virtualhosts based on URL path

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

This PR fixes base URL detection when:
- virtualhost is based on URL path
- AND local path does not match that URL virtual host path prefix

fix covered with tests

Commits
-------

75ff86811f [HttpFoundation] Fix for virtualhosts based on URL path
2020-11-15 23:42:48 +01:00
Alexander M. Turek
b77ef9f5b9 feature #38846 [Messenger] Make all the dependencies of AmazonSqsTransport injectable (jacekwilczynski)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Make all the dependencies of AmazonSqsTransport injectable

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

This is a pure refactoring PR that enables more flexibility with service injection without actually changing any behaviour or breaking backwards compatibility. It satisfies only 1 of 2 acceptance criteria of #38640 but since they're independent, I'm not marking the PR as WIP.

## Receiver & sender injection into AmazonSqsTransport
It is now possible to inject your own receiver and sender into `Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsTransport`.

### Recommended way - AmazonSqsTransport::create
For clean dependency injection, I recommed using the `create` static method, which obliges you to pass all dependencies:
```php
$transport = AmazonSqsTransport::create($connection, $receiver, $sender);
```

For example, this code from `Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsTransportFactory`:
```php
return new AmazonSqsTransport(Connection::fromDsn($dsn, $options), $serializer);
```
could be replaced with this:
```php
$connection = Connection::fromDsn($dsn, $options);

return AmazonSqsTransport::create(
    $connection,
    new AmazonSqsReceiver($connection, $serializer),
    new AmazonSqsSender($connection, $serializer)
);
```
I didn't replace that code in the factory because I didn't find it essential but I will certainly do it in my custom factory in my project, passing my own receiver implementation.

### Using the main constructor
You can still use the main constructor but it's most suited for backwards compatibility, i.e. when you don't want to inject a receiver or a sender. With the full list of arguments it gets a bit messy due to their optionality.

#### Minimal call
```php
new AmazonSqsTransport($connection);
```
As before this PR, a receiver and a sender will be created using the default serializer, i.e. `Symfony\Component\Messenger\Transport\Serialization\PhpSerializer`.

#### With a custom serializer
```php
new AmazonSqsTransport($connection, $serializer);
```
As before this PR, a receiver and a sender will be created using the passed serializer.

#### With a custom receiver and sender
```php
new AmazonSqsTransport($connection, null, $receiver, $sender);
```
The injected services will be used. The second parameter (serializer) is unnecessary because it was only ever used while creating a receiver and a sender inside the transport. Because of this, I recommend using the new static `create` method.

Commits
-------

281af262e6 [Messenger] Make all the dependencies of AmazonSqsTransport injectable
2020-11-15 23:33:08 +01:00
Jacek Wilczyński
281af262e6 [Messenger] Make all the dependencies of AmazonSqsTransport injectable 2020-11-15 23:32:40 +01:00
Chi-teck
bd72a56505 Check if method inheritEnvironmentVariables exists 2020-11-14 17:10:20 +00:00
Fabien Potencier
1f4625053c minor #39080 [Yaml] remove unreachable code (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] remove unreachable code

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

mistakenly added in #33658

Commits
-------

5907444e81 remove unreachable code
2020-11-14 16:22:22 +01:00
Fabien Potencier
3d5b877962 minor #39060 [BrowserKit] [Browserkit] Add changelog entry for request parameters string cast (chalasr)
This PR was merged into the 5.2 branch.

Discussion
----------

[BrowserKit] [Browserkit] Add changelog entry for request parameters string cast

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fixes #38651, Fixes #38591
| License       | MIT
| Doc PR        | -

Commits
-------

ec80507468 [Browserkit] Add changelog entry for request parameters string cast
2020-11-14 16:21:17 +01:00
Christian Flothmann
5907444e81 remove unreachable code 2020-11-14 15:49:24 +01:00
Robin Chalas
ec80507468 [Browserkit] Add changelog entry for request parameters string cast 2020-11-14 12:04:29 +01:00
Fabien Potencier
01a865f38d bug #39072 [FrameworkBundle] [Notifier] fix firebase transport factory DI tag type (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[FrameworkBundle] [Notifier] fix firebase transport factory DI tag type

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

Commits
-------

38145232ab fix firebase transport factory DI tag type
2020-11-14 08:26:21 +01:00
Alexander M. Turek
13abe4822d bug #39070 [Validator] Remove IsinValidator's validator dependency (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[Validator] Remove IsinValidator's validator dependency

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

Commits
-------

4cb7dec347 [Validator] Resolve IsinValidator's dependency on the validator.
2020-11-13 23:00:16 +01:00
Thomas Calvet
c5a107e4cc [PhpUnitBridge] Fix test fixture file name 2020-11-13 17:28:59 +01:00
Alexander M. Turek
7fba1e55c4 minor #39073 [HttpKernel] Update doc block on ExceptionEvent (noniagriconomie)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Update doc block on ExceptionEvent

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

Related to the code https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php#L63

Commits
-------

4e45d2da3b Update ExceptionEvent.php
2020-11-13 14:02:52 +01:00
Antoine Makdessi
4e45d2da3b
Update ExceptionEvent.php 2020-11-13 13:20:22 +01:00
Christian Flothmann
38145232ab fix firebase transport factory DI tag type 2020-11-13 12:10:43 +01:00
Christian Flothmann
c82c997a27 Merge branch '5.2' into 5.x
* 5.2:
  prevent hash collisions caused by reused object hashes
  autoconfigure behavior describing tags on decorators
  [Validator][RecursiveContextualValidator] Prevent validated hash collisions
2020-11-13 10:45:18 +01:00
Christian Flothmann
cc130e1d9c Merge branch '5.1' into 5.2
* 5.1:
  prevent hash collisions caused by reused object hashes
  autoconfigure behavior describing tags on decorators
  [Validator][RecursiveContextualValidator] Prevent validated hash collisions
2020-11-13 10:44:33 +01:00
Christian Flothmann
355f18d34d Merge branch '4.4' into 5.1
* 4.4:
  prevent hash collisions caused by reused object hashes
  autoconfigure behavior describing tags on decorators
  [Validator][RecursiveContextualValidator] Prevent validated hash collisions
2020-11-13 10:37:26 +01:00
Christian Flothmann
c72f85333a bug #38387 [Validator] prevent hash collisions caused by reused object hashes (fancyweb, xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] prevent hash collisions caused by reused object hashes

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

Commits
-------

8dd1a6e545 prevent hash collisions caused by reused object hashes
9645fa39ec [Validator][RecursiveContextualValidator] Prevent validated hash collisions
2020-11-13 10:30:24 +01:00
Christian Flothmann
3834d76e11 bug #38999 [DependencyInjection] autoconfigure behavior describing tags on decorators (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] autoconfigure behavior describing tags on decorators

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

Commits
-------

73a3b838b7 autoconfigure behavior describing tags on decorators
2020-11-13 10:27:22 +01:00
Christian Flothmann
8dd1a6e545 prevent hash collisions caused by reused object hashes 2020-11-13 10:14:12 +01:00
Christian Flothmann
73a3b838b7 autoconfigure behavior describing tags on decorators 2020-11-13 10:09:04 +01:00
Alexander M. Turek
4cb7dec347 [Validator] Resolve IsinValidator's dependency on the validator. 2020-11-13 00:06:46 +01:00
Alexander M. Turek
430b916984 Merge branch '5.2' into 5.x
* 5.2:
  Add tests on CacheDataCollector
  [ProxyManagerBridge] fix tests
  [ProxyManagerBridge] relax fixture in tests
  Fix circular detection with multiple paths
2020-11-12 23:42:23 +01:00
Alexander M. Turek
873b0b4f53 Merge branch '5.1' into 5.2
* 5.1:
  Add tests on CacheDataCollector
  [ProxyManagerBridge] fix tests
  [ProxyManagerBridge] relax fixture in tests
  Fix circular detection with multiple paths
2020-11-12 23:35:35 +01:00
Alexander M. Turek
b8afc7cba3 Merge branch '4.4' into 5.1
* 4.4:
  Add tests on CacheDataCollector
  [ProxyManagerBridge] fix tests
  [ProxyManagerBridge] relax fixture in tests
  Fix circular detection with multiple paths
2020-11-12 23:25:33 +01:00
Alexander M. Turek
038497cb80 minor #38898 [Cache] Add tests on CacheDataCollector (ScullWM)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Add tests on CacheDataCollector

| 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 -->
| License       | MIT
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

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

The `calculateStatistics()` method of `Symfony\Component\Cache\DataCollector\CacheDataCollector` contain a lot of logic and manipulate multi-dimensional array that could be refactor with VO.

But before doing this, I would add test on this part.

Commits
-------

7b4310f045 Add tests on CacheDataCollector
2020-11-12 17:05:23 +01:00
Thomas P
7b4310f045 Add tests on CacheDataCollector 2020-11-12 16:25:20 +01:00
Nicolas Grekas
ecf9859609 [ProxyManagerBridge] fix tests 2020-11-12 14:19:35 +01:00
Nicolas Grekas
47041370c0 [ProxyManagerBridge] relax fixture in tests 2020-11-12 13:55:13 +01:00
Alexander M. Turek
faead9574a bug #39058 [DependencyInjection] Fix circular detection with multiple paths (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix circular detection with multiple paths

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

There are currently 2 kind of issues related to the Dependency Injection:

1. performance issue when project contains many loops (#37850)
Which has been fixed by #38882

2. Infinity loop in some case (#38970)
Which has been fixed by #38980 and #39021

The new issue #39056 has been introduced by #38882 (The performance issue refactor) because in order to optimize loop detection, I take a short cut and choose to not collect ALL the circular loop but only the one that matters

I was wrong. All loops matters.

This PR fix my previous refacto to collect ALL the paths, with a low CPU footprint

Commits
-------

1c3721e8ad Fix circular detection with multiple paths
2020-11-12 11:26:24 +01:00
Jérémy Derussé
9e5fefa9fa
Merge branch '5.2' into 5.x
* 5.2:
  [Filesystem] fix cleaning up tmp files when dumpFile() fails
  [MimeType] Add missing alias for @mime_type
2020-11-12 11:06:05 +01:00
Jérémy Derussé
fcc832b720
Merge branch '5.1' into 5.2
* 5.1:
  [Filesystem] fix cleaning up tmp files when dumpFile() fails
  [MimeType] Add missing alias for @mime_type
2020-11-12 11:05:01 +01:00
Jérémy Derussé
9bff2e7aed
Merge branch '4.4' into 5.1
* 4.4:
  [Filesystem] fix cleaning up tmp files when dumpFile() fails
  [MimeType] Add missing alias for @mime_type
2020-11-12 10:58:18 +01:00
Jérémy Derussé
4bb1229261
minor #39047 [MimeType] Add missing alias for service @mime_type (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[MimeType] Add missing alias for service @mime_type

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

I found that this was missing. Im not sure why these have not been added before. Was it intentional?

Commits
-------

7b733d651d [MimeType] Add missing alias for @mime_type
2020-11-12 10:56:29 +01:00
Jérémy Derussé
17a2231c17
bug #39059 [Filesystem] fix cleaning up tmp files when dumpFile() fails (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Filesystem] fix cleaning up tmp files when dumpFile() fails

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

Commits
-------

33fce73bdf [Filesystem] fix cleaning up tmp files when dumpFile() fails
2020-11-12 10:53:41 +01:00
Thomas Calvet
9645fa39ec [Validator][RecursiveContextualValidator] Prevent validated hash collisions 2020-11-12 09:33:23 +01:00
Nicolas Grekas
33fce73bdf [Filesystem] fix cleaning up tmp files when dumpFile() fails 2020-11-11 23:20:15 +01:00
Jérémy Derussé
1c3721e8ad
Fix circular detection with multiple paths 2020-11-11 19:26:13 +01:00
Robin Chalas
16fb94b5fe feature #38596 [BrowserKit] Add jsonRequest function to the browser-kit client (alexander-schranz)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[BrowserKit] Add jsonRequest function to the browser-kit client

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

If you use the FOSRestBundle for your Api's you have maybe many tests using just:

```php
$client->request('POST', '/api/contacts', ['param' => 1]);
```

To test your JSON api as in the real browser request FOSRestBundle converts the json body into the `$request->request` object. I think something similar is done by ApiPlatform. If you have tests like above they will now fail as the integer is converted to string see also #38591.

This PR add a new `jsonRequest` which will look like the following and will so fix the above problem:

```php
$client->jsonRequest('POST', '/api/contacts', ['param' => 1]);
```

Commits
-------

c2fa2cb376 [BrowserKit] Add jsonRequest function to the browser-kit client
2020-11-11 14:22:52 +01:00
Alexander Schranz
c2fa2cb376 [BrowserKit] Add jsonRequest function to the browser-kit client 2020-11-11 14:22:45 +01:00
Robin Chalas
1d945b9453 feature #38998 [Messenger][SQS] Make sure one can enable debug logs (Nyholm)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Messenger][SQS] Make sure one can enable debug logs

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | Needed

If you add `&debug=true` on your DSN, then we will use `LoggerInterface::debug()` to print HTTP requests and responses.
This has a negative impact on performance, but it will be helpful when debugging.

Commits
-------

66edc59b56 [Messenger][SQS] Make sure one can enable debug logs
2020-11-11 14:17:07 +01:00
Nyholm
66edc59b56 [Messenger][SQS] Make sure one can enable debug logs 2020-11-11 14:16:39 +01:00
Nicolas Grekas
f0ff411db5 Merge branch '5.2' into 5.x
* 5.2:
  Bump branch-version
  Bump Symfony version to 5.2.0
  Update VERSION for 5.2.0-RC1
  Update CHANGELOG for 5.2.0-RC1
2020-11-11 12:28:23 +01:00
Nicolas Grekas
c0d4ed0c3e Bump branch-version 2020-11-11 12:27:31 +01:00
Nicolas Grekas
7e3855dbc3 feature #38974 [Intl] deprecate polyfills in favor of symfony/polyfill-intl-icu (nicolas-grekas)
This PR was merged into the 5.x branch.

Discussion
----------

[Intl] deprecate polyfills in favor of symfony/polyfill-intl-icu

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

Follows symfony/polyfill#310
/cc @stof

Commits
-------

6ad0169c4f [Intl] deprecate polyfills in favor of symfony/polyfill-intl-icu
2020-11-11 12:26:28 +01:00
Nyholm
7b733d651d
[MimeType] Add missing alias for @mime_type 2020-11-10 15:45:35 +01:00
Fabien Potencier
5b3976a888 Bump Symfony version to 5.2.0 2020-11-10 09:06:25 +01:00