Commit Graph

36528 Commits

Author SHA1 Message Date
Fabien Potencier dcbfd00b02 Merge branch '3.4' into 4.0
* 3.4:
  fixed Silex project's URL
2018-04-20 08:21:32 +02:00
Fabien Potencier d0928fc14f Merge branch '2.8' into 3.4
* 2.8:
  fixed Silex project's URL
2018-04-20 08:21:16 +02:00
Fabien Potencier d05f0a0e03 fixed Silex project's URL 2018-04-20 08:21:07 +02:00
Fabien Potencier bb45c75d7b Merge branch '3.4' into 4.0
* 3.4:
  fixed deprecations in tests
  fixed Twig URL
  [Cache] Add missing `@internal` tag on ProxyTrait
  fix formatting arguments in plaintext format
  Fix PSR exception context key
  Don't assume that file binary exists on *nix OS
  Fix that ESI/SSI processing can turn a \"private\" response \"public\"
  [Form] Fixed trimming choice values
  fix rendering exception stack traces
  [Routing] Fix loading multiple class annotations for invokable classes
2018-04-20 08:20:23 +02:00
Fabien Potencier f180bfe2a2 fixed deprecations in tests 2018-04-20 08:20:06 +02:00
Fabien Potencier 437acb4357 Merge branch '2.8' into 3.4
* 2.8:
  fixed Twig URL
  Don't assume that file binary exists on *nix OS
  Fix that ESI/SSI processing can turn a \"private\" response \"public\"
  [Form] Fixed trimming choice values
2018-04-20 08:18:40 +02:00
Fabien Potencier e8e7ff2d7b Merge branch '2.7' into 2.8
* 2.7:
  fixed Twig URL
  Don't assume that file binary exists on *nix OS
  Fix that ESI/SSI processing can turn a \"private\" response \"public\"
  [Form] Fixed trimming choice values
2018-04-20 08:15:58 +02:00
Fabien Potencier f981f7aae8 fixed Twig URL 2018-04-20 08:14:58 +02:00
Fabien Potencier 306c5992ec feature #26768 [DI] Allow autoconfigured calls in PHP (Gary PEGEOT, GaryPEGEOT)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[DI] Allow autoconfigured calls in PHP

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

Allow to auto-configured method calls like:
```php
$container->registerForAutoconfiguration(LoggerAwareInterface::class)->addMethodCall('setLogger', array(new Reference(LoggerInterface::class)));
```

Commits
-------

1d811cb3f7 Add test for both _intanceof and manual method setting.
71bf3ced74 CS fix
15c45ee40a Add more test-cases
2612f81052 Allow autoconfigured calls in PHP.
2018-04-20 06:42:42 +02:00
Fabien Potencier 1b1bbd43a3 feature #26833 [HttpKernel] Added support for timings in ArgumentValueResolvers (iltar)
This PR was squashed before being merged into the 4.1-dev branch (closes #26833).

Discussion
----------

[HttpKernel] Added support for timings in ArgumentValueResolvers

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

This feature provides timings for the supports and resolve methods for each individual argument value resolver. It was already possible to see the `controller.get_arguments` timing, but it was impossible to track a possible performance issue any further without using different tools. I've explicitly added the `supports` method as well, as it might otherwise hide performance issues. The `ServiceValueResolver` for example, does a `container::has`, which in turn might trigger a factory method, which might trigger a query for example.

~~Due to the feature freeze I've already added this to 4.2. If for some reason it's okay to still merge it into 4.1, I can update the upgrade files.~~ - Changed to 4.1

##### *Without performance issue*
![image](https://user-images.githubusercontent.com/1754678/38416250-6cf45528-3994-11e8-91d4-2472c97c6c50.png)

##### *With performance issue*
![image](https://user-images.githubusercontent.com/1754678/38416266-7966eb7c-3994-11e8-9dc5-a99daa8f9a69.png)

Commits
-------

1c0d8928aa [HttpKernel] Added support for timings in ArgumentValueResolvers
2018-04-20 06:27:48 +02:00
Iltar van der Berg 1c0d8928aa [HttpKernel] Added support for timings in ArgumentValueResolvers 2018-04-20 06:27:42 +02:00
Fabien Potencier 028e1e57f0 minor #26821 declare type for arguments of anonymous functions for v2.7 (DQNEO)
This PR was submitted for the 2.7 branch but it was squashed and merged into the 4.1-dev branch instead (closes #26821).

Discussion
----------

declare type for arguments of anonymous functions for v2.7

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

Declare type for array_map

Commits
-------

74ab256bec declare type for arguments of anonymous functions for v2.7
2018-04-20 06:21:03 +02:00
DQNEO 74ab256bec declare type for arguments of anonymous functions for v2.7 2018-04-20 06:20:29 +02:00
Fabien Potencier 3d40bfa1c4 bug #26877 Add working orphaned events template (kejwmen)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Add working orphaned events template

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

Current template is broken, this PR introduces a simple working template to fix profiler.

Commits
-------

089817b9b1 Add working orphaned events template
2018-04-20 06:10:43 +02:00
Fabien Potencier 3450e47e78 feature #26770 Do not normalize array keys in twig globals (lstrojny)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Do not normalize array keys in twig globals

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | rather no
| Tests pass?   | yes
| Fixed tickets | n.A.
| License       | MIT
| Doc PR        | n.A.

We should leave array keys in twig globals untouched.

Commits
-------

8c1672743d Don’t normalize global values
2018-04-20 05:42:27 +02:00
Lars Strojny 8c1672743d Don’t normalize global values 2018-04-19 22:19:20 +02:00
Fabien Potencier 3f71d88915 minor #26982 [Cache] Add missing `@internal` tag on ProxyTrait (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Add missing `@internal` tag on ProxyTrait

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

All traits in Cache are internal. We just forgot the annotation on this one.

Commits
-------

3d7c7cf39a [Cache] Add missing `@internal` tag on ProxyTrait
2018-04-19 14:17:05 +02:00
Nicolas Grekas 3d7c7cf39a [Cache] Add missing `@internal` tag on ProxyTrait 2018-04-19 13:01:15 +02:00
Fabien Potencier e98454664a bug #26980 [TwigBundle] fix formatting arguments in plaintext format (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] fix formatting arguments in plaintext format

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

f1c1d36fda fix formatting arguments in plaintext format
2018-04-19 11:13:32 +02:00
Christian Flothmann f1c1d36fda fix formatting arguments in plaintext format 2018-04-19 10:26:28 +02:00
Fabien Potencier 8c4fd1299b feature #26787 [Security] Make security.providers optional (MatTheCat)
This PR was squashed before being merged into the 4.1-dev branch (closes #26787).

Discussion
----------

[Security] Make security.providers optional

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

Don't really know if it's viable but I just hit #21998 so I would like to tackle this.

Commits
-------

ee54bfa646 [Security] Make security.providers optional
2018-04-19 08:45:32 +02:00
Mathieu Lechat ee54bfa646 [Security] Make security.providers optional 2018-04-19 08:45:26 +02:00
Fabien Potencier a59d0f615c feature #26970 [VarDumper] Add dd() helper == dump() + exit() (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[VarDumper] Add dd() helper == dump() + exit()

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

By popular demand, I feel like we should reconsider our refusal for a `dd()` global helper.
For past references, see #26965, #26906, #13657, #17267, #19096.

Commits
-------

a55916a895 [VarDumper] Add dd() helper == dump() + die()
2018-04-19 07:17:41 +02:00
Nicolas Grekas a55916a895 [VarDumper] Add dd() helper == dump() + die() 2018-04-18 16:09:39 +02:00
Samuel ROZE 4429c9b20f bug #26956 [Messenger][AmqpExt] Allow disabling the auto-setup of the connection (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26956).

Discussion
----------

[Messenger][AmqpExt] Allow disabling the auto-setup of the connection

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

Allow disabling the auto-setup of the AMQP connection. Especially useful when the messages are published to another system (see #26937)

Commits
-------

b3039faa1a [Messenger][AmqpExt] Allow disabling the auto-setup of the connection
2018-04-17 17:51:29 +01:00
Samuel ROZE b3039faa1a [Messenger][AmqpExt] Allow disabling the auto-setup of the connection 2018-04-17 17:51:20 +01:00
Samuel ROZE fe199317da feature #26941 [Messenger] Allow to configure the transport (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26941).

Discussion
----------

[Messenger] Allow to configure the transport

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | ish
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26900, #26908, #26935
| License       | MIT
| Doc PR        | ø

We allow users to configure the encoder/decoder used by the built-in adapter(s). This also adds the support of configuring the default's encoder/decoder format and context.

Commits
-------

1a3f0bbb14 [Messenger] Allow to configure the transport
2018-04-17 17:47:47 +01:00
Samuel ROZE 1a3f0bbb14 [Messenger] Allow to configure the transport 2018-04-17 17:47:06 +01:00
Samuel ROZE 4af9003bd6 bug #26960 [Messenger] Allow sender tag name omission (soyuka)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Allow sender tag name omission

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

Tag attributes are not mandatory.

Commits
-------

a4737915c8 [Messenger] Allow sender tag name omission
2018-04-17 14:08:29 +01:00
abluchet a4737915c8 [Messenger] Allow sender tag name omission 2018-04-17 14:59:00 +02:00
Fabien Potencier b0410d457e bug #26886 Don't assume that file binary exists on *nix OS (teohhanhui)
This PR was merged into the 2.7 branch.

Discussion
----------

Don't assume that file binary exists on *nix OS

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

Certain lightweight distributions such as Alpine Linux (popular for smaller Docker images) do not include it by default.

Commits
-------

e2c1f24fbd Don't assume that file binary exists on *nix OS
2018-04-17 12:07:04 +02:00
Fabien Potencier 2a529633f5 bug #26959 [Console] Fix PSR exception context key (scaytrase)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix PSR exception context key

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

Fixes context key according to PSR-3
cc. @xabbuh

Commits
-------

a28393e482 Fix PSR exception context key
2018-04-17 12:05:38 +02:00
Pavel.Batanov a28393e482
Fix PSR exception context key 2018-04-17 12:32:18 +03:00
Teoh Han Hui e2c1f24fbd Don't assume that file binary exists on *nix OS
Certain lightweight distributions such as Alpine Linux (popular for smaller Docker images) do not include it by default.
2018-04-17 11:15:40 +02:00
Fabien Potencier 8f2132fce3 bug #26899 [Routing] Fix loading multiple class annotations for invokable classes (1ed)
This PR was merged into the 3.4 branch.

Discussion
----------

[Routing] Fix loading multiple class annotations for invokable classes

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

The support for full route definition for invokable controllers as class annotation was introduced by
https://github.com/symfony/symfony/pull/2172, but that works with one route only, which is inconsistent with how `@Route` works at other places. This PR adds support for multiple class annotations for invokable controllers and fixes the inconsistency.

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

2a9c668ad7 [Routing] Fix loading multiple class annotations for invokable classes
2018-04-17 09:10:52 +02:00
Samuel ROZE 507989db87 bug #26947 [Messenger] Support nested configuration on adapters (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Support nested configuration on adapters

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

The configuration of options did not support "in-depth" configuration. This adds it.

Commits
-------

177cea0ee1 Support nested configuration on adapters
2018-04-16 23:30:47 +01:00
Fabien Potencier d17d38d291 bug #26643 Fix that ESI/SSI processing can turn a "private" response "public" (mpdude)
This PR was squashed before being merged into the 2.7 branch (closes #26643).

Discussion
----------

Fix that ESI/SSI processing can turn a "private" response "public"

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

Under the condition that
* we are merging in at least one *embedded* response,
* all *embedded* responses are `public`,
* the *main* response is `private` and
* all responses use expiration-based caching (note: no `s-maxage` on the *main* response)

... the resulting response will turn to `Cache-Control: public`.

The real issue is that when all responses use expiration-based caching, a combined max age is computed. This is set on the *main* response using `Response::setSharedMaxAge()`, which implicitly sets `Cache-Control: public`.

The fix provided in this PR solves the problem by applying the same logic to the *main* response that is applied for *embedded* responses, namely that responses with `!Response::isCacheable()` will make the resulting response have `Cache-Control: private, no-cache, must-revalidate` and have `(s)max-age` removed.

This makes the change easy to understand, but makes responses uncacheable too often. This is because the `Response::isCacheable()` method was written to determine whether it is safe for a shared cache to keep the response, which is not the case as soon as a `private` response is involved. This might be improved upon in another PR.

Commits
-------

3d27b5946d Fix that ESI/SSI processing can turn a \"private\" response \"public\"
2018-04-16 19:47:59 +02:00
Matthias Pigulla 3d27b5946d Fix that ESI/SSI processing can turn a \"private\" response \"public\" 2018-04-16 19:47:52 +02:00
Samuel ROZE 177cea0ee1 Support nested configuration on adapters 2018-04-16 18:40:17 +01:00
Fabien Potencier d2f8df8054 bug #26895 [Config] Fixes the valid placeholder types for variable node (romain-pierre)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Config] Fixes the valid placeholder types for variable node

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

This is a proposition, still in discussion.
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

9fbdcdbeb9 Fixes the valid placeholder types for variable node
2018-04-16 19:38:06 +02:00
Fabien Potencier 7e4de96c03 minor #26909 [Messenger][DX] Uses the adapter name instead of the service name (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26909).

Discussion
----------

[Messenger][DX] Uses the adapter name instead of the service name

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

As a developer, I don't get why I would need to use the service name while I give a name to the adapters. This is basically what this PR means for me in terms of configuration:
```patch
framework:
    messenger:
        routing:
            # We want the command below to be handled async with the "messenger.default_sender" (AMQP producer).
-            'App\Message\Command\CreateNumber': messenger.sender.amqp
+            'App\Message\Command\CreateNumber': amqp

        adapters:
            amqp: "%env(AMQP_DSN)%"
```

And in terms of pulling the messages:
```patch
- bin/console messenger:consume-messages messenger.receiver.amqp
+ bin/console messenger:consume-messages amqp
```

Commits
-------

b5afb40441 [Messenger][DX] Uses the adapter name instead of the service name
2018-04-16 19:19:59 +02:00
Samuel ROZE b5afb40441 [Messenger][DX] Uses the adapter name instead of the service name 2018-04-16 19:19:48 +02:00
Fabien Potencier a3af3d3ec2 bug #26932 [Form] Fixed trimming choice values (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed trimming choice values

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24247, #24712
| License       | MIT
| Doc PR        | symfony/symfony-docs#9598

Follows #24712 discussion.

Commits
-------

00cdf5e0a5 [Form] Fixed trimming choice values
2018-04-16 19:16:07 +02:00
Fabien Potencier baeb1bf671 bug #26922 [TwigBundle] fix rendering exception stack traces (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] fix rendering exception stack traces

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

99302e72fc fix rendering exception stack traces
2018-04-16 16:11:39 +02:00
Romain Pierre 9fbdcdbeb9 Fixes the valid placeholder types for variable node 2018-04-16 10:25:21 +02:00
Samuel ROZE c442929737 minor #26912 [Messenger] Testing LoggingMiddleware and minor improvements (yceruto)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Testing LoggingMiddleware and minor improvements

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

- This add tests for `LoggingMiddleware` class
- Similar to [`translator.logging`](6bbb5bcc52/src/Symfony/Component/Translation/LoggingTranslator.php (L33)) a logging service doesn't make sense without a [hard `logger` dependency](6bbb5bcc52/src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml (L25-L29)) and according to:
6bbb5bcc52/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php (L52-L54)

   it must be removed if `logger` alias doesn't exists.

Commits
-------

eedad4c061 Make logger arg a hard dependency, remove dead code and add tests
2018-04-15 22:28:31 +01:00
HeahDude 00cdf5e0a5 [Form] Fixed trimming choice values 2018-04-15 21:28:23 +02:00
Nicolas Grekas ccb0e84799 [Form] tweak CHANGELOG 2018-04-15 08:55:41 -05:00
Yonel Ceruto eedad4c061 Make logger arg a hard dependency, remove dead code and add tests 2018-04-14 13:36:02 -04:00
Nicolas Grekas 782ffe2fd2 Merge branch '4.0'
* 4.0:
  [HttpKernel] Make ServiceValueResolver work if controller namespace starts with a backslash in routing
  Add d-block to bootstrap 4 alerts
  [Console] Don't go past exact matches when autocompleting
  [DI] Improve error message for non-autowirable scalar argument
  Disable autoloader call on interface_exists check
  [Validator] Fix LazyLoadingMetadataFactory with PSR6Cache for non classname if tested values isn't an existing class
  [HttpKernel] Dont create mock cookie for new sessions in tests
2018-04-14 11:36:26 -05:00