Commit Graph

24192 Commits

Author SHA1 Message Date
Fabien Potencier
708b9a2214 minor #20729 [Finder] Refine phpdoc about argument for NumberComparator (vlakoff)
This PR was merged into the 2.7 branch.

Discussion
----------

[Finder] Refine phpdoc about argument for NumberComparator

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

The most important being the addition of "string" to `Finder::depth()`.

Commits
-------

9b9d339 [Finder] Refine phpdoc about argument for NumberComparator
2016-12-13 09:47:45 +01:00
Fabien Potencier
a495947447 minor #20849 Write an exception message in a one heading line (bocharsky-bw)
This PR was merged into the 2.7 branch.

Discussion
----------

Write an exception message in a one heading line

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

It allows quickly `grep`-ing exception messages in console, for example:

```bash
curl localhost/any-path-which-throws-uncaught-exception | grep '<h1>'
```

But it's impossible to use `grep` filter when exception message goes on the next line after `<h1>` tag.

Commits
-------

21925da Write an exception message in a one heading line
2016-12-13 09:34:02 +01:00
Fabien Potencier
cd0bb3d528 bug #20714 [FrameworkBundle] Fix unresolved parameters from default configs in debug:config (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix unresolved parameters from default configs in debug:config

| 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

When using the `debug:config` command, if the dumped configuration is explicitly defined by the user, then parameters are properly resolved in the output. If it is not, and values come from the bundle default configuration directly, they are not.

Steps to reproduce:
- Checkout the symfony demo
- Run `debug:config twig`
- Look at the `debug` key, it is the `kernel.debug` parameter properly resolved: `true`
- Look at the `cache` key, it is not resolved: `'%kernel.cache_dir%/twig'`

This fixes it by resolving the configs once again after processing the configuration.
ping @weaverryan

Commits
-------

26f588a Fix unresolved parameters from default bundle configs in debug:config
2016-12-13 08:41:32 +01:00
Fabien Potencier
3113f3f93f minor #20852 Skip test when iconv extension is missing (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

Skip test when iconv extension is missing

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

Commits
-------

ae7377d Skip test when iconv extension is missing
2016-12-10 15:23:12 +01:00
Fabien Potencier
a9d92748b5 bug #20442 [FrameworkBundle] Bundle commands are not available via find() (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Bundle commands are not available via find()

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

The `Symfony\Bundle\FrameworkBundle\Console\Application::find()` method does not retrieve the bundle commands and only checks the ones that were added manually.

Commits
-------

dd69b88 Fix bundle commands are not available via find()
2016-12-10 15:19:05 +01:00
Fabien Potencier
3fd62d3c3a minor #20843 [Config] fix dev dependencies (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] fix dev dependencies

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

Since #20827, we need the Yaml component to run the tests for the `YamlReferenceDumper`.

Commits
-------

292ae7c [Config] fix dev dependencies
2016-12-10 09:20:51 +01:00
Julien Falque
ae7377d128
Skip test when iconv extension is missing 2016-12-09 19:19:27 +01:00
Victor Bocharsky
21925da88b Write an exception message in a one heading line 2016-12-09 17:28:59 +02:00
Christian Flothmann
292ae7c3eb [Config] fix dev dependencies 2016-12-09 09:40:53 +01:00
Fabien Potencier
be72520fc3 minor #20827 [Config] Do not skip YamlReferenceDumperTest entirely (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Do not skip YamlReferenceDumperTest entirely

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

The test is now completed in 3.2, but for older branch, any changes in the `YamlReferenceDumper` is not tested on travis and requires to test it manually or comment the `markTestIncomplete` line.

`assertEquals` should still be used on 3.2.

Commits
-------

1ed9335 [Config] Do not skip YamlReferenceDumperTest entirely
2016-12-09 08:38:58 +01:00
Fabien Potencier
42929dde2b minor #20826 [Config] Fix YamlReferenceDumper extra space (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Fix YamlReferenceDumper extra space

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

Simply fixes a minor rendering issue when using the `YamlReferenceDumper`.

<details>
<summary>For reference, see the difference with this fix on the framework configuration</summary>

```diff
diff --git a/framework_before.yml b/framework_after.yml
index f28ffd0..0486709 100644
--- a/framework1.txt
+++ b/framework2.txt
@@ -3,7 +3,7 @@ framework:
     secret:               ~

     # Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. Note: When using the HttpCache, you need to call the method in your front controller instead
-    http_method_override:  true
+    http_method_override: true
     trusted_proxies:      []
     ide:                  null
     test:                 ~
@@ -37,7 +37,7 @@ framework:
         enabled:              false
         collect:              true
         only_exceptions:      false
-        only_master_requests:  false
+        only_master_requests: false
         dsn:                  'file:%kernel.cache_dir%/profiler'
         matcher:
             enabled:              false
@@ -97,7 +97,7 @@ framework:
         save_path:            '%kernel.cache_dir%/sessions'

         # seconds to wait between 2 session metadata updates, it will also prevent the session handler to write if the session has not changed
-        metadata_update_threshold:  '0'
+        metadata_update_threshold: '0'

     # request configuration
     request:
@@ -110,7 +110,7 @@ framework:
     # templating configuration
     templating:
         enabled:              false
-        hinclude_default_template:  null
+        hinclude_default_template: null
         cache:                ~
         form:
             resources:
@@ -180,7 +180,7 @@ framework:
     # Property access configuration
     property_access:
         magic_call:           false
-        throw_exception_on_invalid_index:  false
+        throw_exception_on_invalid_index: false

     # Property info configuration
     property_info:
@@ -198,9 +198,9 @@ framework:
         # System related cache pools configuration
         system:               cache.adapter.system
         directory:            '%kernel.cache_dir%/pools'
-        default_doctrine_provider:  ~
-        default_psr6_provider:  ~
-        default_redis_provider:  'redis://localhost'
+        default_doctrine_provider: ~
+        default_psr6_provider: ~
+        default_redis_provider: 'redis://localhost'
         pools:

             # Prototype
```
</details>

---

(tests failures are unrelated)

Commits
-------

685a9b9 [Config] Fix YamlReferenceDumper extra space
2016-12-09 08:35:05 +01:00
Fabien Potencier
d9738a497d bug #20840 [WebProfilerBundle] add dependency on Twig (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] add dependency on Twig

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

Requiring a specific minimum version of the TwigBridge just to be sure
that we end up with the required Twig version does not make much sense
if can simply specify the required version instead (we do in fact depend
on Twig in the WebProfilerBundle).

Commits
-------

91689a7 add dependency on Twig
2016-12-09 08:33:13 +01:00
Christian Flothmann
91689a7961 add dependency on Twig
Requiring a specific minimum version of the TwigBridge just to be sure
that we end up with the required Twig version does not make much sense
if can simply specify the required version instead (we do in fact depend
on Twig in the WebProfilerBundle).
2016-12-09 07:11:54 +01:00
Nicolas Grekas
56c3eef724 minor #20832 [WebProfilerBundle] Fix whitespace control in layout.html.twig (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] Fix whitespace control in layout.html.twig

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

Commits
-------

d052fa9 [WebProfilerBundle] Fix whitespace control in layout.html.twig
2016-12-08 16:57:52 +01:00
Nicolas Grekas
0aa80f25d7 bug #20828 [Validator] Fix init of YamlFileLoader::$classes for empty files (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Fix init of YamlFileLoader::$classes for empty files

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

Commits
-------

073a1da [Validator] Fix init of YamlFileLoader::$classes for empty files
2016-12-08 16:57:04 +01:00
Nicolas Grekas
d052fa933c [WebProfilerBundle] Fix whitespace control in layout.html.twig 2016-12-08 16:53:03 +01:00
Nicolas Grekas
28a0be8a4f bug #20539 Cast result to int before adding to it (alcaeus)
This PR was merged into the 2.7 branch.

Discussion
----------

Cast result to int before adding to it

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

This fixes the occasional warning about non-numeric values when using PHP 7.1.

Commits
-------

70c42f2 Cast result to int before adding to it
2016-12-08 15:35:57 +01:00
Nicolas Grekas
be5a5e43e7 bug #20831 [Twig] Fix deprecations with Twig 1.29 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Twig] Fix deprecations with Twig 1.29

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

Commits
-------

9218cac [Twig] Fix deprecations with Twig 1.29
2016-12-08 15:27:27 +01:00
Nicolas Grekas
9218cacf31 [Twig] Fix deprecations with Twig 1.29 2016-12-08 15:02:33 +01:00
Nicolas Grekas
073a1dae13 [Validator] Fix init of YamlFileLoader::$classes for empty files 2016-12-08 13:07:24 +01:00
Maxime STEINHAUSSER
1ed9335e88 [Config] Do not skip YamlReferenceDumperTest entirely 2016-12-08 11:59:24 +01:00
Maxime STEINHAUSSER
685a9b9d9a [Config] Fix YamlReferenceDumper extra space 2016-12-08 11:42:33 +01:00
Fabien Potencier
7a07c1b464 minor #20800 [Security] fix the docblock in regard to the role argument (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix the docblock in regard to the role argument

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

Makes the docblocks consistent with the `UserInterface` since #17525.

Commits
-------

4e563ae fix the docblock in regard to the role argument
2016-12-07 09:06:36 +01:00
Christian Flothmann
4e563aee02 fix the docblock in regard to the role argument 2016-12-06 21:51:50 +01:00
Nicolas Grekas
e59ae4d618 minor #20785 [VarDumper] fix tests when xdebug is enabled (ShinDarth)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20785).

Discussion
----------

[VarDumper] fix tests when xdebug is enabled

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

- Disabled some test cases when xdebug is enabled, see https://github.com/symfony/symfony/issues/20778

Commits
-------

488ebbf [VarDumper] fix tests when xdebug is enabled
2016-12-06 17:03:46 +01:00
ShinDarth
488ebbfe5d [VarDumper] fix tests when xdebug is enabled 2016-12-06 17:03:37 +01:00
Nicolas Grekas
777fda319d bug #20767 [Cache] Fix dumping SplDoublyLinkedList iter mode (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Cache] Fix dumping SplDoublyLinkedList iter mode

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

Commits
-------

bfe149f [Cache] Fix dumping SplDoublyLinkedList iter mode
2016-12-06 12:56:14 +01:00
Nicolas Grekas
bfe149fdc6 [Cache] Fix dumping SplDoublyLinkedList iter mode 2016-12-05 18:21:04 +01:00
Fabien Potencier
f9bceb832f bug #20736 [Console] fixed PHP7 Errors when not using Dispatcher (keradus)
This PR was squashed before being merged into the 2.7 branch (closes #20736).

Discussion
----------

[Console] fixed PHP7 Errors when not using Dispatcher

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17257, #20110, #20111
| License       | MIT
| Doc PR        | n/a

Original fix, #19813, works only when there is event dispatcher available.
This PR fix the issue also for scenario without event dispatcher.

Closes #20110 issue and #20111 PR connected to it.
Closing #17257 , as everywhere the error is converted to exception and it should be handled

Commits
-------

899fa79 [Console] fixed PHP7 Errors when not using Dispatcher
2016-12-05 14:00:59 +01:00
Dariusz Ruminski
899fa7936b [Console] fixed PHP7 Errors when not using Dispatcher 2016-12-05 14:00:57 +01:00
Fabien Potencier
e70dc640cf bug #20755 [2.7][HttpKernel] Regression test for missing controller arguments (iltar)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][HttpKernel] Regression test for missing controller arguments

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

This fix should ensure that when an action has a mandatory parameter without a type, it will throw the exception instead of inserting null.

This test was missing when adding nullable support in 2.7 and up (probably has to be added to 3.1 as well).

Commits
-------

d1a7164 Regression test for missing controller arguments
2016-12-05 08:53:58 +01:00
Iltar van der Berg
d1a7164626 Regression test for missing controller arguments 2016-12-05 08:37:23 +01:00
Nicolas Grekas
e0bd2a2b08 minor #20741 [DependencyInjection] fix a test checking for a value (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] fix a test checking for a value

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

Commits
-------

aea0478 fix a test checking for a value
2016-12-03 15:32:00 +01:00
Christian Flothmann
aea0478451 fix a test checking for a value 2016-12-03 14:58:39 +01:00
Fabien Potencier
7ef0951daf bug #20418 [Form][DX] FileType "multiple" fixes (yceruto)
This PR was squashed before being merged into the 2.7 branch (closes #20418).

Discussion
----------

[Form][DX] FileType "multiple" fixes

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

# (1st) Derive "data_class" option from passed "multiple" option

Information
-------------

Following this tutorial ["How to Upload Files"][1] but storing many `brochures` instead of one, i.e.:

```php
// src/AppBundle/Entity/Product.php

class Product
{
    /**
     * @var string[]
     *
     * @ORM\Column(type="array")
     */
    private $brochures;

    //...
}
```

```php
//src/AppBundle/Form/ProductType.php

$builder->add('brochures', FileType::class, array(
    'label' => 'Brochures (PDF files)',
    'multiple' => true,
));
```

The Problem
--------------

I found a pain point here when the form is loaded again after save some brochures (Exception):

> The form's view data is expected to be an instance of class Symfony\Component\HttpFoundation\File\File, but is a(n) array. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms a(n) array to an instance of Symfony\Component\HttpFoundation\File\File.

The message is very clear, but counter-intuitive in this case, because the form field (`FileType`) was configured with `multiple = true`, so IMHO it shouldn't expect a `File` instance but an array of them at all events.

The PR's effect
---------------

**Before:**

```php
$form = $this->createFormBuilder($product)
    ->add('brochures', FileType::class, [
        'multiple' => true,
	'data_class' => null, // <---- mandatory
    ])
    ->getForm();
```

**After:**

```php
$form = $this->createFormBuilder($product)
    ->add('brochures', FileType::class, [
        'multiple' => true,
    ])
    ->getForm();
```

# (2nd) Return empty `array()` at submit no file

Information
-------------

Based on the same information before, but adding some constraints:

```php
// src/AppBundle/Entity/Product.php

use Symfony\Component\Validator\Constraints as Assert;

class Product
{
    /**
     * @var string[]
     *
     * @ORM\Column(type="array")
     *
     * @Assert\Count(min="1") // or @Assert\NotBlank()
     * @Assert\All({
     *     @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
     * })
     *
     */
    private $brochures;
}
```

This should require at least one file to be stored.

The Problem
--------------

But, when no file is uploaded at submit the form, it's valid completely. The submitted data for this field was `array(null)` so the constraints pass without any problem:

* `@Assert\Count(min="1")` pass! because contains at least one element (No matter what)
* `@Assert\NotBlank()` it could pass! because no `false` and no `empty()`
* `@Assert\File()` pass! because the element is `null`

Apart from that really we expecting an empty array instead.

The PR's effect
----------------

**Before:**

```php
// src/AppBundle/Entity/Product.php

use Symfony\Component\Validator\Constraints as Assert;

class Product
{
    /**
     * @var string[]
     *
     * @ORM\Column(type="array")
     *
     * @Assert\All({
     *     @Assert\NotBlank,
     *     @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
     * })
     *
     */
    private $brochures;
}
```

**After:**

```php
// src/AppBundle/Entity/Product.php

use Symfony\Component\Validator\Constraints as Assert;

class Product
{
    /**
     * @var string[]
     *
     * @ORM\Column(type="array")
     *
     * @Assert\Count(min="1") // or @Assert\NotBlank
     * @Assert\All({
     *     @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
     * })
     *
     */
    private $brochures;
}
```

  [1]: http://symfony.com/doc/current/controller/upload_file.html

Commits
-------

36b7ba6 [Form][DX] FileType "multiple" fixes
2016-12-03 12:33:29 +01:00
Yonel Ceruto
36b7ba64f4 [Form][DX] FileType "multiple" fixes 2016-12-03 12:33:12 +01:00
Fabien Potencier
fe15381a45 minor #20425 [Form] fixed "empty_value" option deprecation (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] fixed "empty_value" option deprecation

| Q             | A
| ------------- | ---
| Branch?       | 2.x only
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/15945#r86547326
| License       | MIT
| Doc PR        | ~

I didn't make any profiling but a resolver instance is passed to `configureOptions()` creating locale variables including those exceptions for each field using one of the patched form types, so I guess the memory usage can grow really fast.

Commits
-------

7e84907 [Form] fixed "empty_value" option deprecation
2016-12-03 11:52:40 +01:00
Fabien Potencier
5f62f01943 fixed CS 2016-12-03 11:50:08 +01:00
Fabien Potencier
4a7fbdde5a bug #19902 [DependencyInjection] PhpDumper.php: hasReference() shouldn't search references in lazy service. (antanas-arvasevicius)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] PhpDumper.php: hasReference() shouldn't search references in lazy service.

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

more info:
https://github.com/symfony/symfony/issues/19901

Commits
-------

595a978 [DependencyInjection] PhpDumper.php: hasReference() should not search references in lazy service arguments.
2016-12-03 11:48:01 +01:00
vlakoff
9b9d33959c [Finder] Refine phpdoc about argument for NumberComparator 2016-12-03 06:31:03 +01:00
Fabien Potencier
5f4d8e9441 bug #20704 [Console] Fix wrong handling of multiline arg/opt descriptions (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix wrong handling of multiline arg/opt descriptions

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20237, https://github.com/symfony/symfony/pull/13220#discussion_r84281248
| License       | MIT
| Doc PR        | N/A

### Before

<img width="1072" alt="screenshot 2016-11-30 a 19 23 17" src="https://cloud.githubusercontent.com/assets/2211145/20765428/8b622304-b732-11e6-911b-b169e9aed5fd.PNG">

### After

<img width="1074" alt="screenshot 2016-11-30 a 19 23 46" src="https://cloud.githubusercontent.com/assets/2211145/20765432/9159a53e-b732-11e6-909f-ec8107c78fed.PNG">

@rquadling and @leofeyer deserve the credit for reporting the issue and suggesting the proper fix. I've only executed it.

---

<details>
<summary>Show code to reproduce:</summary>

```php
<?php

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

require __DIR__.'/../vendor/autoload.php';

(new Application())
    ->add(new class extends Command {
        protected function configure()
        {
            $description = "One of:" . array_reduce(['purge', 'truncate', 'delete', 'insert', 'select'], function ($value, $previous = '') {
                    return "$value\n- $previous";
            });

            $this
                ->setName('execute')
                ->addArgument('action', InputArgument::REQUIRED, $description)
                ->addOption('another-one', 'a', InputOption::VALUE_OPTIONAL, $description)
            ;
        }
    })
    ->getApplication()
    ->run(new ArgvInput())
;
```
</details>

Commits
-------

18fc6b5 [Console] Fix wrong handling of multiline arg/opt descriptions
2016-12-02 12:53:31 +01:00
Fabien Potencier
5d7f4e17c4 bug #20712 [TwigBundle] Fix twig loader registered twice (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Fix twig loader registered twice

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

Generated code:

### Before

```php
    protected function getTwig_LoaderService()
    {
        $a = new \Twig_Loader_Filesystem(array(), $this->targetDirs[3]);

        $a->addPath(...);
        // ...

        $this->services['twig.loader'] = $instance = new \Twig_Loader_Chain();

        $instance->addLoader($a);
        $instance->addLoader($a);

        return $instance;
    }
```

### After

```php
    protected function getTwig_LoaderService()
    {
        $this->services['twig.loader'] = $instance = new \Twig_Loader_Filesystem(array(), $this->targetDirs[3]);

        $instance->addPath(...);
        // ...

        return $instance;
    }
```

~~Another solution is to simply create a private alias. But I don't know if we should care or not about the case people may rely on the fact both services exist as definition, and not as an alias, in a compiler pass.~~ (Has been preferred over of using a child definition)

For reference, this issue was introduced in https://github.com/symfony/symfony/pull/13354.

Commits
-------

2c81819 [TwigBundle] Fix twig loader registered twice
2016-12-02 12:39:04 +01:00
Maxime STEINHAUSSER
2c818193c1 [TwigBundle] Fix twig loader registered twice 2016-12-02 12:00:53 +01:00
Robin Chalas
26f588a7b5 Fix unresolved parameters from default bundle configs in debug:config 2016-12-01 15:23:59 +01:00
Maxime Steinhausser
18fc6b54da [Console] Fix wrong handling of multiline arg/opt descriptions 2016-11-30 19:39:48 +01:00
Nicolas Grekas
c360a222ef bug #20671 [Config] ConfigCache::isFresh() should return false when unserialize() fails (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] ConfigCache::isFresh() should return false when unserialize() fails

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

Removes some `Warning: Class __PHP_Incomplete_Class has no unserializer` failures when clearing the cache.

Commits
-------

609245e [Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class
2016-11-29 11:51:46 +01:00
Nicolas Grekas
609245e953 [Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class 2016-11-29 11:39:48 +01:00
Fabien Potencier
49addbe040 bug #20676 [ClassLoader] Use only forward slashes in generated class map (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20676).

Discussion
----------

[ClassLoader] Use only forward slashes in generated class map

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

Commits
-------

6d1f1b5 [ClassLoader] Use only forward slashes in generated class map
2016-11-29 09:16:08 +01:00
Nicolas Grekas
6d1f1b5d4a [ClassLoader] Use only forward slashes in generated class map 2016-11-29 09:16:08 +01:00
Fabien Potencier
ec937cbcd9 bug #20664 [Validator] ensure the proper context for nested validations (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] ensure the proper context for nested validations

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

Commits
-------

56c8ff8 ensure the proper context for nested validations
2016-11-29 09:13:44 +01:00