Commit Graph

44158 Commits

Author SHA1 Message Date
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
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
Fabien Potencier
1bfefefcf5 feature #33446 [TwigBridge] lint all templates from configured Twig paths if no argument was provided (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] lint all templates from configured Twig paths if no argument was provided

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

All details in PR title and related issue https://github.com/symfony/symfony/issues/33443.

Commits
-------

baddf1d9de lint all templates from configured Twig paths if no argument was provided
2019-09-03 18:01:53 +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
Fabien Potencier
85d0982f84 bug #33429 [Mailer] hotfix (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] hotfix

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

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

e15df84313 [Mailer] fixed wrong  behavior
2019-09-02 16:41:57 +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
378abfae04 feature #33424 [Mailer] Change the DSN semantics (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Change the DSN semantics

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| 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        | https://github.com/symfony/symfony-docs/pull/12258

I'm not very satisfied with the current DSNs for the Mailer. First, the scheme/protocol should use the provider name, then, there is no way to change the host, which would be nice to debug more easily (using a requestb.in service for instance).

Before:

```
smtp://USERNAME:PASSWORD@mailgun
http://KEY:DOMAIN@mailgun
```

After:

```
mailgun+smtp://USERNAME:PASSWORD@default
mailgun+http://KEY:DOMAIN@default

# New
mailgun+http://KEY:DOMAIN@somewhere.com:99
```

SMTP DSNs did not change, but the special sendmail one did:

Before:

```
smtp://sendmail
```

After:

```
sendmail+smtp://default
```

And for the `null` transport:

Before:

```
smtp://null
```

After:

```
null://null
```

Commits
-------

469c989697 [Mailer] Change the DSN semantics
2019-09-02 16:11:47 +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
ef2b65aaf1 minor #33419 [Mailer] Renamed getName() to toString() (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Renamed getName() to toString()

| 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

The `getName()` method on a Transport was introduced in 4.4. We rename it here as this method is mainly used by the profiler to display useful information about which mailer is used. This is more a string representation than a name (which is going to be introduced in the PR about multiple mailer support).

Commits
-------

5b7bba9ef3 [Mailer] Renamed getName() to toString()
2019-09-02 11:58:01 +02:00
Fabien Potencier
5b7bba9ef3 [Mailer] Renamed getName() to toString() 2019-09-02 11:41:25 +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
Fabien Potencier
bcb91eadf0 bug #33408 Fix the profiler panel for Mailer (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix the profiler panel for Mailer

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

Currently, the web profiler panel for Mailer is never shown as `$this->mailerConfigEnabled` is set after the profiler is configured.

Commits
-------

326afc7a09 Fix the profiler panel for Mailer
2019-09-01 18:10:31 +02:00
Fabien Potencier
326afc7a09 Fix the profiler panel for Mailer 2019-09-01 17:28:36 +02:00