Commit Graph

35871 Commits

Author SHA1 Message Date
Nicolas Grekas
a1a914ee54 bug #33430 [ErrorHandler][Bridge/PhpUnit] display deprecations for not-autoloaded classes (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler][Bridge/PhpUnit] display deprecations for not-autoloaded classes

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

Commits
-------

2ba3cc0aba [ErrorHandler][Bridge/PhpUnit] display deprecations for not-autoloaded classes
2019-09-03 21:50:39 +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
bb3652a37c feature #33327 [ErrorHandler] Registering basic exception handler for late failures (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Registering basic exception handler for late failures

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

Follow-up https://github.com/symfony/symfony/pull/33260 but when all handlers fail.

It'll becomes common since 4.4 where the user has control over the error rendering mechanism. If they make a mistake, we have a support page to show it, currently a blank page is displayed.

Commits
-------

ffab734615 registering basic exception handler for late failures
2019-09-03 18:17:34 +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
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
Yonel Ceruto
baddf1d9de lint all templates from configured Twig paths if no argument was provided 2019-09-03 10:49:48 -04:00
Yonel Ceruto
9690562410 minor #33329 [Translator] Nullable message id? (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translator] Nullable message id?

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

610a4e978f/src/Symfony/Component/Translation/DataCollectorTranslator.php (L144)

The message id shouldn't be `null`, but it's breaking the current code now. Shouldn't we first deprecate of passing `null` even if it's well documented?

Out there can be a lot of `->trans($var)` and `var|trans()` (like the current ones fixed here) that will break without previous warning.

WDTY?

Commits
-------

55eac63 Nullable message id?
2019-09-03 08:21:30 -04:00
Yonel Ceruto
55eac639c5 Nullable message id? 2019-09-03 08:18:35 -04: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
Fabien Potencier
e69336feed minor #33433 [Mailer] Add a more precise exception (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Add a more precise exception

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| 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

<!--
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
-------

561f9b7345 [Mailer] Add a more precise exception
2019-09-03 06:41:01 +02:00
Yonel Ceruto
b79532ab0e Add ErrorController to preview and render errors 2019-09-02 17:02:21 -04: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
Yonel Ceruto
ffab734615 registering basic exception handler for late failures 2019-09-02 15:55:59 -04:00
Nicolas Grekas
959eb56488 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-02 21:50:03 +02:00
Nicolas Grekas
d26a6568b3 fix merge 2019-09-02 21:49:51 +02:00
Nicolas Grekas
5d4a3a16e0 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-02 20:43:07 +02:00
Nicolas Grekas
af474ab97e fix merge 2019-09-02 20:42:57 +02:00
Nicolas Grekas
cf507a6728 Merge branch '4.3' into 4.4
* 4.3:
  [Bridge/PhpUnit] fix looking for composer
  cs fix
2019-09-02 20:34:52 +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
561f9b7345 [Mailer] Add a more precise exception 2019-09-02 17:59:15 +02:00
Fabien Potencier
cf57ca81ee Merge branch '4.3' into 4.4
* 4.3:
  [Mailer] fixed Mailgun support when a response is not JSON as expected
2019-09-02 17:26:08 +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
2ba3cc0aba [ErrorHandler][Bridge/PhpUnit] display deprecations for not-autoloaded classes 2019-09-02 17:01:21 +02:00
Nicolas Grekas
727aa7ed9e Merge branch '4.3' into 4.4
* 4.3:
  [4.3] Cleanup tests
  Cleanup tests
  [Finder] Prevent unintentional file locks in Windows
  [FrameworkBundle] Fix about command not showing .env vars
  [DomCrawler] Fix FileFormField PHPDoc
  [Mailer] Remove the default dispatcher in AbstractTransport
  Fix #33395 PHP 5.3 compatibility
2019-09-02 16:51:55 +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
Fabien Potencier
e15df84313 [Mailer] fixed wrong behavior 2019-09-02 16:39:38 +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
Fabien Potencier
9e0640a281 [Mailer] fixed previous merge 2019-09-02 16:31:12 +02:00
Fabien Potencier
2ad7f97568 feature #33409 [Mailer] Add support for multiple mailers (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Add support for multiple mailers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | closes #32535
| License       | MIT
| Doc PR        | -

This adds the possibility to define several email transports.

If you only have one email transport,  nothing changes:

```yaml
framework:
    mailer:
        dsn: '%env(MAILER_DSN)%'
```

But if you need more than one, use the `transports` entry instead:

```yaml
framework:
    mailer:
        transports:
            main: '%env(MAILER_DSN)%'
            important: '%env(MAILER_DSN_IMPORTANT)%'
```

Then, when sending an email via the `Mailer`, pass the mailer name explicitly (by default, the first one is used):

```php
// use the first "main" transport
$mailer->send($email);

// or use the "important" one (`null` is the envelope)
$mailer->send($email, null, 'important');
```

The web profiler now displays the name and the shorten DSN.

Commits
-------

de5fae4dd8 [Mailer] Add support for multiple mailers
2019-09-02 16:12:44 +02:00
Fabien Potencier
469c989697 [Mailer] Change the DSN semantics 2019-09-02 15:50:44 +02:00
Fabien Potencier
de5fae4dd8 [Mailer] Add support for multiple mailers 2019-09-02 12:19:09 +02:00
Fabien Potencier
5b7bba9ef3 [Mailer] Renamed getName() to toString() 2019-09-02 11:41:25 +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
Fabien Potencier
326afc7a09 Fix the profiler panel for Mailer 2019-09-01 17:28:36 +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
Bohan Yang
f48f19db91 [FrameworkBundle] Fix about command not showing .env vars 2019-08-30 19:50:33 +02:00
Fabien Potencier
71a8ecbfd6 minor #33289 [DomCrawler] Fix FileFormField PHPDoc (dunglas)
This PR was squashed before being merged into the 3.4 branch (closes #33289).

Discussion
----------

[DomCrawler] Fix FileFormField PHPDoc

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| 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

`null` is a valid value, it is used in case of errors. Then the parent class must allow `null` values too. I think it's important regarding the ongoing process of adding typehints everywhere.

Commits
-------

162bfc3cad [DomCrawler] Fix FileFormField PHPDoc
2019-08-30 19:42:32 +02:00
Kévin Dunglas
162bfc3cad [DomCrawler] Fix FileFormField PHPDoc 2019-08-30 19:42:23 +02:00
Fabien Potencier
55d6a65df9 [Mailer] Remove the default dispatcher in AbstractTransport 2019-08-30 19:29:56 +02:00
Kyle
dede158e8a
Fix #33395 PHP 5.3 compatibility 2019-08-30 15:50:48 +02:00
Nicolas Grekas
9ea05b1601 Merge branch '4.3' into 4.4
* 4.3:
  [Console] allow Command::getName() to return null
2019-08-30 14:54:56 +02:00
Nicolas Grekas
8c0f54ba21 Merge branch '3.4' into 4.3
* 3.4:
  [Console] allow Command::getName() to return null
2019-08-30 14:54:44 +02:00
Nicolas Grekas
22ed6247fa Merge branch '4.3' into 4.4
* 4.3:
  [Routing] fix static route reordering when a previous dynamic route conflicts
  Return null as Expire header if it was set to null
  bug #33370 Fix import statement typo in NullCache (adrienbrault)
  [ProxyManager] remove ProxiedMethodReturnExpression polyfill
  fix dumping not inlined scalar tag values
2019-08-30 14:49:06 +02:00
Nicolas Grekas
247815d21c Merge branch '3.4' into 4.3
* 3.4:
  Return null as Expire header if it was set to null
  [ProxyManager] remove ProxiedMethodReturnExpression polyfill
  fix dumping not inlined scalar tag values
2019-08-30 14:41:22 +02:00
Nicolas Grekas
4b66beed75 bug #33363 [Routing] fix static route reordering when a previous dynamic route conflicts (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix static route reordering when a previous dynamic route conflicts

| 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 while playing with the code.
I confirm the test case is green on 3.4 too (but route reordering didn't exist then.)

Commits
-------

cba3b6245a [Routing] fix static route reordering when a previous dynamic route conflicts
2019-08-30 14:41:04 +02:00
Nicolas Grekas
cba3b6245a [Routing] fix static route reordering when a previous dynamic route conflicts 2019-08-30 14:38:42 +02:00
Christian Flothmann
7d94b7c086 conflict with HttpKernel 5 2019-08-30 13:37:47 +02:00
Robin Chalas
720ffd869e bug #33385 [Console] allow Command::getName() to return null (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] allow Command::getName() to return null

| 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        | -

As reported on 4510f04e70 (commitcomment-34845639)

Commits
-------

59ad6c29d1 [Console] allow Command::getName() to return null
2019-08-29 18:31:21 +02:00
Nicolas Grekas
bff95742eb bug #33353 Return null as Expire header if it was set to null (danrot)
This PR was squashed before being merged into the 3.4 branch (closes #33353).

Discussion
----------

Return null as Expire header if it was set to null

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- 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 |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This PR fixes a regression introduces in #33332. If you set the `Expires` header to null when creating a `Response`, the `getExpires` function returned a date instead of null.

```php
$response = new Response(null, 200, ['Expires' => null]);
$response->getExpires(); // Returns a date currently, but should return null
```

See also [the comment](https://github.com/symfony/symfony/pull/33332#discussion_r317934607) in the PR introducing this regression.

Commits
-------

5e3c7ea452 Return null as Expire header if it was set to null
2019-08-29 18:18:10 +02:00
Daniel Rotter
5e3c7ea452 Return null as Expire header if it was set to null 2019-08-29 18:18:03 +02:00
Nicolas Grekas
59ad6c29d1 [Console] allow Command::getName() to return null 2019-08-29 18:09:35 +02:00
Fabien Potencier
92ac848c57 bug #33370 Fix import statement typo in NullCache (adrienbrault)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix import statement typo in NullCache

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

Commits
-------

0a3bb6d05a Fix import statement typo in NullCache
2019-08-29 17:35:09 +02:00
Nicolas Grekas
792f93018a [ProxyManager] remove ProxiedMethodReturnExpression polyfill 2019-08-29 16:54:55 +02:00
Christian Flothmann
390f4f4329 fix dumping not inlined scalar tag values 2019-08-29 10:16:36 +02:00
Adrien Brault
0a3bb6d05a
Fix import statement typo in NullCache 2019-08-28 12:39:31 +02:00
Fabien Potencier
545d38a037 feature #33319 Allow configuring class names through methods instead of class parameters in Doctrine extensions (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow configuring class names through methods instead of class parameters in Doctrine extensions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

While removing class parameters for DoctrineBundle 2.0 (see https://github.com/doctrine/DoctrineBundle/issues/630), I noticed that the DoctrineExtension still requires them. This PR adds a new method that keeps legacy behaviour, but will dropped in Symfony 5. Extending classes (mainly DoctrineBundle and DoctrineMongoDBBundle) must implement this method themselves to return the appropriate class names instead of declaring them as class parameters in their service configuration. I'll create a separate for the master branch to make this method abstract in 5.0.

The cache driver class names are not being replaced in this PR, as we're dropping support for `doctrine/cache` in DoctrineBundle 2.0. A separate PR will be created to handle those deprecations and to clean up the code.

Commits
-------

b53d8ccfc1 [DoctrineBridge] Allow configuring class names through methods instead of class parameters
2019-08-27 09:59:14 +02:00
Andreas Braun
b53d8ccfc1
[DoctrineBridge] Allow configuring class names through methods instead of class parameters 2019-08-27 09:49:29 +02:00
Nicolas Grekas
a2f46664a7 Merge branch '4.3' into 4.4
* 4.3:
  bumped Symfony version to 4.3.5
  Sort components on CI
  fix parameter type declaration and make fabbot happy
  Upgraded CI Composer
  updated VERSION for 4.3.4
  updated CHANGELOG for 4.3.4
  bumped Symfony version to 3.4.32
  updated VERSION for 3.4.31
  update CONTRIBUTORS for 3.4.31
  updated CHANGELOG for 3.4.31
2019-08-27 09:26:16 +02:00
Nicolas Grekas
28f4c09e2d Merge branch '3.4' into 4.3
* 3.4:
  Sort components on CI
  fix parameter type declaration and make fabbot happy
  Upgraded CI Composer
  bumped Symfony version to 3.4.32
  updated VERSION for 3.4.31
  update CONTRIBUTORS for 3.4.31
  updated CHANGELOG for 3.4.31
2019-08-27 09:25:30 +02:00
Fabien Potencier
e1e5a4601d bumped Symfony version to 4.3.5 2019-08-27 08:04:16 +02:00
Christian Flothmann
19b292893a fix parameter type declaration and make fabbot happy 2019-08-26 22:15:52 +02:00
Fabien Potencier
c94ad9e449 updated VERSION for 4.3.4 2019-08-26 18:47:42 +02:00
Fabien Potencier
afe2f0c511 bumped Symfony version to 3.4.32 2019-08-26 18:46:48 +02:00
Fabien Potencier
d92fb4e8ba updated VERSION for 3.4.31 2019-08-26 18:36:29 +02:00
Nicolas Grekas
c1bca297cf Merge branch '4.3' into 4.4
* 4.3:
  [DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases
  [Messenger] Stop worker when it should stop
2019-08-26 18:27:46 +02:00
Nicolas Grekas
43e1c8eccf Merge branch '3.4' into 4.3
* 3.4:
  [DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases
2019-08-26 18:27:33 +02:00
Fabien Potencier
a5d776d51d bug #33335 [DependencyInjection] Fixed the getServiceIds implementation to always return aliases (pdommelen)
This PR was squashed before being merged into the 3.4 branch (closes #33335).

Discussion
----------

[DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases

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

Changed the getServiceIds implementation in the Container base class to include aliases. Modified existing tests. Added test which uses the PhpDumper.
Fixes https://github.com/symfony/symfony/issues/33307

Without this patch the implementations of the container are inconsistent in whether or not they return aliases (see issue). Fixing this could be considered a BC break for the affected Container class.

As an alternative to keep the behaviour in Container unchanged, the dumped container could be patched instead. And then only apply this version of the patch to master. This however keeps the inconsistency between Container and ContainerBuilder.

Commits
-------

834d5cbce2 [DependencyInjection] Fixed the `getServiceIds` implementation to always return aliases
2019-08-26 18:07:57 +02:00
pdommelen
834d5cbce2 [DependencyInjection] Fixed the getServiceIds implementation to always return aliases 2019-08-26 18:07:49 +02:00
Nicolas Grekas
0abd2712e9 [ErrorHandler] make DebugClassLoader turn multi-types declarations to "object" 2019-08-26 18:02:12 +02:00
Fabien Potencier
113fa0bc50 bug #33298 [Messenger] Stop worker when it should stop (tienvx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Stop worker when it should stop

| Q             | A
| ------------- | ---
| Branch?       | 4.3 <!-- 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 | NA   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | NA <!-- 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/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.
-->

There are 2 things about this PR:
* This PR fix the bug when using `limit`, `memory-limit`, `time-limit` options with command `messenger:consume`, these options does not work if the receiver return multiple messages
* This PR is the continue work of https://github.com/symfony/symfony/pull/32783

Commits
-------

5c1f3a2414 [Messenger] Stop worker when it should stop
2019-08-26 17:58:46 +02:00
Nicolas Grekas
6dd9d24e50 minor #33236 Add return-types with help from DebugClassLoader in the CI (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Add return-types with help from DebugClassLoader in the CI

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

I've spent a great deal of time on this PR, experimenting with adding return types to the codebase.

TL;DR: my conclusion is that we cannot make it for 5.0.

There are two reasons for this:
1. The burden this will put on the community is immense, especially when considering that third party libs must also be updated for any apps to work at all on a return-typed 5.0. Symfony must add them last, not first.
2. We need return type covariance, yet this won't be available before PHP 7.4, while 5.0 supports 7.2.

What's attached?
- ~a draft patching logic in `DebugClassLoader` to add return-type where it discovers this should be done~
- return types added automatically thanks to #33283
- ~manual fixes for situations not handled (yet, if possible at all) by that logic in `DebugClassLoader`~ #33332

What's achieved? Tests are green \o/

At this stage, I think we have to acknowledge we won't add return-types in 5.0 but prepare a serious plan to add them in 6.0.

This plan could be:
- [x] make DebugClassLoader able to automate adding return types.
- [x] in 4.4: add all possible return types that don't break BC, e.g. in `Tests` and in generated code
- [x] spot and fix places where annotations aren't accurate, add more annotations where possible.
- [x] ensure `DebugClassLoader` triggers the best possible deprecations that encourage ppl to add return-types in their libs/apps. This means we could decide to disable the current ones (see #33235) and to re-enable them in 5.1. This will also give us the time to fine-tune the tooling (item 1. on this list)

Ideally, we could reach a point where we could test branch 4.4 *with* return-types: we'd use the tooling to add them automatically in the CI job, then we'd run tests and they should be green. Let's do this?

Help Wanted, here is how:

*With PHP 7.4*, run `php .github/patch-types.php`. This will add return types everywhere possible.

Then run tests, e.g. `./phpunit src/Symfony/Component/HttpFoundation --exclude-group legacy,issue-32995`

Here are the components that fail with return types added, please help me check them all with a PR on [my fork](https://github.com/nicolas-grekas/symfony/tree/eh-return-types):
 - [x] src/Symfony/Bridge/Doctrine
 - [x] src/Symfony/Bridge/Monolog
 - [x] src/Symfony/Bridge/PhpUnit
 - [x] src/Symfony/Bridge/ProxyManager
 - [x] src/Symfony/Bridge/Twig
 - [x] src/Symfony/Bundle/DebugBundle
 - [x] src/Symfony/Bundle/FrameworkBundle
 - [x] src/Symfony/Bundle/SecurityBundle
 - [x] src/Symfony/Bundle/TwigBundle
 - [x] src/Symfony/Bundle/WebProfilerBundle
 - [x] src/Symfony/Bundle/WebServerBundle
 - [x] src/Symfony/Component/Asset
 - [x] src/Symfony/Component/BrowserKit
 - [x] src/Symfony/Component/Cache
 - [x] https://github.com/nicolas-grekas/symfony/pull/28 src/Symfony/Component/Config
 - [x] src/Symfony/Component/Console
 - [x] src/Symfony/Component/CssSelector
 - [x] src/Symfony/Component/Debug
 - [x] https://github.com/nicolas-grekas/symfony/pull/28 src/Symfony/Component/DependencyInjection
 - [x] src/Symfony/Component/DomCrawler
 - [x] src/Symfony/Component/Dotenv
 - [x] src/Symfony/Component/ErrorHandler
 - [x] src/Symfony/Component/ErrorRenderer
 - [x] https://github.com/nicolas-grekas/symfony/pull/24 src/Symfony/Component/EventDispatcher
 - [x] src/Symfony/Component/ExpressionLanguage
 - [x] src/Symfony/Component/Filesystem
 - [x] src/Symfony/Component/Finder
 - [x] src/Symfony/Component/Form
 - [x] src/Symfony/Component/HttpClient
 - [x] src/Symfony/Component/HttpFoundation
 - [x] src/Symfony/Component/HttpKernel
 - [x] src/Symfony/Component/Inflector
 - [x] src/Symfony/Component/Intl
 - [x] src/Symfony/Component/Ldap
 - [x] src/Symfony/Component/Lock
 - [x] src/Symfony/Component/Mailer
 - [x] src/Symfony/Component/Messenger
 - [x] src/Symfony/Component/Mime
 - [x] src/Symfony/Component/OptionsResolver
 - [x] src/Symfony/Component/Process
 - [x] src/Symfony/Component/PropertyAccess
 - [x] src/Symfony/Component/PropertyInfo
 - [x] https://github.com/nicolas-grekas/symfony/pull/25 src/Symfony/Component/Routing
 - [x] https://github.com/nicolas-grekas/symfony/pull/26 src/Symfony/Component/Security
 - [x] src/Symfony/Component/Security/Core
 - [x] src/Symfony/Component/Security/Guard
 - [x] src/Symfony/Component/Security/Http
 - [x] https://github.com/nicolas-grekas/symfony/pull/29 src/Symfony/Component/Serializer
 - [x] src/Symfony/Component/Security/Csrf
 - [x] src/Symfony/Component/Stopwatch
 - [x] src/Symfony/Component/Templating
 - [x] https://github.com/nicolas-grekas/symfony/pull/27 src/Symfony/Component/Translation
 - [x] src/Symfony/Component/Validator
 - [x] src/Symfony/Component/VarDumper
 - [x] src/Symfony/Component/VarExporter
 - [x] src/Symfony/Component/WebLink
 - [x] src/Symfony/Component/Workflow
 - [x] src/Symfony/Component/Yaml
 - [x] src/Symfony/Contracts

Commits
-------

11149a1fbb Add return-types with help from DebugClassLoader in the CI
2019-08-26 15:38:09 +02:00
Nicolas Grekas
11149a1fbb Add return-types with help from DebugClassLoader in the CI 2019-08-26 15:31:28 +02:00
Yonel Ceruto
db9549d775 minor #33336 [HttpKernel] do not mock removed getPublicDir() method (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] do not mock removed getPublicDir() method

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

Commits
-------

54cb471 do not mock removed getPublicDir() method
2019-08-26 09:25:46 -04:00
Christian Flothmann
54cb4713b2 do not mock removed getPublicDir() method 2019-08-26 15:05:55 +02:00
Nicolas Grekas
d887a0d941 feature #33283 [ErrorHandler] make DebugClassLoader able to add return type declarations (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] make DebugClassLoader able to add return type declarations

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

This is the current state of the patching logic I'm using in `DebugClassLoader`.
I run it after a `composer i -o` with the excluded classes emptied.
It's not perfect, it requires manual changes/review, but it did the job so far.

Patching is enabled with the `SYMFONY_PATCH_TYPE_DECLARATIONS` env var.
The value of the env var is an URL-encoded array, with the following parameters as of now:
- `force=0/1/docblock`:
  - `0` adds return types only to non-BC breaking places: internal/final/test methods;
  - `1` adds return types everywhere possible, potentially breaking BC with child classes that didn't declare the return types before;
  - `docblock` adds `@return` annotations to opt-out from deprecation notices that `DebugClassLoader` trigger otherwise - the annotation meaning: "I know a return type should be used here instead of an annotation, but I can't add it for BC reasons for now".
- `php71-compat=0/1`: to prevent using the `object` type when the code must be compatible with PHP 7.1

Commits
-------

72f6a970fc [ErrorHandler] make DebugClassLoader able to add return type declarations
2019-08-26 13:32:03 +02:00
Nicolas Grekas
a6e75fd84d Merge branch '4.3' into 4.4
* 4.3:
  [Bridge/Doctrine] fix review
2019-08-26 13:29:32 +02:00
Nicolas Grekas
861b483d83 Merge branch '3.4' into 4.3
* 3.4:
  [Bridge/Doctrine] fix review
2019-08-26 13:29:20 +02:00
Nicolas Grekas
0a00af2b77 [Bridge/Doctrine] fix review 2019-08-26 13:01:58 +02:00
Nicolas Grekas
72f6a970fc [ErrorHandler] make DebugClassLoader able to add return type declarations 2019-08-26 11:53:50 +02:00
Nicolas Grekas
123fc624e5 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
  fix merge
2019-08-26 11:32:48 +02:00
Nicolas Grekas
97832ec5cd fix merge 2019-08-26 11:28:48 +02:00
Nicolas Grekas
5a6558b7fa fix merge 2019-08-26 11:20:32 +02:00
Nicolas Grekas
089097046b Merge branch '4.3' into 4.4
* 4.3: (23 commits)
  fix merge
  [SecurityBundle] fix return type declarations
  [BrowserKit] fix return type declarations
  [PropertyInfo] fix return type declarations
  [Bridge/Doctrine] fix return type declarations
  [Form] fix return type declarations
  [Console] fix return type declarations
  [Intl] fix return type declarations
  [Templating] fix return type declarations
  [DomCrawler] fix return type declarations
  [Validator] fix return type declarations
  [Process] fix return type declarations
  [Workflow] fix return type declarations
  [Cache] fix return type declarations
  [Serializer] fix return type declarations
  [Translation] fix return type declarations
  [DI] fix return type declarations
  [Config] fix return type declarations
  [HttpKernel] Fix return type declarations
  [Security] Fix return type declarations
  ...
2019-08-26 11:00:56 +02:00