Commit Graph

42973 Commits

Author SHA1 Message Date
Nicolas Grekas
af850146a4 [Bridge/PhpUnit] fix running composer to install phpunit 2019-07-04 18:09:01 +02:00
Yonel Ceruto
0151279cfe minor #32359 [ErrorCatcher] Pretty print JSON formatted errors (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorCatcher] Pretty print JSON formatted errors

| 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
| Fixed tickets | -
| License       | MIT
| Doc PR        | not needed

A long string with JSON contents is not very useful to quickly parse the error contents, so I propose to "pretty print" the JSON errors.

Commits
-------

ab926d2 [ErrorCatcher] Pretty print JSON formatted errors
2019-07-04 11:27:52 -04:00
Javier Eguiluz
ab926d2065 [ErrorCatcher] Pretty print JSON formatted errors 2019-07-04 11:24:36 -04:00
Nicolas Grekas
b9b03fe1d3 Merge branch '4.3' into 4.4
* 4.3:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:46:31 +02:00
Nicolas Grekas
f59bc48850 Merge branch '4.2' into 4.3
* 4.2:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:45:39 +02:00
Nicolas Grekas
e9852bd9a1 Merge branch '3.4' into 4.2
* 3.4:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:45:20 +02:00
Nicolas Grekas
a383649ad7 bug #32363 [FrameworkBundle] reset cache pools between requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] reset cache pools between requests

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

Looks like we missed this part: cache pools should all be reset between requests, at least to persist any deferred items. Replaces #32361 (which should be applied when merging 3.4 into 4.2).

Commits
-------

5ff45bac66 [FrameworkBundle] reset cache pools between requests
2019-07-04 15:42:09 +02:00
Nicolas Grekas
db05791ceb bug #32365 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass

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

Spotted in and needed by #32294

Commits
-------

b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
2019-07-04 15:33:02 +02:00
Nicolas Grekas
b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass 2019-07-04 11:26:59 +02:00
Nicolas Grekas
5ff45bac66 [FrameworkBundle] reset cache pools between requests 2019-07-04 11:11:41 +02:00
Fabien Potencier
e3927b6294 minor #32354 [Messenger] Use ConnectionRegistry instead of RegistryInterface (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Use ConnectionRegistry instead of RegistryInterface

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

This PR changes the constructor type-hint on `DoctrineTransportFactory` from `Symfony\Bridge\Doctrine\RegistryInterface` to the smaller `Doctrine\Common\Persistence\ConnectionRegistry`. Since we only call the `getConnection()` method, this interface is sufficient.

This change allows to use the factory without the Doctrine bridge and makes it easier to use it stand-alone.

Commits
-------

ce6a5ad235 Use ConnectionRegistry instead of RegistryInterface.
2019-07-04 09:48:35 +02:00
Fabien Potencier
b7c9fcf7a1 bug #32348 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat() (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32348).

Discussion
----------

[HttpFoundation] Accept must take the lead for Request::getPreferredFormat()

| 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

Follow up PR to #32344: if both `Accept` and `Content-Type` are defined, `Accept` must take the lead because it explicitly tells what format the client expect as a response.

Before:

```
$ curl -H 'Accept: application/json' -H 'Content-Type: text/xml' -i 'https://127.0.0.1:8000/userinfo'

[snip]
content-type: text/xml
```

After:

```
$ curl -H 'Accept: application/json' -H 'Content-Type: text/xml' -i 'https://127.0.0.1:8000/userinfo'

[snip]
content-type: application/json
```

Actually, I'm not sure that inferring the content type of the response using the `Content-Type` provided for the request body is a good idea. The HTTP RFC explicitly states that `Accept` must be used to hint a preferred response format (`Content-Type` on the request indicates the type of associated its the body). I would be in favor of being more conservative: use `Accept` if provided (a best practice anyway), and fallback to the default value (HTML by default) otherwise. WDYT?

Commits
-------

60d997df75 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat()
2019-07-04 09:46:57 +02:00
Kévin Dunglas
60d997df75 [HttpFoundation] Accept must take the lead for Request::getPreferredFormat() 2019-07-04 09:46:50 +02:00
Fabien Potencier
9b4f8014dc feature #32207 [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client (dunglas)
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead (closes #32207).

Discussion
----------

[FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client

| 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

I'm adding a testing client for API Platform that implements the interfaces of HttpClient: https://github.com/api-platform/core/pull/2608
Most PHPUnit assertions provided by Symfony are useful and can be reused, but the ones using the crawler are not relevant and pollute auto-complete suggestions (because a web API usually returns JSON, not HTML).

This PR splits the existing trait to allow reusing the HTTP related assertions only.

Commits
-------

cd0341e69b [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client
2019-07-04 08:46:19 +02:00
Kévin Dunglas
cd0341e69b [FrameworkBundle] Allow to use the BrowserKit assertions with Panther and API Platform's test client 2019-07-04 08:46:07 +02:00
Alexander M. Turek
ce6a5ad235 Use ConnectionRegistry instead of RegistryInterface. 2019-07-04 02:03:26 +02:00
Fabien Potencier
b79a1bf229 Merge branch '4.3' into 4.4
* 4.3:
  Fixes windows error
  [Messenger] Added more test for MessageBus
  fixed typo
  [Filesystem] added missing deprecations to UPGRADE-4.3.md
  Fix authentication for redis transport
  only decorate when an event dispatcher was passed
  [FrmaeworkBundle] More simplifications in the DI configuration
  Fixing validation for messenger transports retry_strategy service key
  Removed unused field.
  Remove @internal annotations for the serilize methods
  [Lock] Stores must implement `putOffExpiration`
  Annotated correct return type for getInEdges()/getOutEdges().
  deprecate the framework.templating option
2019-07-03 19:15:45 +02:00
Fabien Potencier
98c36025cd Merge branch '4.2' into 4.3
* 4.2:
  Fixes windows error
  Removed unused field.
  [Lock] Stores must implement `putOffExpiration`
  Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 19:15:34 +02:00
Fabien Potencier
02a25fe518 Merge branch '3.4' into 4.2
* 3.4:
  Fixes windows error
  Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 19:14:02 +02:00
Fabien Potencier
1dc3b4aaad bug #32187 [PHPUnit] Fixed composer error on Windows (misterx)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #32187).

Discussion
----------

[PHPUnit] Fixed composer error on Windows

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

Fixes bug when composer runs  from bat file that described in PATH env.

Commits
-------

1f8927a9a6 Fixes windows error
2019-07-03 19:13:30 +02:00
misterx
1f8927a9a6 Fixes windows error 2019-07-03 19:13:23 +02:00
Fabien Potencier
10449cb493 feature #32344 [HttpFoundation][HttpKernel] Improving the request/response format autodetection (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][HttpKernel] Improving the request/response format autodetection

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

Mainly for API-based apps, currently the response header `Content-Type` (if no provided) is guessed based on the request format (`_format` attribute), falling back to `html` by default.

Especially for the new error renderer system, where any kind of error can occur and it becomes an http response, this PR improves this guesser mechanism by taking into account also the `Content-type` of the request.

Example:
```bash
$ curl -X POST -H 'Content-Type: application/json' -i 'https://127.0.0.1:8000/login'
```
**before:**
```bash
HTTP/2 500
cache-control: no-cache, private
content-type: text/html; charset=UTF-8 # <- inaccurate
...

{"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"}
```
Most of the 3rd-party bundles that I know (`api-platform/core`, `FOSRestBundle`) need a dedicated listener to achieve it right.

**after:**
```bash
HTTP/2 500
cache-control: no-cache, private
content-type: application/json
...

{"title":"Internal Server Error","status":500,"detail":"Invalid credentials!"}
```
Of course, this applies to all kind of responses, as long as the `Content-Type` is not explicitly provided. So, as a last chance, the `Accept` heading of the request is also taken into account to detect the preferred format:
```bash
$ curl -H 'Accept: application/json' -i 'https://127.0.0.1:8000/userinfo'
HTTP/2 404
cache-control: no-cache, private
content-type: application/json
...

{"title":"Not Found","status":404,"detail":"No route found for \"GET \/userinfo\""}
```
They could be other places in the code where this new method could also be useful, please advise :)

WDYT?

Commits
-------

1952928471 Improving the request/response format autodetection
2019-07-03 19:09:44 +02:00
Yonel Ceruto
1952928471 Improving the request/response format autodetection 2019-07-03 12:46:41 -04:00
Fabien Potencier
c33c396a63 bug #32299 [Lock] Stores must implement putOffExpiration (jderusse)
This PR was merged into the 4.2 branch.

Discussion
----------

[Lock] Stores must implement `putOffExpiration`

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

Following https://github.com/symfony/symfony/pull/32198#pullrequestreview-256165051 every stores MUST implement the method `putOffExpiration` either by ignoring the arguments (by design they lock forever) or using a mechanism to define the expiration.

It was a mistake to add the dockblock `@throws NotSupportedException` tell me if it's a BC break, I'll create a dedicated PR for it.

Commits
-------

c986c86d1c [Lock] Stores must implement `putOffExpiration`
2019-07-03 18:27:50 +02:00
Fabien Potencier
50dfcaa8ef bug #32302 [Mime] Remove @internal annotations for the serialize methods (francoispluchino)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mime] Remove @internal annotations for the serialize methods

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes (it's not really a bug)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Currently, when we extend the `Symfony\Component\Mime\Message` and `Symfony\Component\Mime\MessageRaw` classes of the Mime component, we get 2 deprecation messages:

```
The "Symfony\Component\Mime\Message::__serialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".
```
and
```
The "Symfony\Component\Mime\Message::__unserialize()" method is considered internal. It may change without further notice. You should not extend it from "Vendor\FooMessage".
```

However, we need to add properties to the new class, and so, we need to extend `__serialize()` and `__unserialize()` methods in the same way as `Symfony\Bridge\Twig\Mime\TemplatedEmail`, to know, retrieve the serialization of the parent class:

```php
    public function __serialize(): array
    {
        return [$this->foo, $this->bar, $this->baz, parent::__serialize()];
    }

    public function __unserialize(array $data): void
    {
        [$this->foo, $this->bar, $this->baz, $parentData] = $data;

        parent::__unserialize($parentData);
    }
```

But given that the third-party components use another namespace, we get the 2 deprecation messages, while the 2 methods must be inevitably used and extended. Of course, the methods `serialize()` and `unserialize()` are always marked by the `@internal` annotation and the `final` keyword.

This PR so deletes the 2 deprecation messages that should not be displayed.

Commits
-------

8544a35e52 Remove @internal annotations for the serilize methods
2019-07-03 18:27:00 +02:00
Fabien Potencier
f5a0633b40 minor #32338 [Messenger] Added more test for MessageBus (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Added more test for MessageBus

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

[This code](bed50fd542/src/Symfony/Component/Messenger/MessageBus.php (L33-L49)) is quite hard to understand. So It must be covered by tests.

More over, it will help people to understand how it works

Commits
-------

5f4ab23991 [Messenger] Added more test for MessageBus
2019-07-03 18:25:48 +02:00
Fabien Potencier
d65a5e26cf minor #32340 [Messager] Simplified MessageBus::__construct() (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messager] Simplified MessageBus::__construct()

| 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 third path deals with generator (or other king of iterator that are

not an IteratorAggregate). It means, very few cases in practice

The previous code saved one object on the first call of `self::dispatch()`
by replacing it at runtime. More over, this object (anon. class) is very
light in memory.

The performance optimization (even if fun) is not useful here. Let's
make the code readable to everyone.

Commits
-------

6b5671f5ae [Messager] Simplified MessageBus::__construct()
2019-07-03 18:24:36 +02:00
Grégoire Pineau
6b5671f5ae [Messager] Simplified MessageBus::__construct()
The third path deals with generator (or other king of iterator that are
not an IteratorAggregate). It means, very few cases in practice

The previous code saved one object on the first call of `self::dispatch()`
by replacing it at runtime. More over, this object (anon. class) is very
light in memory.

The performance optimization (even if fun) is not useful here. Let's
make the code readable to everyone.
2019-07-03 15:46:19 +02:00
Fabien Potencier
2452ef8978 minor #32188 [PropertyInfo] add static cache to ContextFactory (bastnic)
This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] add static cache to ContextFactory

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no (performance...)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32073, https://github.com/api-platform/api-platform/issues/1159
| License       | MIT
| Doc PR        | no

The issue is very very well described here #32073, and was also discussed a few weeks ago with @dunglas here https://github.com/api-platform/api-platform/issues/1159.

`ContextFactory::createFromReflector` is heavy, and it's called redundanlty
by `Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor` for each property
and methods. Avoid that by parsing it only once and then use static cache

This is a quite big performance problem.

![Deepin Capture-écran_zone de sélection _20190626142041](https://user-images.githubusercontent.com/84887/60179692-8471c480-981e-11e9-9e3c-3f9c0b83b01b.png)

Commits
-------

063e880861 [PropertyInfo] add static cache to ContextFactory
2019-07-03 15:36:04 +02:00
Fabien Potencier
df13b506eb feature #32231 [HttpClient] Add support for NTLM authentication (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Add support for NTLM authentication

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

Someone mentioned NTLM auth on Twitter, so here we are, this adds support for it.
Requires curl.

Commits
-------

548f4fd0ea [HttpClient] Add support for NTLM authentication
2019-07-03 15:28:45 +02:00
Fabien Potencier
6abaa8c5a2 feature #32265 [Validator] deprecate non-string constraint violation codes (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] deprecate non-string constraint violation codes

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

Commits
-------

e217729066 deprecate non-string constraint violation codes
2019-07-03 15:25:50 +02:00
Fabien Potencier
09e762e819 bug #32334 [Messenger] Fix authentication for redis transport (alexander-schranz)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix authentication for redis transport

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32304
| License       | MIT
| Doc PR        | symfony/symfony-docs#... TODO

This will implement support for password in redis stream transport.

Commits
-------

bedae5dde9 Fix authentication for redis transport
2019-07-03 15:20:24 +02:00
Fabien Potencier
927a3341c0 minor #32281 [DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges()

| 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

This changed annotation was quite helpful when analyzing `PhpDumper` for #32266.

Commits
-------

28882f52cb Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 15:17:20 +02:00
Fabien Potencier
4e32643bdf feature #31528 [Validator] Add a Length::$allowEmptyString option to reject empty strings (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Add a Length::$allowEmptyString option to reject empty strings

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- 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   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | Todo (change the warning on top of https://symfony.com/doc/current/reference/constraints/Length.html)

which defaults to `true` in 4.4 but will trigger a deprecation if not set explicitly
in order to make the default `false` in 5.0.

While it could be solved now thanks to #29641 by using both `@Length(min=1)` & `@NotBlank(allowNull=true)` constraints,
as expressed in https://github.com/symfony/symfony/issues/27876#issuecomment-403307783 and following comments, the `@Length(min=1)` behavior doesn't match our expectations when reading it: it feels logical to invalidate empty strings, but it actually doesn't.
Hence the proposal of making the behavior of rejecting empty strings the default in 5.0.

In my opinion, the flag could even be removed later.

Commits
-------

e113e7f812 [Validator] Add a Length::$allowEmptyString option to reject empty strings
2019-07-03 15:15:57 +02:00
Fabien Potencier
ea0656a4f4 minor #32305 [HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel][DX] Improve the error message when not defining the controller as a service but using construct parameters

| 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 | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- 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.
-->

I'm working with newcomers to the symfony framework ATM and one of them has got stuck in this errors trying to understand why the constructor argument declared as a a service would not work and didn't check if the controller was declared as a service itself.

I feel like this could be improve to be really specific since "such" is not that specific ;).

Commits
-------

c670d5120e [HttpKernel][DX] Improve the error message when not defining the controller as a service but using contruct parameters
2019-07-03 15:05:19 +02:00
Fabien Potencier
7b9c026153 feature #32081 [WIP][Mailer] Overwrite envelope sender and recipients from config (Devristo)
This PR was squashed before being merged into the 4.4 branch (closes #32081).

Discussion
----------

[WIP][Mailer] Overwrite envelope sender and recipients from config

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31592 #31733   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

# Description

This MR adds the following configuration, example:

```yaml
# config/packages/mailer.yaml
framework:
  mailer:
    envelope:
      sender: 'sender@example.org'
      recipients: ['redirected@example.org']
```
In turn the `\Symfony\Component\Mailer\EventListener\EnvelopeListener` will be configured to alter the sender and recipient addresses before the message has been sent.

Note: it will only alter the envelope, thus rerouting the message to the correct mailbox. However the message itself will still have the original 'from' and 'to' headers.

# Todos

- [x] Alter configuration and dependency injection
- [x] Create test case
- [ ] Update XML config schema?
- [ ] Doc PR

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

8e0c8006d8 [WIP][Mailer] Overwrite envelope sender and recipients from config
2019-07-03 14:59:34 +02:00
Chris Tanaskoski
8e0c8006d8 [WIP][Mailer] Overwrite envelope sender and recipients from config 2019-07-03 14:59:24 +02:00
Fabien Potencier
bed50fd542 minor #32323 [FrmaeworkBundle] More simplifications in the DI configuration (javiereguiluz)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrmaeworkBundle] More simplifications in the DI configuration

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

This is the continuation of #32322 for the 4.3 branch.

Commits
-------

fa6ae8ce50 [FrmaeworkBundle] More simplifications in the DI configuration
2019-07-03 14:57:34 +02:00
Grégoire Pineau
5f4ab23991 [Messenger] Added more test for MessageBus 2019-07-03 14:56:57 +02:00
Fabien Potencier
802dc1b1b2 minor #32315 [Filesystem] deprecate calling isAbsolutePath with a null (smoench)
This PR was merged into the 4.4 branch.

Discussion
----------

[Filesystem] deprecate calling isAbsolutePath with a null

| 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  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This PR is a result of #32247 and deprecates calling `Filesystem::isAbsolutePath()` with a `null` value.

Commits
-------

93190182f6 [Filesystem] depreacte calling isAbsolutePath with a null
2019-07-03 14:56:33 +02:00
Fabien Potencier
c3e914c6eb minor #32316 [Ldap] Document the new exceptions thrown by the code (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Ldap] Document the new exceptions thrown by the code

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

While deciding if we should document #31547 I saw that the new exceptions weren't documented in the code. I don't know if this is the place where this should be added.

Commits
-------

0d27af93ea [Ldap] Document the new exceptions thrown by the code
2019-07-03 14:43:13 +02:00
Fabien Potencier
34c50c0963 minor #32306 [DependencyInjection] Removed unused field (derrabus)
This PR was merged into the 4.2 branch.

Discussion
----------

[DependencyInjection] Removed unused field

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

A minor issue I discovered while analyzing the DI component for #32238: `AnalyzeServiceReferencesPass` defines a private field `$expressionLanguage` that is not used.

Commits
-------

58651409b4 Removed unused field.
2019-07-03 14:39:02 +02:00
Fabien Potencier
74bd8b6bca bug #32309 Fixing validation for messenger transports retry_strategy service key (weaverryan)
This PR was merged into the 4.3 branch.

Discussion
----------

Fixing validation for messenger transports retry_strategy service key

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

Manually tested locally. `validate()` is too because the defaults are already applied.

Commits
-------

c6e18374a2 Fixing validation for messenger transports retry_strategy service key
2019-07-03 14:37:49 +02:00
Fabien Potencier
e0e476da71 minor #32317 [Mime] Updated some PHPDoc contents (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch (closes #32317).

Discussion
----------

[Mime] Updated some PHPDoc contents

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

While documenting #30981 I found some PHPDoc info not clear enough. This "improves" it, but if you don't like it, it's OK to close this. Thanks.

Commits
-------

9432f1f970 [Mime] Updated some PHPDoc contents
2019-07-03 14:35:36 +02:00
Javier Eguiluz
9432f1f970 [Mime] Updated some PHPDoc contents 2019-07-03 14:35:29 +02:00
Fabien Potencier
ec3e66dc1b minor #32269 [PropertyAccess] Adds entries to CHANGELOG and UPGRADE (jschaedl)
This PR was squashed before being merged into the 4.4 branch (closes #32269).

Discussion
----------

[PropertyAccess] Adds entries to CHANGELOG and UPGRADE

| 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 | #32179   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

In PR #32241 I missed to add entries to the CHANGELOG and UPGRADE file.

Commits
-------

c4afbf376f [PropertyAccess] Adds entries to CHANGELOG and UPGRADE
2019-07-03 14:34:57 +02:00
Jan Schädlich
c4afbf376f [PropertyAccess] Adds entries to CHANGELOG and UPGRADE 2019-07-03 14:34:50 +02:00
Fabien Potencier
5909e6f336 fixed typo 2019-07-03 14:31:50 +02:00
Fabien Potencier
51f01bdd9d minor #32267 [FrameworkBundle] deprecate the framework.templating option (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] deprecate the framework.templating option

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

The config node has already been removed in the `master` branch in #31800. For DX it would have been better to have this deprecation in 4.3 (see e.g. #32120), but it's probably too late to ship this as a bugfix.

Commits
-------

ba241ce3cc deprecate the framework.templating option
2019-07-03 14:31:16 +02:00
Fabien Potencier
6bf5d8fce3 minor #32337 [Filesystem] added missing deprecations to UPGRADE-4.3.md (smoench)
This PR was merged into the 4.3 branch.

Discussion
----------

[Filesystem] added missing deprecations to UPGRADE-4.3.md

| 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
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | no needed

This PR is a result of #32315 and adds missing deprecations to UPGRADE-4.3.md.

Commits
-------

b5c6a349ab [Filesystem] added missing deprecations to UPGRADE-4.3.md
2019-07-03 14:24:57 +02:00