Commit Graph

34838 Commits

Author SHA1 Message Date
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
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
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
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
Javier Eguiluz
e6d76bae9f [FrameworkBundle] Simplified some code in the DI configuration 2019-07-03 14:23:51 +02:00
Fabien Potencier
70318b4647 feature #32255 [HttpFoundation] Drop support for ApacheRequest (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Drop support for ApacheRequest

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

`ApacheUrlMatcher` has been [deprecated in 2.7](https://github.com/symfony/symfony/pull/12728) and removed in 3.0
I think we forgot to remove this class too.

This class in never used in symfony, and there are no more reference in
the documentation.

Commits
-------

f82e28c533 [HttpFoundation] Deprecated ApacheRequest
2019-07-03 14:15:47 +02:00
smoench
93190182f6
[Filesystem] depreacte calling isAbsolutePath with a null 2019-07-03 13:25:24 +02:00
Alexander Schranz
bedae5dde9 Fix authentication for redis transport 2019-07-03 11:22:31 +02:00
Christian Flothmann
f19f28a41d only decorate when an event dispatcher was passed 2019-07-03 09:52:02 +02:00
Samuel ROZE
7bd0a2720f feature #31825 [Messenger] Added support for auto trimming of redis streams (Toflar)
This PR was squashed before being merged into the 4.4 branch (closes #31825).

Discussion
----------

[Messenger] Added support for auto trimming of redis streams

| 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        | will submit if concept is okay

Right now the Redis stream will just grow indefinitely. However, there are means to have it delete old entries from time to time.
Note: I could not use the `XADD mystream MAXLEN ~ 1000 *` notation because the PHP redis extension does not support the `MAXLEN` option afaics so I went for the extra `XTRIM` command.
I explicitly enabled the approximate flag because it makes absolutely no sense to hardcode the limit for us although we could even have this configurable too (but I don't think we should).
The whole idea of this PR is to enable occasional trimming of the stream so it doesn't grow forever, so when you configure something like `20000` it may well happen that trimming only happens at `25000` depending on your settings.

Ping @soyuka @alexander-schranz @chalasr :)

Commits
-------

7fe06bc5f6 [Messenger] Added support for auto trimming of redis streams
2019-07-02 21:18:22 +01:00
Yanick Witschi
7fe06bc5f6 [Messenger] Added support for auto trimming of redis streams 2019-07-02 21:18:11 +01:00
Javier Eguiluz
fa6ae8ce50 [FrmaeworkBundle] More simplifications in the DI configuration 2019-07-02 17:10:36 +02:00
Tobias Schultze
d97f9ab131 Merge branch '4.3' into 4.4 2019-07-02 16:37:50 +02:00
Tobias Schultze
205cd7a0fb minor #32288 fix invalid call to PhpFileLoader::load() in a test (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

fix invalid call to PhpFileLoader::load() in a test

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yno
| New feature?  | yno <!-- 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        |

This was calling `\Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load($resource, string $type = null)` with the container object as $type which I found in #32286

Commits
-------

8930335934 fix invalid call to PhpFileLoader::load() in a test
2019-07-02 16:37:00 +02:00
Tobias Schultze
2bc88ee744 Merge branch '4.2' into 4.3 2019-07-02 16:28:51 +02:00
Tobias Schultze
44fa22056f Merge branch '3.4' into 4.2 2019-07-02 15:59:44 +02:00
Javier Eguiluz
0d27af93ea [Ldap] Document the new exceptions thrown by the code 2019-07-02 09:12:04 +02:00
Maxime Steinhausser
26048bc498 minor #32046 [FrameworkBundle] Unconditionally register the DateIntervalNormalizer (ogizanagi)
This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Unconditionally register the DateIntervalNormalizer

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

Fwb conflicts with serializer <4.2 37fa45bbd1/src/Symfony/Bundle/FrameworkBundle/composer.json (L74)

so we can remove this obsolete condition from the extension (DateIntervalNormalizer exists since 3.4).

Commits
-------

c7cc780373 [FrameworkBundle] Unconditionally register the DateIntervalNormalizer
2019-07-01 17:04:24 +02:00
Ryan Weaver
c6e18374a2 Fixing validation for messenger transports retry_strategy service key 2019-07-01 10:32:47 -04:00
Alexander M. Turek
58651409b4 Removed unused field. 2019-07-01 14:42:30 +02:00
Amrouche Hamza
c670d5120e
[HttpKernel][DX] Improve the error message when not defining the controller as a service but using contruct parameters 2019-07-01 14:02:11 +02:00
François Pluchino
8544a35e52 Remove @internal annotations for the serilize methods 2019-07-01 10:51:14 +02:00
Grégoire Pineau
f82e28c533 [HttpFoundation] Deprecated ApacheRequest 2019-07-01 10:07:19 +02:00
Jérémy Derussé
c986c86d1c
[Lock] Stores must implement putOffExpiration 2019-07-01 09:24:46 +02:00
Maxime Steinhausser
e113e7f812 [Validator] Add a Length::$allowEmptyString option to reject empty strings
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.
2019-07-01 09:11:48 +02:00
Tobias Schultze
8930335934 fix invalid call to PhpFileLoader::load() in a test 2019-07-01 01:09:42 +02:00
Tobias Schultze
a03b5d8089 fix invalid call to PhpFileLoader::load() in a test 2019-07-01 01:07:21 +02:00
Alex Bowers
6c49a0c758 Add test case 2019-06-30 23:48:04 +01:00
Nicolas Grekas
2d5bcda9e7 [FrameworkBundle] Add autowiring alias for PSR-14 2019-06-30 19:00:07 +02:00
Nicolas Grekas
ad6f6cf900 [Cache] Add argument $prefix to AdapterInterface::clear() 2019-06-30 18:22:11 +02:00
Fabien Potencier
081c601243 minor #32257 [Security] [Guard] Removed useless param annotations (thomasbisignani)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] [Guard] Removed useless param annotations

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

The PR removes useless `@param` annotation, it is linked with the https://github.com/symfony/symfony/pull/32254#issuecomment-506719957

Commits
-------

848e881d5d [Security] [Guard] Removed useless param annotations
2019-06-30 15:25:31 +02:00
Thomas Bisignani
848e881d5d [Security] [Guard] Removed useless param annotations 2019-06-30 11:22:15 +02:00
Alexander M. Turek
28882f52cb Annotated correct return type for getInEdges()/getOutEdges(). 2019-06-29 18:43:59 +02:00
Fabien Potencier
191cb52902 removed @experimental annotations 2019-06-29 18:43:50 +02:00
Christian Flothmann
ba241ce3cc deprecate the framework.templating option 2019-06-29 12:12:19 +02:00
Sebastiaan Stok
6e70d12d3b
[Mime] Added SMimeSigner and Encryptor 2019-06-29 10:53:13 +02:00
Fabien Potencier
ca566a5110 Merge branch '4.3' into 4.4
* 4.3:
  [Workflow] Deprecated DefinitionBuilder::setInitialPlace()
2019-06-29 09:02:53 +02:00
Fabien Potencier
8dd5464c2e feature #32180 [Lock] add an InvalidTTLException to be more accurate (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] add an InvalidTTLException to be more accurate

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- 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.
-->

This adds a new exception to be more precise when using wrong ttl.

Commits
-------

37509192d8 [Lock] add an InvalidTTLException to be more accurate
2019-06-29 08:25:21 +02:00
Christian Flothmann
e217729066 deprecate non-string constraint violation codes 2019-06-28 19:01:10 +02:00
Tobias Schultze
b3e3247557 [FrameworkBundle] better message for disabled sessions 2019-06-28 18:44:52 +02:00
Fabien Potencier
3644b70d42 feature #32241 [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method (jschaedl)
This PR was squashed before being merged into the 4.4 branch (closes #32241).

Discussion
----------

[PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method

| 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<!-- required for new features -->

This PR is related to https://github.com/symfony/symfony/pull/32234#discussion_r298415012

Commits
-------

9aac42698a [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method
2019-06-28 17:46:18 +02:00
Jan Schädlich
9aac42698a [PropertyAccess] Deprecate null as allowed value for defaultLifetime argument in createCache method 2019-06-28 17:46:08 +02:00
Amrouche Hamza
37509192d8
[Lock] add an InvalidTTLException to be more accurate 2019-06-28 17:30:17 +02:00
Grégoire Pineau
4d002e8397 [Workflow] Deprecated DefinitionBuilder::setInitialPlace()
Added missing part of #30468
2019-06-28 17:00:47 +02:00
Thomas Calvet
a751629eb1 [Debug] Fix CHANGELOG after ErrorCatcher renaming 2019-06-28 16:44:50 +02:00
Nicolas Grekas
b40f6b5e72 fix merge 2019-06-28 15:25:44 +02:00
Nicolas Grekas
ab1bc87e43 Merge branch '4.3' into 4.4
* 4.3:
  [HttpFoundation] Throw exception when the \"session\" extension is not loaded
  remove invalid test case
  remove invalid test cases
  [Serializer] Fixed PHP of DenormalizableInterface::denormalize
  [Cache] work aroung PHP memory leak
  [Finder] docblock fixes
  pass error code as a string
  Catch JsonException and rethrow in JsonEncode
2019-06-28 15:17:39 +02:00
Nicolas Grekas
a218efebee Merge branch '4.2' into 4.3
* 4.2:
  [HttpFoundation] Throw exception when the \"session\" extension is not loaded
  remove invalid test cases
  [Serializer] Fixed PHP of DenormalizableInterface::denormalize
  [Cache] work aroung PHP memory leak
  [Finder] docblock fixes
  pass error code as a string
  Catch JsonException and rethrow in JsonEncode
2019-06-28 15:16:30 +02:00
Nicolas Grekas
e62e2ddb38 minor #32250 [Validator] remove invalid test case (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Validator] remove invalid test case

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

Spotted while working on #32179 for the Validator component. Using property paths for comparison when validating arrays simply does not work.

Commits
-------

9000c1eab4 remove invalid test case
2019-06-28 14:57:32 +02:00
Nicolas Grekas
b8c4809a49 Merge branch '3.4' into 4.2
* 3.4:
  [HttpFoundation] Throw exception when the \"session\" extension is not loaded
  remove invalid test cases
  [Serializer] Fixed PHP of DenormalizableInterface::denormalize
  [Finder] docblock fixes
  pass error code as a string
  Catch JsonException and rethrow in JsonEncode
2019-06-28 14:55:49 +02:00
Nicolas Grekas
3f165064eb bug #32236 [Cache] work aroung PHP memory leak (nicolas-grekas)
This PR was merged into the 4.2 branch.

Discussion
----------

[Cache] work aroung PHP memory leak

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

Works around  https://bugs.php.net/76982, as identified by @goetas in the linked issue.

Commits
-------

5d55b91fae [Cache] work aroung PHP memory leak
2019-06-28 14:49:32 +02:00
Nicolas Grekas
b6e8b17dc4 minor #32215 [HttpFoundation] Throw exception when the "session" extension is not loaded (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #32215).

Discussion
----------

[HttpFoundation] Throw exception when the "session" extension is not loaded

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

Should I target `3.4` or `master` instead? This change does not alter behavior, but makes the failure more clear.

Commits
-------

b0c663071b [HttpFoundation] Throw exception when the \"session\" extension is not loaded
2019-06-28 14:47:57 +02:00
Valentin Udaltsov
b0c663071b [HttpFoundation] Throw exception when the \"session\" extension is not loaded 2019-06-28 14:47:50 +02:00
Nicolas Grekas
9bc8b39709 minor #32249 [Validator] remove invalid test cases (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] remove invalid test cases

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

Spotted while working on #32179 for the Validator component. Using property paths for comparison when validating arrays simply does not work.

Commits
-------

d1261e78a4 remove invalid test cases
2019-06-28 14:46:12 +02:00
Nicolas Grekas
3f53044b42 minor #32244 [Validator] pass error code as a string (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] pass error code as a string

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

901fe0d7c5 pass error code as a string
2019-06-28 14:40:38 +02:00
Nicolas Grekas
278bfbaea0 minor #32230 [Serializer] Fixed PHP of DenormalizableInterface::denormalize (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fixed PHP of DenormalizableInterface::denormalize

It can return an array of objects

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

379bbee370 [Serializer] Fixed PHP of DenormalizableInterface::denormalize
2019-06-28 14:36:51 +02:00
Nicolas Grekas
a670098879 minor #32245 [Finder] docblock fixes (smoench)
This PR was merged into the 3.4 branch.

Discussion
----------

[Finder] docblock fixes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This PR provides some docblock fixes found in #32243

Commits
-------

02ee4d0b05 [Finder] docblock fixes
2019-06-28 14:36:03 +02:00
Bastien Jaillot
063e880861 [PropertyInfo] add static cache to ContextFactory
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
2019-06-28 14:35:26 +02:00
Christian Flothmann
61d180e7de Merge branch '4.3' into 4.4
* 4.3:
  fix Debug component dependencies
  [travis] not all components have a master branch
  [HttpKernel] Add @method PHPDoc for getRequest and getResponse back to Client
2019-06-28 14:32:50 +02:00
Christian Flothmann
a1de01c6ff Merge branch '4.2' into 4.3
* 4.2:
  fix Debug component dependencies
  [travis] not all components have a master branch
2019-06-28 14:12:54 +02:00
Christian Flothmann
5edac837a0 Merge branch '3.4' into 4.2
* 3.4:
  fix Debug component dependencies
  [travis] not all components have a master branch
2019-06-28 14:00:38 +02:00
Nicolas Grekas
2bab37d64f bug #32206 Catch JsonException and rethrow in JsonEncode (phil-davis)
This PR was merged into the 3.4 branch.

Discussion
----------

Catch JsonException and rethrow in JsonEncode

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | adjustment to implementation of previous PRs for issue #31447
| License       | MIT
| Doc PR        | not applicable

PR #31860 provided handling of PHP  7.3 `JSON_THROW_ON_ERROR` behavior in the various `JsonEncode` and related classes/methods.

PR #31869 adjusted that. In particular, it adjusted ` src/Symfony/Component/Serializer/Encoder/JsonDecode.php` so that it catches any `JsonException` and re-throws it as `NotEncodableValueException`. That preserves the previous behavior of `JsonDecode:decode` - it always throws `NotEncodableValueException` when something goes wrong.

IMO `JsonEncode:encode` needs the same logic. At the moment, if a caller specifies `JSON_THROW_ON_ERROR` then the method can throw `JsonException`, but actually the "standard" for `JsonEncode:encode` is that it throws `NotEncodableValueException`

Adjust `JsonEncode:encode` to catch `JsonException` and rethrow it as `NotEncodableValueException`

Commits
-------

9c76790ee8 Catch JsonException and rethrow in JsonEncode
2019-06-28 13:57:22 +02:00
Nicolas Grekas
9c668d9282 minor #32213 [HttpKernel] Add @method PHPDoc for getRequest and getResponse back to Client (teohhanhui)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpKernel] Add @method PHPDoc for getRequest and getResponse back to Client

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| 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
| License       | MIT
| Doc PR        | N/A

As the deprecated `Symfony\Component\HttpKernel\Client` does not extend `Symfony\Component\HttpKernel\HttpKernelBrowser`, it has not retained the correct PHPDoc from before.

The order of inheritance was changed in https://github.com/symfony/symfony/pull/31881, but the PHPDoc was never restored.

Commits
-------

332135186a [HttpKernel] Add @method PHPDoc for getRequest and getResponse back to Client
2019-06-28 13:56:05 +02:00
Christian Flothmann
9000c1eab4 remove invalid test case 2019-06-28 12:20:30 +02:00
Christian Flothmann
d1261e78a4 remove invalid test cases 2019-06-28 12:15:37 +02:00
Grégoire Pineau
379bbee370 [Serializer] Fixed PHP of DenormalizableInterface::denormalize
It can return an array of objects
2019-06-28 11:46:25 +02:00
Christian Flothmann
87fe077a89 fix Debug component dependencies 2019-06-28 11:18:39 +02:00
Alexander M. Turek
2a88752cd6 [Routing] Deprecate RouteCollection::addPrefix(null). 2019-06-28 10:23:33 +02:00
Nicolas Grekas
5d55b91fae [Cache] work aroung PHP memory leak 2019-06-28 10:22:31 +02:00
smoench
02ee4d0b05
[Finder] docblock fixes 2019-06-28 10:02:59 +02:00
Nicolas Grekas
548f4fd0ea [HttpClient] Add support for NTLM authentication 2019-06-28 09:49:23 +02:00
Christian Flothmann
901fe0d7c5 pass error code as a string 2019-06-28 09:33:32 +02:00
Tobias Schultze
a609f57c03 [ErrorCatcher] some cleanup and better doc 2019-06-27 22:36:35 +02:00
Fabien Potencier
f511bc5ff6 deprecated FlattenException::create() 2019-06-27 19:51:41 +02:00
Fabien Potencier
7dd9dbf28d [ErrorHandler] made IDEs and static analysis tools happy 2019-06-27 19:50:32 +02:00
Fabien Potencier
b6eac3f861 renamed the ErrorHandler component to ErrorCatcher 2019-06-27 19:38:50 +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
90f61e9efa [Mailer] fixed tests on Windows 2019-06-27 18:29:52 +02:00
Nicolas Grekas
9b69dc651a [PhpUnitBridge] fix tests 2019-06-27 18:09:32 +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
Teoh Han Hui
332135186a
[HttpKernel] Add @method PHPDoc for getRequest and getResponse back to Client 2019-06-27 12:01:44 +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
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
Phil Davis
9c76790ee8 Catch JsonException and rethrow in JsonEncode 2019-06-27 10:07:28 +05:45
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
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
6314d4f9bc updated VERSION for 4.3.2 2019-06-26 16:26:16 +02:00
Fabien Potencier
a84fb88d07 bumped Symfony version to 4.2.11 2019-06-26 16:23:57 +02:00
Fabien Potencier
c8899f3704 updated VERSION for 4.2.10 2019-06-26 16:19:57 +02:00
Fabien Potencier
fe5a4ee999 bumped Symfony version to 3.4.30 2019-06-26 16:17:55 +02:00
Fabien Potencier
5296d2dfa0 updated VERSION for 3.4.29 2019-06-26 15:56:39 +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
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
5797e7b2f2 Revert "Revert "bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)""
This reverts commit 4814fd3a4e.
2019-06-26 14:14:14 +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
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
Nicolas Grekas
5f60bc9536 Merge branch '4.3' into 4.4
* 4.3:
  Bump phpunit-bridge
2019-06-26 12:04:36 +02:00
Nicolas Grekas
ac3ae812d3 Merge branch '4.2' into 4.3
* 4.2:
  Bump phpunit-bridge
2019-06-26 12:04:29 +02:00
Nicolas Grekas
37118bdcd6 Merge branch '3.4' into 4.2
* 3.4:
  Bump phpunit-bridge
2019-06-26 12:03:39 +02:00
Nicolas Grekas
85ac1a6dd5 Bump phpunit-bridge 2019-06-26 12:03:25 +02:00
Nicolas Grekas
19cfc41690 Fix typo 2019-06-26 11:36:48 +02:00
Nicolas Grekas
55c0b02587 Merge branch '4.3' into 4.4
* 4.3: (34 commits)
  [PhpunitBridge] Read environment variable from superglobals
  [Bridge/PhpUnit] Fix PHP5.5 compat
  [PhpUnitBridge] More accurate grouping
  fixed CS
  Extract unrecoverable exception to interface
  [FrameworkBundle] Fix calling Client::getProfile() before sending a request
  Fix type error
  [Security/Core] require libsodium >= 1.0.14
  [Workflow] re-add workflow.definition tag to workflow services
  [Security/Core] Don't use ParagonIE_Sodium_Compat
  revert #30525 due to performance penalty
  collect called listeners information only once
  [Lock] fix missing inherit docs in RedisStore
  [Messenger] fix retrying handlers using DoctrineTransactionMiddleware
  [Mailgun Mailer] fixed issue when using html body
  [HttpClient] fix timing measurements with NativeHttpClient
  [HttpClient] fix dealing with 1xx informational responses
  add test to avoid regressions
  fix mirroring directory into parent directory
  fix typos
  ...
2019-06-26 11:30:56 +02:00
Nicolas Grekas
2dedf38b55 Merge branch '4.2' into 4.3
* 4.2:
  [Lock] fix missing inherit docs in RedisStore
  fix accessing session bags
  Add missing rendering of form help block.
2019-06-26 11:25:00 +02:00
Nicolas Grekas
dd68ae3962 Merge branch '3.4' into 4.2
* 3.4:
  fix accessing session bags
2019-06-26 11:24:49 +02:00
Nicolas Grekas
4e915bd5a2 bug #31954 [PhpunitBridge] Read environment variable from superglobals (greg0ire)
This PR was merged into the 4.3 branch.

Discussion
----------

[PhpunitBridge] Read environment variable from superglobals

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

The Dotenv component has recently been switched to using superglobals
instead of putenv(). Let us support both and give priority to
superglobals.

Commits
-------

88cfcb536d [PhpunitBridge] Read environment variable from superglobals
2019-06-26 11:24:08 +02:00
Grégoire Paris
88cfcb536d [PhpunitBridge] Read environment variable from superglobals
The Dotenv component has recently been switched to using superglobals
instead of putenv(). Let us support both and give priority to
superglobals.

Closes #31857
2019-06-26 11:18:05 +02:00
Fabien Potencier
f8b0bfd332 bug #32131 [Mailgun Mailer] fixed issue when using html body (alOneh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailgun Mailer] fixed issue when using html body

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

I tested the `symfony/mailgun-mailer` and get an issue when using the `api` scheme with a templated email cause we try to manipulate a stream whereas the `Symfony\Component\Mime\Email::getHtmlBody()` could return also a string (in my case it is one).

The issue :

```
stream_get_meta_data() expects parameter 1 to be resource, string given
```

Commits
-------

afbefe131b [Mailgun Mailer] fixed issue when using html body
2019-06-26 10:48:20 +02:00
Nicolas Grekas
0c9b3c08b7 [Bridge/PhpUnit] Fix PHP5.5 compat 2019-06-26 10:33:58 +02:00
Fabien Potencier
64b68d4922 bug #31730 [PhpUnitBridge] More accurate grouping (greg0ire)
This PR was squashed before being merged into the 4.3 branch (closes #31730).

Discussion
----------

[PhpUnitBridge] More accurate grouping

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

Sometimes, you cannot easily know if code was written by a vendor or
directly in the application, for instance if the code comes from a file
in the cache. In that case, it is better not to classify the deprecation
as direct or indirect.

@jmsche please test this on your application when you can, I think you might be having that issue.

Commits
-------

d9f0ba386a [PhpUnitBridge] More accurate grouping
2019-06-26 10:11:14 +02:00
Grégoire Paris
d9f0ba386a [PhpUnitBridge] More accurate grouping 2019-06-26 10:11:05 +02:00
Fabien Potencier
3cd795fdde fixed CS 2019-06-26 09:55:28 +02:00
Fabien Potencier
bd2356d8e5 bug #31966 [Messenger] Doctrine Connection find and findAll now correctly decode headers (TimoBakx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Doctrine Connection find and findAll now correctly decode headers

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

The Doctrine transport `Connection` class methods `find` and `findAll` did not JSON-decode the headers of the envelope after retrieving it from Doctrine. The `get` method, however, did this correctly.

I added two tests to verify the results of `find` and `findAll` and then added the JSON-decoding to the `Connection` class. I moved the JSON-decoding to a separate method to avoid duplicate code.

Commits
-------

3aec2acce5 [Messenger] Doctrine Connection find and findAll now correctly decode headers
2019-06-26 09:44:37 +02:00
Fabien Potencier
6437c5a0fe bug #31972 Add missing rendering of form help block. (alexsegura)
This PR was merged into the 4.2 branch.

Discussion
----------

Add missing rendering of form help block.

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

When using `bootstrap_3_layout.html.twig` form theme, the help blocks are not rendered.

```twig
{% form_theme form 'bootstrap_3_layout.html.twig' %}

{{ form_start(form) }}
  {{ form_row(form.some_field) }} {# <-- no help text is rendered #}
{{ form_end(form) }}
```

Commits
-------

ff5517e554 Add missing rendering of form help block.
2019-06-26 09:37:26 +02:00
Fabien Potencier
bd8ad3f717 feature #32126 [Process] Allow writing portable "prepared" command lines (Simperfit)
This PR was merged into the 4.4 branch.

Discussion
----------

[Process] Allow writing portable "prepared" command lines

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- 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 | #23778  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11802 <!-- required for new features -->

Hey here, it's me, again !

I've talked with @nicolas-grekas and he gave me a new way of writing this feature that will not be a problem for people using things like {{ toto }} since we are using the linux style of using envvar, the replaced arguments is only replaced when using windows.

This should not break anything and work as expected!

see https://github.com/symfony/symfony/pull/24763

This makes `"$FOO"` work seamlessly on Linux and on Windows to reference an env var (that can be provided when calling e.g. the "run" method)

Commits
-------

3f8354f58f [Process] Allow writing portable "prepared" command lines
2019-06-26 09:34:54 +02:00
Fabien Potencier
0219834a2d bug #32141 [HttpClient] fix dealing with 1xx informational responses (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix dealing with 1xx informational responses

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

I never had a look at 1xx status codes until today.
This PR fixes reading them when using curl.

If one wonders:
- `NativeHttpClient` uses `fopen()`, which skips informational parts as allowed by the HTTP spec and doesn't give any way to access their response headers.
- `CurlHttpClient` allows reading informational responses using the progress callback or via the getInfo() method. That's the way if you need to implement e.g. HTTP 103 early hints.

Commits
-------

412411d795 [HttpClient] fix dealing with 1xx informational responses
2019-06-26 09:29:23 +02:00
Fabien Potencier
c245f7c681 bug #32138 [Filesystem] fix mirroring directory into parent directory (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Filesystem] fix mirroring directory into parent directory

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

Commits
-------

b58a806340 fix mirroring directory into parent directory
2019-06-26 09:23:20 +02:00
Fabien Potencier
f15722dd84 minor #32143 use proper return types in ErrorHandler and ArgumentResolver (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

use proper return types in ErrorHandler and ArgumentResolver

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

Found those things while reviewing #31996 which missed some return types due to using `return` instead of `return null`.
It's part of fixing #17201 (due to #10717). See also #30869 that somebody was stumbling over.

Commits
-------

2f9121b74d use proper return types in ErrorHandler and ArgumentResolver
2019-06-26 09:20:55 +02:00
Fabien Potencier
c042b5b6a5 bug #32137 [HttpFoundation] fix accessing session bags (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] fix accessing session bags

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

Commits
-------

7a4570dcac fix accessing session bags
2019-06-26 09:16:02 +02:00
Fabien Potencier
a59082937f bug #32147 [HttpClient] fix timing measurements with NativeHttpClient (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix timing measurements with NativeHttpClient

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

Align to what curl does.

Commits
-------

c5c3332400 [HttpClient] fix timing measurements with NativeHttpClient
2019-06-26 09:10:28 +02:00
Fabien Potencier
6b83861ac3 minor #32161 [Lock] fix missing inherit docs in RedisStore (Simperfit)
This PR was merged into the 4.2 branch.

Discussion
----------

[Lock] fix missing inherit docs in RedisStore

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

This is a missing inheritdoc in the RedisStore for the waitAndSave method.

Commits
-------

71eb8cfe99 [Lock] fix missing inherit docs in RedisStore
2019-06-26 09:07:36 +02:00
Fabien Potencier
e8c68d533d bug #32165 revert #30525 due to performance penalty (bendavies)
This PR was merged into the 4.3 branch.

Discussion
----------

revert #30525 due to performance penalty

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

This reverts #30525, because it introduced a large performance penalty.

Here is the effect of that PR when I upgrade my Api Platform project from 4.2.9 to 4.3.1:
https://blackfire.io/profiles/compare/28bfbc61-3649-4896-bd03-7201239134cd/graph?settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=landscape&settings%5BtabPane%5D=nodes&selected=Symfony%5CComponent%5CVarExporter%5CInternal%5CExporter%3A%3Aexport%403&callname=main()

The reverted PR targeted master. This should go in 4.3?

Commits
-------

3d37cc98f6 revert #30525 due to performance penalty
2019-06-26 09:06:13 +02:00
Fabien Potencier
32fd8e0409 Merge branch '4.2' into 4.3
* 4.2:
  [FrameworkBundle] Fix calling Client::getProfile() before sending a request
  Fix type error
  [Security/Core] Don't use ParagonIE_Sodium_Compat
  collect called listeners information only once
  add test to avoid regressions
  fix typos
  Turkish translation added to Form Component
2019-06-26 08:50:02 +02:00
Fabien Potencier
f0acaff850 Merge branch '3.4' into 4.2
* 3.4:
  [FrameworkBundle] Fix calling Client::getProfile() before sending a request
  Fix type error
  [Security/Core] Don't use ParagonIE_Sodium_Compat
  collect called listeners information only once
  add test to avoid regressions
  fix typos
  Turkish translation added to Form Component
2019-06-26 08:46:55 +02:00
Fabien Potencier
c511e46c73 bug #32164 [EventDispatcher] collect called listeners information only once (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[EventDispatcher] collect called listeners information only once

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

Commits
-------

2ad32df6e0 collect called listeners information only once
2019-06-26 08:45:17 +02:00
Fabien Potencier
7cc4cabd47 bug #32173 [FrameworkBundle] Fix calling Client::getProfile() before sending a request (dunglas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix calling Client::getProfile() before sending a request

| 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

Prevent throwing an error when calling getProfile before a request has been sent.

Commits
-------

9e6f4b2122 [FrameworkBundle] Fix calling Client::getProfile() before sending a request
2019-06-26 08:42:52 +02:00
Fabien Potencier
28b20b8a73 bug #32163 [DoctrineBridge] Fix type error (norkunas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] Fix type error

| 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        | - <!-- required for new features -->

See discussion here: https://github.com/doctrine/DoctrineBundle/pull/984

> Having SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', '')) query and when clicking on explain currently it throws:

> Argument 2 passed to Doctrine\DBAL\Connection::resolveParams() must be of the type array, null given, called in /vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 911

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

7b8ee3ece8 Fix type error
2019-06-26 08:19:19 +02:00
Tobias Schultze
b80ce9ad18 [Form] remove comment about to-be-removed method as it is used in master by ButtonBuilder 2019-06-26 00:51:39 +02:00
Tobias Schultze
6a2f4dc67a Extract unrecoverable exception to interface 2019-06-26 00:15:30 +02:00
Kévin Dunglas
9e6f4b2122
[FrameworkBundle] Fix calling Client::getProfile() before sending a request 2019-06-25 17:43:39 +02:00
Tomas
7b8ee3ece8 Fix type error 2019-06-25 17:06:32 +03:00
Fabien Potencier
b68a6b3e16 bug #32154 [Messenger] fix retrying handlers using DoctrineTransactionMiddleware (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix retrying handlers using DoctrineTransactionMiddleware

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

The retry logic only executes handlers that didn't fail using the HandledStamp. But in case of using the DoctrineTransactionMiddleware using several handlers, we need to remove the HandledStamp because those handlers got rolled back again.

Commits
-------

66c2e8483a [Messenger] fix retrying handlers using DoctrineTransactionMiddleware
2019-06-25 15:53:13 +02:00
Fabien Potencier
4e6951b1d3 bug #32169 [Security/Core] require libsodium >= 1.0.14 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Core] require libsodium >= 1.0.14

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

- bump libsodium to >=1.0.14
- Minimum opscost must be 3, as described in https://wiki.php.net/rfc/libsodium and in https://github.com/jedisct1/libsodium/releases/tag/1.0.15
- ParagonIE_Sodium_Compat [explicitly doesn't implement Argon2](https://github.com/paragonie/sodium_compat#features-excluded-from-this-polyfill), so it makes no sense to check for it.

Commits
-------

4fed5d3813 [Security/Core] require libsodium >= 1.0.14
2019-06-25 15:28:12 +02:00
Nicolas Grekas
4fed5d3813 [Security/Core] require libsodium >= 1.0.14 2019-06-25 15:09:11 +02:00
Fabien Potencier
9830c64db0 bug #32156 [Workflow] re-add workflow.definition tag to workflow services (nikossvnk)
This PR was squashed before being merged into the 4.3 branch (closes #32156).

Discussion
----------

[Workflow] re-add workflow.definition tag to workflow services

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

Add again the `workflow.definition` tag in workflow services.

Commits
-------

4df2dc5aaa [Workflow] re-add workflow.definition tag to workflow services
2019-06-25 14:31:05 +02:00
nikos.sotiropoulos
4df2dc5aaa [Workflow] re-add workflow.definition tag to workflow services 2019-06-25 14:30:50 +02:00
Nicolas Grekas
61ea53d57f [Security/Core] Don't use ParagonIE_Sodium_Compat 2019-06-25 14:22:47 +02:00
Ben Davies
3d37cc98f6 revert #30525 due to performance penalty 2019-06-25 10:08:34 +01:00
Christian Flothmann
2ad32df6e0 collect called listeners information only once 2019-06-25 09:45:31 +02:00
Amrouche Hamza
71eb8cfe99
[Lock] fix missing inherit docs in RedisStore 2019-06-25 07:47:15 +02:00
Robin Chalas
efaa154c74 minor #32146 [Security] add return type declaration (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] add return type declaration

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

Commits
-------

9fe532d657 add return type declaration
2019-06-25 03:46:17 +02:00
Tobias Schultze
8124159052 minor #32078 [Messenger] make all stamps final and mark stamp not meant to be sent (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] make all stamps final and mark stamp not meant to be sent

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| 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 |
| License       | MIT
| Doc PR        |

Some newer stamps were already final. This makes all of them final. Also marks all stamps that are not meant to be sent using the new `NonSendableStampInterface`. This makes it easier to see which stamps are actually important and required to persist in a queue for certain functionality, like the `BusNameStamp` for the `RoutableMessageBus`

Commits
-------

013904b081 [Messenger] make all stamps final and mark stamp not meant to be sent
2019-06-24 23:33:22 +01:00
Tobias Schultze
67af93f3b0 bug #32053 [Messenger] No need for retry to require SentStamp (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] No need for retry to require SentStamp

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

Fixes 2) in #32049
@weaverryan the SentStamp in the worker seems totally irrelevant. You always want to send messages back to the transport where they came from for retry. The only relevance I can potentially see is for the SyncTransport. Messages received async from worker might be routed to the SyncTransport. Using the SentStamp would redeliver the messages into the SyncTransport instead of the async. But that doesn't seem to have any use-case. I'm running the worker which handles the messages immediately. So basically there is no difference if they go to the Sync or Async transport from within the worker.

Commits
-------

0034dee641 [Messenger] make retry logic work without SentStamp
2019-06-24 23:32:13 +01:00
Tobias Schultze
66c2e8483a [Messenger] fix retrying handlers using DoctrineTransactionMiddleware 2019-06-24 15:34:54 +01:00
Hippolyte Alain
afbefe131b [Mailgun Mailer] fixed issue when using html body 2019-06-24 16:09:08 +02:00
Tobias Schultze
013904b081 [Messenger] make all stamps final and mark stamp not meant to be sent 2019-06-24 14:58:45 +01:00
Nicolas Grekas
c5c3332400 [HttpClient] fix timing measurements with NativeHttpClient 2019-06-24 10:59:29 +02:00
Christian Flothmann
9fe532d657 add return type declaration 2019-06-24 10:10:57 +02:00
Tobias Schultze
2f9121b74d use proper return types in ErrorHandler and ArgumentResolver 2019-06-24 02:04:42 +01:00
Amrouche Hamza
3f8354f58f
[Process] Allow writing portable "prepared" command lines 2019-06-23 21:19:36 +02:00
Nicolas Grekas
412411d795 [HttpClient] fix dealing with 1xx informational responses 2019-06-23 19:42:15 +02:00
Nicolas Grekas
698601140b minor #31993 [Mailer] Catch missing scheme in DSN (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Catch missing scheme in DSN

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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 `Symfony\Component\Mailer\Transport::createTransport()` method parses and validates a passed DSN. I noticed that we never check if the DSN contains a valid scheme, but we always assume that the scheme is present in then parse result. If someone passes a DSN without a scheme to that method, they would almost certainly run into a PHP notice.

This PR makes sure that a scheme is present in the URL and throws a proper exception otherwise.

Commits
-------

3eba36c088 [Mailer] Catch missing scheme in DSN.
2019-06-23 17:43:40 +02:00
Nicolas Grekas
b56591c92d bug #32083 [HttpClient] fixing passing debug info to progress callback (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fixing passing debug info to progress callback

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

NativeHttpClient already has it.

Commits
-------

dc55cf826a [HttpClient] fixing passing debug info to progress callback
2019-06-23 17:19:50 +02:00
Nicolas Grekas
57d73fcac3 minor #32140 [Filesystem] add test to avoid regressions (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Filesystem] add test to avoid regressions

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

0d7d1f81bc add test to avoid regressions
2019-06-23 17:08:29 +02:00
Nicolas Grekas
6d02c89c21 bug #32129 [DebugBundle] fix register ReflectionCaster::unsetClosureFileInfo caster in var cloner service (alekitto)
This PR was merged into the 4.3 branch.

Discussion
----------

[DebugBundle] fix register ReflectionCaster::unsetClosureFileInfo caster in var cloner service

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

Non-existent class was checked by `method_exists` in Debug bundle.
This should fix (and correctly register) the caster while loading `DebugExtension` from `DebugBundle`

Commits
-------

860164ee7e [DebugBundle] fix register ReflectionCaster::unsetClosureFileInfo caster in var cloner service
2019-06-23 16:55:14 +02:00
Christian Flothmann
0d7d1f81bc add test to avoid regressions 2019-06-23 11:29:17 +02:00
Gabriel Ostrolucký
83edac321e [Console] Add ProgressBar::preventRedrawFasterThan() and forceRedrawSlowerThan() methods 2019-06-23 11:16:35 +02:00