Commit Graph

42823 Commits

Author SHA1 Message Date
Nicolas Grekas 7f7c142a3b Merge branch '4.4'
* 4.4:
  [Mailer] fixed tests on Windows
  [PhpUnitBridge] fix tests
  [Mailer] fixed error message when connecting to a stream raises an error before connect()
  [Mailer] fixed timeout type hint
  improve error messages in the event dispatcher
  [Security/Core] work around sodium_compat issue
  bumped Symfony version to 4.3.3
  updated VERSION for 4.3.2
  updated CHANGELOG for 4.3.2
  bumped Symfony version to 4.2.11
  updated VERSION for 4.2.10
  updated CHANGELOG for 4.2.10
  bumped Symfony version to 3.4.30
  updated VERSION for 3.4.29
  update CONTRIBUTORS for 3.4.29
  updated CHANGELOG for 3.4.29
  Fixed type annotation.
2019-06-27 18:53:23 +02:00
Fabien Potencier 4d8c473fd3 Merge branch '4.3' into 4.4
* 4.3:
  [Mailer] fixed tests on Windows
  [PhpUnitBridge] fix tests
  [Mailer] fixed error message when connecting to a stream raises an error before connect()
  [Mailer] fixed timeout type hint
  improve error messages in the event dispatcher
  [Security/Core] work around sodium_compat issue
  bumped Symfony version to 4.3.3
  updated VERSION for 4.3.2
  updated CHANGELOG for 4.3.2
  bumped Symfony version to 4.2.11
  updated VERSION for 4.2.10
  updated CHANGELOG for 4.2.10
  bumped Symfony version to 3.4.30
  updated VERSION for 3.4.29
  update CONTRIBUTORS for 3.4.29
  updated CHANGELOG for 3.4.29
  Fixed type annotation.
2019-06-27 18:48:03 +02:00
Fabien Potencier 00e13677ba minor #32228 [Mailer] fix tests on Windows (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] fix tests on Windows

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

90f61e9efa [Mailer] fixed tests on Windows
2019-06-27 18:47:10 +02:00
Fabien Potencier 90f61e9efa [Mailer] fixed tests on Windows 2019-06-27 18:29:52 +02:00
Fabien Potencier d18fd01c39 minor #32225 [PhpUnitBridge] fix tests (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[PhpUnitBridge] fix tests

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

The bridge reads $_SERVER/$_ENV  now.

Commits
-------

9b69dc651a [PhpUnitBridge] fix tests
2019-06-27 18:26:18 +02:00
Nicolas Grekas 9b69dc651a [PhpUnitBridge] fix tests 2019-06-27 18:09:32 +02:00
Fabien Potencier e13309c3f8 Merge branch '4.4'
* 4.4:
  made BuferringLogger classes internal and final
  Added ErrorHandler component
2019-06-27 16:24:50 +02:00
Fabien Potencier acd7bd679b bug #32219 Make BuferringLogger classes internal and final (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Make BuferringLogger classes internal and final

| 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? | yes <!-- 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 `BufferingLogger` classes are internal code that nobody should use directly. Let's make it clear.

Commits
-------

7dd391ed97 made BuferringLogger classes internal and final
2019-06-27 15:38:11 +02:00
Fabien Potencier 7dd391ed97 made BuferringLogger classes internal and final 2019-06-27 15:21:55 +02:00
Fabien Potencier 13a5e2dd1f feature #31065 Add ErrorHandler component (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Add ErrorHandler component

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

Mainly for API-based apps that don't require TwigBundle to get the correct exception response according to the request format (aka `_format` attribute).

![exception_response](https://user-images.githubusercontent.com/2028198/55509651-713dc700-562a-11e9-8b98-bef3b0229397.gif)

✔️ [RFC7807](https://tools.ietf.org/html/rfc7807) compliant for JSON and XML formats.

---

This introduce a new `ErrorRenderer` service that render a `FlattenException` into a given format:
```php
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\JsonErrorRenderer;

$renderers = [
    new HtmlErrorRenderer(),
    new JsonErrorRenderer(),
    // ...
];
$errorRenderer = new ErrorRenderer($renderers);

return new Response(
    $errorRenderer->render($exception, $request->getRequestFormat()),
    $exception->getStatusCode(),
    $exception->getHeaders()
);
```

The built-in error renderers are:

| Format | Class |
| --- | --- |
| html | HtmlErrorRenderer |
| json | JsonErrorRenderer |
| xml, atom | XmlErrorRenderer |
| txt | TxtErrorRenderer |

And you can add your own error renderer by implementing the `ErrorRendererInterface` and tagging it with `error_handler.renderer` in your service definition.

Creating your own error renderer for a built-in format will end up replacing the related built-in error renderer.

Demo: https://github.com/yceruto/error-handler-app ([add custom error renderer](06fc647841))

Commits
-------

7057244890 Added ErrorHandler component
2019-06-27 14:40:37 +02:00
Fabien Potencier f2f7fb4cf2 bug #32211 [Mailer] Fix error message when connecting to a stream raises an error before connect() (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Fix error message when connecting to a stream raises an error before connect()

| 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 | see https://github.com/swiftmailer/swiftmailer/issues/1201
| License       | MIT
| Doc PR        | n/a

According to the PHP docs, "If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call.".

Using the `@` operator means that we get a generic error message without any clues about why connection cannot be done. Using an error handler allows to get the real issue.

Commits
-------

eb15bffa78 [Mailer] fixed error message when connecting to a stream raises an error before connect()
2019-06-27 13:12:59 +02:00
Fabien Potencier eb15bffa78 [Mailer] fixed error message when connecting to a stream raises an error before connect() 2019-06-27 11:33:25 +02:00
Fabien Potencier 791a2127aa bug #32210 [Mailer] Fix timeout type hint (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Fix timeout type hint

| 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

The timeout on a socket is a float, not an integer.

Commits
-------

0e7ed9e45c [Mailer] fixed timeout type hint
2019-06-27 11:07:55 +02:00
Fabien Potencier 0e7ed9e45c [Mailer] fixed timeout type hint 2019-06-27 10:51:02 +02:00
Fabien Potencier e55978ada8 bug #32199 [EventDispatcher] improve error messages in the event dispatcher (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[EventDispatcher] improve error messages in the event dispatcher

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

Commits
-------

0b381dbe1d improve error messages in the event dispatcher
2019-06-27 09:31:09 +02:00
Christian Flothmann 0b381dbe1d improve error messages in the event dispatcher 2019-06-27 08:42:14 +02:00
Nicolas Grekas 1985a5cc13 Merge branch '4.2' into 4.3
* 4.2:
  [Security/Core] work around sodium_compat issue
  bumped Symfony version to 4.2.11
  updated VERSION for 4.2.10
  updated CHANGELOG for 4.2.10
  bumped Symfony version to 3.4.30
  updated VERSION for 3.4.29
  update CONTRIBUTORS for 3.4.29
  updated CHANGELOG for 3.4.29
2019-06-26 20:29:07 +02:00
Nicolas Grekas 2fdfa1a8eb Merge branch '3.4' into 4.2
* 3.4:
  [Security/Core] work around sodium_compat issue
  bumped Symfony version to 3.4.30
  updated VERSION for 3.4.29
  update CONTRIBUTORS for 3.4.29
  updated CHANGELOG for 3.4.29
2019-06-26 20:27:58 +02:00
Nicolas Grekas eb438a48d6 bug #32200 [Security/Core] work around sodium_compat issue (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Core] work around sodium_compat issue

| 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 by @mbabker in https://github.com/symfony/symfony/pull/32169
1.0.9 per https://github.com/jedisct1/libsodium/releases/tag/1.0.9

Commits
-------

df50685abf [Security/Core] work around sodium_compat issue
2019-06-26 20:25:43 +02:00
Nicolas Grekas df50685abf [Security/Core] work around sodium_compat issue 2019-06-26 20:07:24 +02:00
Fabien Potencier 2afa71e0d8 bumped Symfony version to 4.3.3 2019-06-26 16:31:16 +02:00
Fabien Potencier 288bc24d03
Merge pull request #32195 from fabpot/release-4.3.2
released v4.3.2
2019-06-26 16:26:34 +02:00
Fabien Potencier 6314d4f9bc updated VERSION for 4.3.2 2019-06-26 16:26:16 +02:00
Fabien Potencier fde0b1fa9e updated CHANGELOG for 4.3.2 2019-06-26 16:26:04 +02:00
Fabien Potencier a84fb88d07 bumped Symfony version to 4.2.11 2019-06-26 16:23:57 +02:00
Fabien Potencier 6941a924bf
Merge pull request #32192 from fabpot/release-4.2.10
released v4.2.10
2019-06-26 16:20:22 +02:00
Fabien Potencier c8899f3704 updated VERSION for 4.2.10 2019-06-26 16:19:57 +02:00
Fabien Potencier 3b145df403 updated CHANGELOG for 4.2.10 2019-06-26 16:19:37 +02:00
Fabien Potencier fe5a4ee999 bumped Symfony version to 3.4.30 2019-06-26 16:17:55 +02:00
Fabien Potencier 4c9b6d7d89
Merge pull request #32190 from fabpot/release-3.4.29
released v3.4.29
2019-06-26 15:56:55 +02:00
Fabien Potencier 5296d2dfa0 updated VERSION for 3.4.29 2019-06-26 15:56:39 +02:00
Fabien Potencier 7f886dcef0 update CONTRIBUTORS for 3.4.29 2019-06-26 15:56:32 +02:00
Fabien Potencier 6425639fe0 updated CHANGELOG for 3.4.29 2019-06-26 15:56:21 +02:00
Fabien Potencier 6dde428e35 Merge branch '4.2' into 4.3
* 4.2:
  Fixed type annotation.
2019-06-26 15:54:39 +02:00
Fabien Potencier 14b0409339 Merge branch '3.4' into 4.2
* 3.4:
  Fixed type annotation.
2019-06-26 15:53:23 +02:00
Fabien Potencier 01fc2b409e minor #32185 [Routing] Fixed type annotation (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] Fixed type annotation

| 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

The `UrlGeneratorInterface::generate()` method expects an array as argument `$parameters`, but the docblock does not reflect that. This PR fixes the type. Discovered while working on #32176.

Commits
-------

753bf7e0df Fixed type annotation.
2019-06-26 14:30:21 +02:00
Fabien Potencier c10ad18c5a minor #32183 [Form] Removed legacy code from NumberType (yceruto)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Form] Removed legacy code from NumberType

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

Ref: https://github.com/symfony/symfony/pull/32130

Commits
-------

148ba1feeb Removed legacy code from NumberType
2019-06-26 14:27:25 +02:00
Nicolas Grekas 01c096022c Merge branch '4.4'
* 4.4:
  Reject phpunit-bridge v5 for now
  Revert "Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)""
2019-06-26 14:22:13 +02:00
Nicolas Grekas 80e28a0acd Merge branch '4.3' into 4.4
* 4.3:
  Reject phpunit-bridge v5 for now
  Revert "Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)""
2019-06-26 14:22:07 +02:00
Nicolas Grekas e24e948a42 Reject phpunit-bridge v5 for now 2019-06-26 14:21:28 +02:00
Nicolas Grekas 5797e7b2f2 Revert "Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)""
This reverts commit 4814fd3a4e.
2019-06-26 14:14:14 +02:00
Nicolas Grekas 28cbffcc9f Merge branch '4.4'
* 4.4:
  Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)"
2019-06-26 14:06:05 +02:00
Nicolas Grekas 204e87a4c8 Merge branch '4.3' into 4.4
* 4.3:
  Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)"
2019-06-26 14:06:01 +02:00
Nicolas Grekas 4814fd3a4e Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)"
This reverts commit 64b68d4922, reversing
changes made to 3cd795fdde.
2019-06-26 14:05:53 +02:00
Nicolas Grekas d5b01afd13 Merge branch '4.4'
* 4.4:
  [PhpUnitBridge] Fix tests
2019-06-26 13:29:16 +02:00
Nicolas Grekas f0a66754b8 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] Fix tests
2019-06-26 13:29:11 +02:00
Nicolas Grekas bca4761f37 [PhpUnitBridge] Fix tests 2019-06-26 13:29:01 +02:00
Alexander M. Turek 753bf7e0df Fixed type annotation. 2019-06-26 13:14:13 +02:00
Yonel Ceruto 148ba1feeb Removed legacy code from NumberType 2019-06-26 06:38:17 -04:00
Nicolas Grekas 0c90809ebd Merge branch '4.4'
* 4.4:
  Bump phpunit-bridge
2019-06-26 12:04:44 +02:00