Commit Graph

33084 Commits

Author SHA1 Message Date
Yonel Ceruto
c4f64a6260 Update UPGRADE-4.0.md 2017-10-19 15:31:27 -04:00
Fabien Potencier
d43daa0295 bug #24630 [WebServerBundle] Prevent commands from being registered by convention (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebServerBundle] Prevent commands from being registered by convention

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

Commits
-------

57b7d832d9 [WebServerBundle] Prevent commands from being registered by convention
2017-10-19 11:47:54 -07:00
Robin Chalas
57b7d832d9 [WebServerBundle] Prevent commands from being registered by convention 2017-10-19 19:45:43 +02:00
Fabien Potencier
d484f7282a bumped Symfony version to 3.4.0 2017-10-18 15:39:44 -07:00
Fabien Potencier
44e3c8bfcf Merge pull request #24609 from fabpot/release-3.4.0-BETA1
released v3.4.0-BETA1
2017-10-18 14:46:31 -07:00
Fabien Potencier
c000b454c8 updated VERSION for 3.4.0-BETA1 2017-10-18 14:45:50 -07:00
Fabien Potencier
a024e80f1c updated CHANGELOG for 3.4.0-BETA1 2017-10-18 14:45:28 -07:00
Fabien Potencier
fa1887dfc0 feature #24583 Adding a new debug:autowiring command (weaverryan)
This PR was merged into the 3.4 branch.

Discussion
----------

Adding a new debug:autowiring command

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (if I can make my case, otherwise 4.1)
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21222 and #24562 partially
| License       | MIT
| Doc PR        | TODO

Very simply, this adds a proper `debug:autowiring`, which is much shorter / nicer than `debug:container --types` and much prettier.

Before (`debug:container --types`):

<img width="1280" alt="screen shot 2017-10-16 at 8 28 05 pm" src="https://user-images.githubusercontent.com/121003/31641112-931c84ca-b2b0-11e7-9432-136ecf47ed0f.png">
<img width="1280" alt="screen shot 2017-10-16 at 8 28 18 pm" src="https://user-images.githubusercontent.com/121003/31641113-932ac1fc-b2b0-11e7-8a65-34199c9933c1.png">

After (`debug:autowiring`)

<img width="1131" alt="screen shot 2017-10-16 at 7 58 06 pm" src="https://user-images.githubusercontent.com/121003/31641124-a3288a6c-b2b0-11e7-8255-a8e676a26aba.png">
<img width="1101" alt="screen shot 2017-10-16 at 7 58 16 pm" src="https://user-images.githubusercontent.com/121003/31641125-a334c354-b2b0-11e7-8ee3-3bbad5678a1a.png">

The command is purposely simple: no special powers, no magic (other than a `search` argument), just a clean list and nice output.

I would love to sneak this in for 3.4, but I understand either way.

Commits
-------

41df512349 Adding a new debug:autowiring command
2017-10-18 08:28:19 -07:00
Fabien Potencier
0ff4480e28 bug #24600 [HttpKernel] Don't bind scalar values to controller method arguments (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Don't bind scalar values to controller method arguments

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

See linked issue.

Let's suppose we have this configuration:
```yaml
services:
    _defaults:
        # ...
        bind:
            $foo: '%foobar%'
```
`$foo` was successfully bound to any controller constructor, but in another controller I have this edit action (nothing to do with the intention of bind such a parameter, but it has the same name):
```php
/**
 * @Route("/{foo}/edit")
 */
public function editAction(string $foo) {}
```
triggering:
> Type error: Argument 1 passed to Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument::__construct() must be an instance of Symfony\Component\DependencyInjection\Reference, string given, called in /home/yceruto/github/symfony/symfony-demo/vendor/symfony/dependency-injection/Compiler/ServiceLocatorTagPass.php on line 81

or after https://github.com/symfony/symfony/pull/24582:
> Invalid service locator definition: only services can be referenced, "string" found for key "foo". Inject parameter values using constructors instead.

Commits
-------

a1df9af20f don't bind scalar values to controller method arguments
2017-10-18 07:28:24 -07:00
Fabien Potencier
79caee2e08 bug #24602 [DI] Do not process bindings in AbstractRecursivePass (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Do not process bindings in AbstractRecursivePass

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

Commits
-------

6a6256c6a8 Do not process bindings in AbstractRecursivePass
2017-10-18 07:16:04 -07:00
Robin Chalas
6a6256c6a8 Do not process bindings in AbstractRecursivePass 2017-10-18 14:27:18 +02:00
Yonel Ceruto
a1df9af20f don't bind scalar values to controller method arguments 2017-10-18 01:50:07 -04:00
Fabien Potencier
1a8459a8f1 minor #24591 adding AdapterInterface alias for cache.app (weaverryan)
This PR was merged into the 3.4 branch.

Discussion
----------

adding AdapterInterface alias for cache.app

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

I'd like to add this alias for autowiring. If only `CacheItemPoolInterface` is available, then it's a bit weird to use the extra Symfony cache features (e.g. tagging), as I'm calling methods on the `CacheItemPoolInterface` that don't exist. I'd rather type-hint `AdapterInterface` and confidently call those (+ get auto-complete).

Commits
-------

454f65a77d adding AdapterInterface alias for cache.app
2017-10-17 08:47:21 -07:00
Fabien Potencier
84f19c0537 minor #24592 Add extra autowiring aliases (stof)
This PR was merged into the 3.4 branch.

Discussion
----------

Add extra autowiring aliases

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

This adds autowiring for RequestContextAwareInterface for the routing layer and for AuthenticationManagerInterface in the security layer.

Commits
-------

921a8794c6 Add extra autowiring aliases
2017-10-17 08:44:52 -07:00
Christophe Coevoet
921a8794c6 Add extra autowiring aliases
This adds autowiring for RequestContextAwareInterface for the routing layer
and for AuthenticationManagerInterface in the security layer.
2017-10-17 16:03:36 +02:00
Ryan Weaver
454f65a77d adding AdapterInterface alias for cache.app 2017-10-17 00:33:38 -04:00
Ryan Weaver
41df512349 Adding a new debug:autowiring command 2017-10-16 20:35:11 -04:00
Fabien Potencier
1f4025a0ae feature #24523 [HttpFoundation] Make sessions secure and lazy (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Make sessions secure and lazy

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | not yet
| Fixed tickets | #6388, #6036, #12375, #12325
| License       | MIT
| Doc PR        | -

The `SessionUpdateTimestampHandlerInterface` (new to PHP 7.0) is mostly undocumented, and just not implemented anywhere. Yet, it's required to implement session fixation preventions and lazy write in userland session handlers (there is https://wiki.php.net/rfc/session-read_only-lazy_write which describes the behavior.)

By implementing it, we would make Symfony session handling much better and stronger. Meanwhile, doing some cookie headers management, this also gives the opportunity to fix the "don't start if session is only read issue".

So, here we are for the general idea. Now needs more (and green) tests, and review of course.

Commits
-------

347939c9b3 [HttpFoundation] Make sessions secure and lazy
2017-10-16 15:59:43 -07:00
Nicolas Grekas
347939c9b3 [HttpFoundation] Make sessions secure and lazy 2017-10-17 00:24:46 +02:00
Fabien Potencier
f757cd65e2 minor #24556 [Routing] Ensure uniqueness without repeated check (endroid)
This PR was squashed before being merged into the 3.4 branch (closes #24556).

Discussion
----------

[Routing] Ensure uniqueness without repeated check

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

The RouteCollection ensures uniqueness of resources by using array_unique. The current implementation suffers from the following problems.

1. The array_unique method calls __toString for every element in the array but it is very inefficient in terms of the number of calls made. I.e. if the array has 50 elements it does not do 50 __toString calls. I did some tests with Blackfire in PHP 7.1 and found the following numbers.

25 elements => 240 calls
50 elements => 607 calls
100 elements => 1382 calls
200 elements => 3333 calls

2. The array_unique function is called every time the getResources() method is called, even when the resources did not change in the mean time. Combined with the above this leads to lower performance.

Many applications have a low number of routes so this is not a big issue. But for larger applications or bundles that generate routes (i.e. for CRUD or API / doc generation) this will have a bigger impact.

Commits
-------

16f7281178 [Routing] Ensure uniqueness without repeated check
2017-10-16 13:33:36 -07:00
endroid
16f7281178 [Routing] Ensure uniqueness without repeated check 2017-10-16 13:33:34 -07:00
Robin Chalas
4a687759d5 minor #24527 [Console] Sync ConsoleLogger::interpolate with the one in HttpKernel (dunglas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Sync ConsoleLogger::interpolate with the one in HttpKernel

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Adapted from: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Log/Logger.php#L92

Better performance and datetime support (maybe should it be merged in a newer version, but I've targeted 2.7 to prevent future merge conflicts).

Commits
-------

8fcbc55 [Console] Sync ConsoleLogger::interpolate with the one in HttpKernel
2017-10-15 16:02:31 +02:00
Kévin Dunglas
8fcbc5572b
[Console] Sync ConsoleLogger::interpolate with the one in HttpKernel 2017-10-15 14:36:44 +02:00
Nicolas Grekas
42390a2b00 Merge branch '3.3' into 3.4
* 3.3:
  Fix phpunit bridge (ter)
2017-10-13 18:56:07 +02:00
Nicolas Grekas
a522f5e855 Fix phpunit bridge (ter) 2017-10-13 18:55:35 +02:00
Nicolas Grekas
0454396746 Merge branch '3.3' into 3.4
* 3.3:
  Fix phpunit bridge (bis)
2017-10-13 18:49:51 +02:00
Nicolas Grekas
9de153b330 Fix phpunit bridge (bis) 2017-10-13 18:49:40 +02:00
Nicolas Grekas
ed5f884ec6 Merge branch '3.3' into 3.4
* 3.3:
  Fix phpunit bridge
2017-10-13 18:40:10 +02:00
Nicolas Grekas
7ba7550dfb Fix phpunit bridge 2017-10-13 18:39:56 +02:00
Fabien Potencier
a6aa9ecff6 feature #22610 [Form] [TwigBridge] Added option to disable usage of default themes when rendering a form (emodric)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] [TwigBridge] Added option to disable usage of default themes when rendering a form

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

This adds a possibility to use `only` keyword in `form_theme` tag to disable usage of globally defined form themes, e.g.

`{% form_theme form with ['common.html.twig', 'form/fields.html.twig'] only %}`

Otherwise, in order to completely control the rendering of the forms (for example in custom admin interfaces), one would need to use a form theme which has all the possible twig blocks defined to prevent globally defined themes to interfere with the rendering.

`only` keyword is already used when including a Twig template to transfer only the variables which are explicitly defined in the `include` tag, so it seemed natural to use it here too.

This, of course, means that the user will need to manually `use` all of the templates that are required to render the form, including `form_div_layout.html.twig`

This issue is described in details over at Symfony Demo repo: https://github.com/symfony/symfony-demo/issues/515

TODO:

- [x] submit changes to the documentation

Commits
-------

e0681f9955 [Form] [TwigBridge] Added option to disable usage of default themes when rendering a form
2017-10-13 07:50:46 -07:00
Edi Modrić
e0681f9955 [Form] [TwigBridge] Added option to disable usage of default themes when rendering a form 2017-10-13 16:30:18 +02:00
Nicolas Grekas
3f0a3f58a6 Merge branch '3.3' into 3.4
* 3.3:
  fix serialized deprecations handling
2017-10-13 16:15:09 +02:00
Nicolas Grekas
be9382a772 minor #24551 [PhpUnitBridge] fix serialized deprecations handling (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[PhpUnitBridge] fix serialized deprecations handling

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

Commits
-------

2f5a0bd fix serialized deprecations handling
2017-10-13 16:14:51 +02:00
Christian Flothmann
2f5a0bd72f fix serialized deprecations handling 2017-10-13 16:13:33 +02:00
Nicolas Grekas
2c18da709f Merge branch '3.3' into 3.4
* 3.3:
  [BrowserKit] Handle deprecations triggered in insulated requests
  [Bridge\PhpUnit] Handle deprecations triggered in separate processes
  [Validator] added magic method __isset()  to File Constraint class
  [DI] Fix possible incorrect php-code when dumped strings contains newlines
  [Translation] minor: remove unused variable in test
  never match invalid IP addresses
2017-10-13 15:33:47 +02:00
Nicolas Grekas
17b48edebc Merge branch '2.8' into 3.3
* 2.8:
  [Validator] added magic method __isset()  to File Constraint class
  [DI] Fix possible incorrect php-code when dumped strings contains newlines
  [Translation] minor: remove unused variable in test
  never match invalid IP addresses
2017-10-13 15:32:37 +02:00
Nicolas Grekas
d04c0ea45b Merge branch '2.7' into 2.8
* 2.7:
  [Validator] added magic method __isset()  to File Constraint class
  [DI] Fix possible incorrect php-code when dumped strings contains newlines
  [Translation] minor: remove unused variable in test
  never match invalid IP addresses
2017-10-13 15:30:20 +02:00
Fabien Potencier
ac6d605659 bug #24535 [TwigBridge] fix BC for FormExtension if renderer is FormRenderer (dmaicher)
This PR was squashed before being merged into the 3.4 branch (closes #24535).

Discussion
----------

[TwigBridge] fix BC for FormExtension if renderer is FormRenderer

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

This fixes some issues within FormExtension since the renderer is now a `FormRenderer`.

Commits
-------

4a2f608f1e [TwigBridge] fix BC for FormExtension if renderer is FormRenderer
2017-10-13 06:28:25 -07:00
David Maicher
4a2f608f1e [TwigBridge] fix BC for FormExtension if renderer is FormRenderer 2017-10-13 06:28:23 -07:00
Fabien Potencier
f53229c236 bug #24541 [Form] Fix 5.5 compatibility for ResizeFormListener (yceruto)
This PR was squashed before being merged into the 3.4 branch (closes #24541).

Discussion
----------

[Form] Fix 5.5 compatibility for ResizeFormListener

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

531b294b21/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php (L152-L157)

Issue description: http://php.net/manual/en/language.types.callable.php#117260 (https://3v4l.org/oOoAV)

Commits
-------

ee70361e53 [Form] Fix 5.5 compatibility for ResizeFormListener
2017-10-13 06:25:58 -07:00
Yonel Ceruto
ee70361e53 [Form] Fix 5.5 compatibility for ResizeFormListener 2017-10-13 06:25:48 -07:00
Fabien Potencier
4ae1f896d7 bug #24548 [Bridge\PhpUnit] Handle deprecations triggered in separate processes (paul-m)
This PR was merged into the 3.3 branch.

Discussion
----------

[Bridge\PhpUnit] Handle deprecations triggered in separate processes

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

As reported in #23003, deprecations triggered in process-isolated test cases are not gathered.
This caught us already: HttpFoundation is still using deprecated code paths, but we missed them because of that issue with the bridge.

Here is the fixed output:
![capture du 2017-10-13 13-45-12](https://user-images.githubusercontent.com/243674/31544827-fe7ffee0-b01c-11e7-8020-4001735ce7a3.png)

Credits to @paul-m for working on the issue first.

Commits
-------

ca0fedd9e3 [BrowserKit] Handle deprecations triggered in insulated requests
ff379efb59 [Bridge\PhpUnit] Handle deprecations triggered in separate processes
2017-10-13 06:22:41 -07:00
Nicolas Grekas
ca0fedd9e3 [BrowserKit] Handle deprecations triggered in insulated requests 2017-10-13 15:21:24 +02:00
Paul Mitchum
ff379efb59 [Bridge\PhpUnit] Handle deprecations triggered in separate processes 2017-10-13 15:20:39 +02:00
den
e0d8ce4403 Fix LogLevel::DEBUG as min level 2017-10-12 15:00:23 -07:00
Fabien Potencier
3c3d642a19 feature #23112 [OptionsResolver] Support array of types in allowed type (pierredup)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Support array of types in allowed type

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

This replaces #17032 with a simpler approach to allow an array of types in the allowed types for the options resolver

Note: This implementation doesn't support nested values (I.E `int[][]`), but if there is a strong need for it, I'll add it in another PR

Commits
-------

d066a23860 Support array of types in allowed type
2017-10-12 14:55:29 -07:00
Fabien Potencier
2059609ccb bug #24519 [Validator] [Twig] added magic method __isset() to File Constraint class (loru88)
This PR was submitted for the 3.4 branch but it was merged into the 2.7 branch instead (closes #24519).

Discussion
----------

[Validator] [Twig] added magic method __isset()  to File Constraint class

| Q             | A
| ------------- | ---
| Branch?       | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #24512  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

In my project I get assert constraints from one of my entity and I use this value in my front end via Twig.
I faced a problem with the property $maxSize of the File Constraint.

As this property is protected I cannot access it via Twig because the magic method __isset is missing, as I read in twig documentation.
<!--
- 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 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

9efb76572a [Validator] added magic method __isset()  to File Constraint class
2017-10-12 14:44:38 -07:00
loru88
9efb76572a [Validator] added magic method __isset() to File Constraint class 2017-10-12 14:44:30 -07:00
Fabien Potencier
f35996d228 bug #24514 [TwigBridge] replace parameters in dummy identity translator (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] replace parameters in dummy identity translator

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

Commits
-------

2c9c3d80cf replace parameters in dummy identity translator
2017-10-12 10:35:24 -07:00
Pierre du Plessis
d066a23860 Support array of types in allowed type 2017-10-12 18:27:27 +02:00