Commit Graph

43380 Commits

Author SHA1 Message Date
Nicolas Grekas
54a514fc1d bug #31964 [Router] routing cache crash when using generator_class (dFayet)
This PR was merged into the 4.3 branch.

Discussion
----------

[Router] routing cache crash when using generator_class

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31807
| License       | MIT

Since #28865 the Router use, by default, new generator, matcher, and dumpers.
This leads to crash when the Router use a custom generator, or matcher based on the old ones.

Commits
-------

a5b46e5390 Fix routing cache broken when using generator_class
2019-09-06 12:00:20 +02:00
Nicolas Grekas
1b835d1249 minor #33484 Fix test fixtures with deprecated method signatures (derrabus, nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix test fixtures with deprecated method signatures

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33483 (partly)
| License       | MIT
| Doc PR        | N/A

This PR upgrades two fixtures that implemented deprecated method signatures. As far as I can tell, they are used in tests that do not specifically test legacy behavior, so the fixtures should be up to date. Currently, these fixtures cause failing tests on the 4.4 branch.

Commits
-------

cc3e3d54ea Fix more bad tests
592aacff6f Fix test fixtures with deprecated method signatures.
2019-09-06 11:53:27 +02:00
Nicolas Grekas
2feae7bebb minor #33479 [SecurityBundle] Fix 4.3 tests forward compat (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix 4.3 tests forward compat

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

Commits
-------

f092331eb1 Fix 4.3 tests forward compat
2019-09-06 11:49:53 +02:00
Nicolas Grekas
d081f1689b bug #33481 [Messenger] fix empty amqp body returned as false (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix empty amqp body returned as false

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

Having `false` in the body breaks typehints in the serializer and is not consistent with other transports like doctrine. See https://github.com/pdezwart/php-amqp/issues/351

Commits
-------

ee5cbe3658 [Messenger] fix empty amqp body returned as false
2019-09-06 11:42:14 +02:00
Nicolas Grekas
cc3e3d54ea Fix more bad tests 2019-09-06 11:34:03 +02:00
Saša Stamenković
89f7d77ea0 Add BC break note to UPGRADE-4.2.md 2019-09-06 11:27:22 +02:00
Alexander M. Turek
592aacff6f Fix test fixtures with deprecated method signatures. 2019-09-06 00:33:19 +02:00
Yonel Ceruto
f092331eb1 Fix 4.3 tests forward compat 2019-09-05 14:00:30 -04:00
Tobias Schultze
ee5cbe3658 [Messenger] fix empty amqp body returned as false 2019-09-05 18:44:17 +02:00
Fabien Potencier
828e5a4ae3 bug #33387 [Mailer] maintain sender/recipient name in SMTP envelopes (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] maintain sender/recipient name in SMTP envelopes

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

Commits
-------

46ed0e84cd maintain sender/recipient name in SMTP envelopes
2019-09-04 12:04:48 +02:00
Christian Flothmann
46ed0e84cd maintain sender/recipient name in SMTP envelopes 2019-09-04 11:58:50 +02:00
Fabien Potencier
9407c6b6b0 bug #33449 Fix gmail relay (Beno!t POLASZEK)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix gmail relay

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32148
| License       | MIT

This tiny PR fixes #32148 by removing the emission of a notice which prevented a `TransportException` to be thrown when something wrong occured.

Commits
-------

6c90e08368 Fix #32148 TransportException was not thrown
2019-09-04 08:06:43 +02:00
Nicolas Grekas
29355c059c bug #33391 [HttpClient] fix support for 103 Early Hints and other informational status codes (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix support for 103 Early Hints and other informational status codes

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

I learned quite recently how 1xx status codes work in HTTP 1.1 when I discovered the [103 Early Hint](https://evertpot.com/http/103-early-hints) status code from [RFC8297](https://tools.ietf.org/html/rfc8297)

This PR fixes support for them by adding a new `getInformationalStatus()` method on `ChunkInterface`. This means that you can now know about 1xx status code by using the `$client->stream()` method:

```php

$response = $client->request('GET', '...');

foreach ($client->stream($response) as $chunk) {
    [$code, $headers] = $chunk->getInformationalStatus();
    if (103 === $code) {
        // $headers['link'] contains the early hints defined in RFC8297
    }

    // ...
}
```

Commits
-------

34275bba1c [HttpClient] fix support for 103 Early Hints and other informational status codes
2019-09-03 23:38:33 +02:00
Nicolas Grekas
200281db40 Merge branch '3.4' into 4.3
* 3.4:
  [Validator] Add ConstraintValidator::formatValue() tests
  [Validator] Sync string to date behavior and throw a better exception
  Check phpunit configuration for listeners
2019-09-03 23:37:38 +02:00
Nicolas Grekas
a99a4801a2 minor #33452 [HttpClient] Fix a bug preventing Server Pushes to be handled properly (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix a bug preventing Server Pushes to be handled properly

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

Follows https://github.com/symfony/symfony/pull/33444.

Commits
-------

e1fbaeb65c [HttpClient] Fix a bug preventing Server Pushes to be handled properly
2019-09-03 23:34:18 +02:00
Kévin Dunglas
e1fbaeb65c
[HttpClient] Fix a bug preventing Server Pushes to be handled properly 2019-09-03 23:26:51 +02:00
Nicolas Grekas
34275bba1c [HttpClient] fix support for 103 Early Hints and other informational status codes 2019-09-03 23:21:26 +02:00
Beno!t POLASZEK
6c90e08368 Fix #32148 TransportException was not thrown 2019-09-03 22:05:27 +02:00
Nicolas Grekas
f48ebfa402 bug #33444 [HttpClient] improve handling of HTTP/2 PUSH, disable it by default (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] improve handling of HTTP/2 PUSH, disable it by default

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

This follows discussions with @dunglas
For the test cases, https://http2-push.io is down, let's use Akamai instead

This PR now considers the proxy settings before accepting a pushed response.
It also splits the responsibility of dealing with accepting pushed responses in method `acceptPushForRequest`.

The logic in this method could also be delegated to a userland callback passed as an option. Let's wait for someone with an actual use case before adding the option.

This PR also disables HTTP/2 PUSH by default because it is not stable: locally, with the latest curl version, enabling this on a server that pushes things fails with `Failure when receiving data from the peer`. This is not ready for prime time in either ext-curl or the underlying libcurl. You can still enable it explicitly by passing some positive number to the constructor.

Commits
-------

019bce7230 [HttpClient] improve handling of HTTP/2 PUSH
2019-09-03 21:47:20 +02:00
Nicolas Grekas
84fec703c8 minor #33447 [DI] fix failure (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix failure

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

Commits
-------

3b40cb19a2 [DI] fix failure
2019-09-03 21:14:56 +02:00
Nicolas Grekas
3b40cb19a2 [DI] fix failure 2019-09-03 21:14:00 +02:00
Fabien Potencier
33c02aedec minor #33434 [Validator] Add ConstraintValidator::formatValue() tests (fancyweb)
This PR was squashed before being merged into the 3.4 branch (closes #33434).

Discussion
----------

[Validator] Add ConstraintValidator::formatValue() tests

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

So https://github.com/symfony/symfony/pull/33401 tests can be built on top of this.

Commits
-------

b688aa31ec [Validator] Add ConstraintValidator::formatValue() tests
2019-09-03 18:24:41 +02:00
Thomas Calvet
b688aa31ec [Validator] Add ConstraintValidator::formatValue() tests 2019-09-03 18:24:34 +02:00
Fabien Potencier
c0f4037769 bug #33435 [Validator] Only handle numeric values in DivisibleBy (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Validator] Only handle numeric values in DivisibleBy

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

Currently it probably breaks because `abs` throws a notice on objects.

Commits
-------

f974add66a [Validator] Only handle numeric values in DivisibleBy
2019-09-03 18:22:42 +02:00
Fabien Potencier
8798c87def bug #33437 Fix #33427 (sylfabre)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix #33427

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

Fix #33427 by checking if the message returned by the intl-icu catalog is empty. If yes then the translator returns an empty string instead of running `formatIntl()` which uses the constructor of `MessageFormatter` which throws an exception with empty strings.

Commits
-------

414dcebfc4 Fix #33427
2019-09-03 18:15:52 +02:00
Fabien Potencier
38514cb0f4 bug #33439 [Validator] Sync string to date behavior and throw a better exception (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Sync string to date behavior and throw a better exception

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

`\DateTimeImmutable` are not compared with `\DateTimeImmutable` in the `RangeValidator` class (contrary to the behavior in the `AbstractComparisonValidator` class).
Also, let's throw a dedicated exception when the provided string value cannot be parsed to a `\DateTime` or `\DateTimeImmutable`. It's better than the default exception IMO.

Commits
-------

28d7d9444f [Validator] Sync string to date behavior and throw a better exception
2019-09-03 18:13:28 +02:00
Nicolas Grekas
019bce7230 [HttpClient] improve handling of HTTP/2 PUSH 2019-09-03 17:44:22 +02:00
Sylvain
414dcebfc4 Fix #33427 2019-09-03 17:39:16 +02:00
Thomas Calvet
f974add66a [Validator] Only handle numeric values in DivisibleBy 2019-09-03 11:18:02 +02:00
Thomas Calvet
28d7d9444f [Validator] Sync string to date behavior and throw a better exception 2019-09-03 11:01:58 +02:00
Fabien Potencier
4ee3c6bd6a bug #33436 [DI] fix support for "!tagged_locator foo" (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix support for "!tagged_locator foo"

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

Spotted during the workshop at WebSummerCamp

Commits
-------

a9f75692c9 [DI] fix support for "!tagged_locator foo"
2019-09-03 06:48:04 +02:00
Nicolas Grekas
726999d015 bug #32903 [PHPUnit Bridge] Avoid registering listener twice (alexpott)
This PR was merged into the 3.4 branch.

Discussion
----------

[PHPUnit Bridge] Avoid registering listener twice

The listener can be registered via configuration by the user. In that
case, we do not want to add it again to the list of listeners.
Closes #31649

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

Commits
-------

b190536205 Check phpunit configuration for listeners
2019-09-02 22:05:28 +02:00
Alex Pott
b190536205
Check phpunit configuration for listeners
The bridge listener can be registered via configuration by the user. In that
case, we do not want to add it again to the list of listeners.
Closes #31649
2019-09-02 22:02:06 +02:00
Nicolas Grekas
d26a6568b3 fix merge 2019-09-02 21:49:51 +02:00
Nicolas Grekas
af474ab97e fix merge 2019-09-02 20:42:57 +02:00
Nicolas Grekas
7c5d220f1a Merge branch '3.4' into 4.3
* 3.4:
  [Bridge/PhpUnit] fix looking for composer
2019-09-02 20:34:38 +02:00
Nicolas Grekas
62020ab91f [Bridge/PhpUnit] fix looking for composer 2019-09-02 20:32:45 +02:00
Nicolas Grekas
a9f75692c9 [DI] fix support for "!tagged_locator foo" 2019-09-02 19:38:36 +02:00
Nicolas Grekas
61dad16c9d cs fix 2019-09-02 18:03:34 +02:00
Fabien Potencier
ca16f5278e bug #33432 [Mailer] Fix Mailgun support when a response is not JSON as expected (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Fix Mailgun support when a response is not JSON as expected

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

Sometimes, like when getting a 401, the Mailgun API does not respond with JSON :(

Commits
-------

3b2db425f6 [Mailer] fixed Mailgun support when a response is not JSON as expected
2019-09-02 17:24:05 +02:00
Fabien Potencier
3b2db425f6 [Mailer] fixed Mailgun support when a response is not JSON as expected 2019-09-02 17:20:17 +02:00
Nicolas Grekas
d05e49797c [4.3] Cleanup tests 2019-09-02 16:45:56 +02:00
Nicolas Grekas
d423b0f473 Merge branch '3.4' into 4.3
* 3.4:
  Cleanup tests
  [Finder] Prevent unintentional file locks in Windows
  [DomCrawler] Fix FileFormField PHPDoc
  Fix #33395 PHP 5.3 compatibility
2019-09-02 16:41:27 +02:00
Nicolas Grekas
33e466577f minor #33428 Cleanup tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Cleanup tests

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

Commits
-------

a461943345 Cleanup tests
2019-09-02 16:39:16 +02:00
Nicolas Grekas
a461943345 Cleanup tests 2019-09-02 16:34:19 +02:00
Nicolas Grekas
6a31d31f28 bug #33402 [Finder] Prevent unintentional file locks in Windows (jspringe)
This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #33402).

Discussion
----------

[Finder] Prevent unintentional file locks in Windows

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes <!-- see below -->
| 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 | #33400   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

~~This replaces the constructor behavior for `SortableIterator`. Instead of storing the sort strategy as a property, causing the object to hold references to the files being sorted and thus locking them in Windows, it uses a method to determine the sort strategy when calling `getIterator`.~~

Change stored `$sort` closure to a static closure. This removes the instance context that causes the file lock. This doesn't change any intended behavior.

I, unfortunately, did not provided tests for 2 reasons. The first being that I've never written tests for the Symfony framework so I do not know the nuances. ~~The second is that in order for the test to actually fail it would need to be run in the Windows OS.~~ AppVeyor tests with a Windows instance, but it appears the `Finder` tests get skipped.

Commits
-------

997cc5c3f0 [Finder] Prevent unintentional file locks in Windows
2019-09-01 23:32:41 +02:00
Joe Springe
997cc5c3f0 [Finder] Prevent unintentional file locks in Windows 2019-09-01 23:32:23 +02:00
dFayet
a5b46e5390 Fix routing cache broken when using generator_class 2019-09-01 21:32:32 +02:00
Robin Chalas
b9f8c7bbf9 bug #33376 [Mailer] Remove the default dispatcher in AbstractTransport (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Remove the default dispatcher in AbstractTransport

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

Creating a default event dispatcher does not make sense as nobody can listen on it.

Commits
-------

55d6a65df9 [Mailer] Remove the default dispatcher in AbstractTransport
2019-08-31 06:21:39 +02:00
Fabien Potencier
d67289ca82 bug #33357 [FrameworkBundle] Fix about command not showing .env vars (brentybh)
This PR was squashed before being merged into the 4.3 branch (closes #33357).

Discussion
----------

[FrameworkBundle] Fix about command not showing .env vars

Before this fix, `bin/console about` can't properly show `Environment (.env)` section because:
`SYMFONY_DOTENV_VARS` which stores all keys of Dotenv-set env vars, is being fetched via `getenv()`.

However, in Symfony Dotenv 4.3, usage of `putenv()` is deprecated:
d2fa94d259 (diff-a6967492da82dce9ba93bcba3eee0334)
so we can get env vars via `getenv()` only when `new Dotenv(true)`.
In the default shipped `config/bootstrap.php`, there is `new Dotenv(false)` set.

(Maybe related #29131)

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes <!-- see below -->
| 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 -->
| 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/roadmap):
 - 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
-------

f48f19db91 [FrameworkBundle] Fix about command not showing .env vars
2019-08-30 19:50:45 +02:00