Commit Graph

28581 Commits

Author SHA1 Message Date
Fabien Potencier
a7fb8c4112 bug #14082 [config] Fix issue when key removed and left value only (zerustech)
This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #14082).

Discussion
----------

[config] Fix issue when key removed and left value only

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

When a key attribute is mapped and the key is removed from the value array, if
only 'value' element is left in the array, it should replace its wrapper
array.

Assume the original value array is as follows (key attribute is 'id').

``` php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

After normalized, the above shall be converted to the following array.

``` php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => 'value2'
    )
)
```

It's also possible to mix 'value-only' and 'none-value-only' elements in
the array:

``` php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2', 'foo' => 'foo2')
    )
)
```

The above shall be converted to the following array.

``` php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => array('value' => 'value2','foo' => 'foo2')
    )
)
```

The 'value' element can also be array:

``` php
array(
    'things' => array(
        array(
            'id' => 'option1',
            'value' => array('foo'=>'foo1', 'bar' => 'bar1')
        )
    )
)
```

The above shall be converted to the following array.

``` php
array(
    'things' => array(
        'option1' => array('foo' => 'foo1', 'bar' => 'bar1')
    )
)
```

When using VariableNode for value element, it's also possible to mix
different types of value elements:

``` php
array(
    'things' => array(
        array('id' => 'option1', 'value' => array('foo'=>'foo1', 'bar' => 'bar1')),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

The above shall be converted to the following array.

``` php
array(
    'things' => array(
        'option1' => array('foo'=>'foo1', 'bar' => 'bar1'),
        'option2' => 'value2'
    )
)
```

Commits
-------

b587a72 [config] Fix issue when key removed and left value only
2016-12-14 09:02:51 +01:00
Michael Lee
b587a7294f [config] Fix issue when key removed and left value only
When a key attribute is mapped and the key is removed from the value array, if
only 'value' element is left in the array, it should replace its wrapper
array.

Assume the original value array is as follows (key attribute is 'id').

```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

After normalized, the above shall be converted to the following array.

```php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => 'value2'
    )
)
```

It's also possible to mix 'value-only' and 'none-value-only' elements in
the array:

```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => 'value1'),
        array('id' => 'option2', 'value' => 'value2', 'foo' => 'foo2')
    )
)
```

The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => 'value1',
        'option2' => array('value' => 'value2','foo' => 'foo2')
    )
)
```

The 'value' element can also be array:

```php
array(
    'things' => array(
        array(
            'id' => 'option1',
            'value' => array('foo'=>'foo1', 'bar' => 'bar1')
        )
    )
)
```
The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => array('foo' => 'foo1', 'bar' => 'bar1')
    )
)
```

When using VariableNode for value element, it's also possible to mix
different types of value elements:
```php
array(
    'things' => array(
        array('id' => 'option1', 'value' => array('foo'=>'foo1', 'bar' => 'bar1')),
        array('id' => 'option2', 'value' => 'value2')
    )
)
```

The above shall be converted to the following array.
```php
array(
    'things' => array(
        'option1' => array('foo'=>'foo1', 'bar' => 'bar1'),
        'option2' => 'value2'
    )
)
```

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15270
| License       | MIT
| Doc PR        | n/a
2016-12-14 09:02:51 +01:00
Fabien Potencier
05e83f5a4e bug #20910 [HttpFoundation] Fix cookie to string conversion for raw cookies (ro0NL)
This PR was squashed before being merged into the 3.1 branch (closes #20910).

Discussion
----------

[HttpFoundation] Fix cookie to string conversion for raw cookies

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | not really
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20569#discussion_r92135987
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Separated from #20569

This mimics PHP's `setrawcookie` behavior.

Commits
-------

5e899cd [HttpFoundation] Fix cookie to string conversion for raw cookies
2016-12-14 08:17:24 +01:00
Roland Franssen
5e899cd2a7 [HttpFoundation] Fix cookie to string conversion for raw cookies 2016-12-14 08:17:13 +01:00
Fabien Potencier
f1cddab715 bug #20909 Fix misresolved parameters in debug:config on 3.2 (chalasr)
This PR was merged into the 3.2 branch.

Discussion
----------

Fix misresolved parameters in debug:config on 3.2

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

This fixes parameters resolution (classic and env ones) in `debug:config`, again.
Merging #20714 broke the fix resolving env parameters made in #20688, and anyway it was mismerged (#20714 was not applied when using the `path` argument, my bad, I should have prevented it).

This adds a test which prevents regressions so I hope this is is the last PR on this subject.
The buggy output is unfortunately part of the last 3.2 release... It can easily be confirmed by running `debug:config doctrine` on a fresh symfony-demo project

Commits
-------

c88bc89 Fix misresolved parameters in debug:config on 3.2
2016-12-14 08:02:14 +01:00
Robin Chalas
c88bc899d4
Fix misresolved parameters in debug:config on 3.2 2016-12-13 20:36:21 +01:00
Fabien Potencier
5f0f842cf9 bug #20904 [TwigBundle] Config is now a hard dependency (dunglas)
This PR was merged into the 3.2 branch.

Discussion
----------

[TwigBundle] Config is now a hard dependency

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

TwigBundle now has a hard dependency to the config component: https://github.com/symfony/twig-bundle/blob/3.2/DependencyInjection/Compiler/ExtensionPass.php#L85

It breaks API Platform builds: https://travis-ci.org/api-platform/core/jobs/183638888

Commits
-------

01b7e6c [TwigBundle] Config is now a hard dependency
2016-12-13 18:22:32 +01:00
Fabien Potencier
917eacac25 bug #20847 [Console] fixed BC issue with static closures (araines)
This PR was squashed before being merged into the 2.8 branch (closes #20847).

Discussion
----------

[Console] fixed BC issue with static closures

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

Static closures were unable to be used in Command::setCode since #14431.  This change fixes the BC break and ensures static closures can still be used.

Edit: It seems the inability to bind static closures was considered a feature in PHP5 but was considered a bug by PHP7.  As such, the tests need to work around this fact - but the code can remain the same.  This code change can be tidied/removed once Symfony is PHP7+ only.

Discussion here:
https://bugs.php.net/bug.php?id=64761
https://bugs.php.net/bug.php?id=68792

Commits
-------

3247308 [Console] fixed BC issue with static closures
2016-12-13 18:12:26 +01:00
Andy Raines
3247308c50 [Console] fixed BC issue with static closures 2016-12-13 18:12:25 +01:00
Kévin Dunglas
01b7e6c737
[TwigBundle] Config is now a hard dependency 2016-12-13 17:42:40 +01:00
Fabien Potencier
6f46d5d776 Merge branch '3.1' into 3.2
* 3.1:
  [Console] Review Application docblocks
  bumped Symfony version to 3.1.9
  updated VERSION for 3.1.8
  updated CHANGELOG for 3.1.8
  bumped Symfony version to 2.8.16
  updated VERSION for 2.8.15
  updated CHANGELOG for 2.8.15
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:32:03 +01:00
Fabien Potencier
298452da31 Merge branch '2.8' into 3.1
* 2.8:
  [Console] Review Application docblocks
  bumped Symfony version to 2.8.16
  updated VERSION for 2.8.15
  updated CHANGELOG for 2.8.15
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:31:15 +01:00
Fabien Potencier
e221ac9df7 Merge branch '2.7' into 2.8
* 2.7:
  [Console] Review Application docblocks
  bumped Symfony version to 2.7.23
  updated VERSION for 2.7.22
  update CONTRIBUTORS for 2.7.22
  updated CHANGELOG for 2.7.22
  Update PHP CS Fixer config file
2016-12-13 16:30:11 +01:00
Fabien Potencier
79e68965c1 minor #20731 DX: Update PHP CS Fixer config file (keradus)
This PR was merged into the 2.7 branch.

Discussion
----------

DX: Update PHP CS Fixer config file

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

For a good start, updated config for php cs fixer v2.
I would guess that fabbot needs to be updated ;)

Commits
-------

a0e305b Update PHP CS Fixer config file
2016-12-13 16:29:10 +01:00
Fabien Potencier
7f85f6dc1e minor #20813 [Console] Review Application docblocks (ogizanagi)
This PR was squashed before being merged into the 2.7 branch (closes #20813).

Discussion
----------

[Console] Review Application docblocks

| 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

~I know there must be a lot of other places in the core where there is some repeated or useless informations in docblocks, but everytime I dig into the `Application` class, I see this, and I don't want to repeat things for consistency when adding new methods 😅  (for instance in #20808, the `setCatchThrowables / areThrowablesCaught ` methods do not need a docblock description IMHO).~

~This PR adapts docblocks where:~

- ~A docblock description is not required, as everything can be expressed in the `@return / @param` argument (the case mentioned above)~
- ~Information is redundant between description and tags, and the context does not have to be reminded again:~

```diff

    /**
     * Adds an array of command objects.
     *
     * If a Command is not enabled it will not be added.
     *
-     * @param Command[] $commands An array of commands
+     * @param Command[] $commands
     */
    public function addCommands(array $commands)
    {
        foreach ($commands as $command) {
            $this->add($command);
        }
    }
```

Commits
-------

d8c18cc [Console] Review Application docblocks
2016-12-13 16:27:53 +01:00
Maxime STEINHAUSSER
d8c18cc3cd [Console] Review Application docblocks 2016-12-13 16:27:52 +01:00
Nicolas Grekas
638533b532 minor #20902 [Cache] Improve performances into foreach (PhpFilesAdapter) (hadjedjvincent)
This PR was squashed before being merged into the 3.2 branch (closes #20902).

Discussion
----------

[Cache] Improve performances into foreach (PhpFilesAdapter)

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

Let's prevent some useless call to be made into this foreach (ini_get)

Commits
-------

7e4573b [Cache] Improve performances into foreach (PhpFilesAdapter)
2016-12-13 16:09:49 +01:00
Vincent HADJEDJ
7e4573bcfb [Cache] Improve performances into foreach (PhpFilesAdapter) 2016-12-13 16:09:48 +01:00
Fabien Potencier
c41cfcb897 bumped Symfony version to 3.2.2 2016-12-13 14:40:27 +01:00
Fabien Potencier
5824d42367 Merge pull request #20897 from fabpot/release-3.2.1
released v3.2.1
2016-12-13 14:20:15 +01:00
Fabien Potencier
d884a521f3 updated VERSION for 3.2.1 2016-12-13 14:19:46 +01:00
Fabien Potencier
cd99324c0e updated CHANGELOG for 3.2.1 2016-12-13 14:19:37 +01:00
Fabien Potencier
8bf83cc0b0 bumped Symfony version to 3.1.9 2016-12-13 14:18:12 +01:00
Fabien Potencier
ae37418e61 Merge pull request #20895 from fabpot/release-3.1.8
released v3.1.8
2016-12-13 13:52:30 +01:00
Fabien Potencier
25b40ff90c updated VERSION for 3.1.8 2016-12-13 13:52:10 +01:00
Fabien Potencier
67385a5583 updated CHANGELOG for 3.1.8 2016-12-13 13:52:03 +01:00
Fabien Potencier
2422f7da9b bug #20891 Add support for REDIS_URL environment variables. (robinvdvleuten)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #20891).

Discussion
----------

Add support for REDIS_URL environment variables.

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

In most PAAS solutions - Heroku for example - the Redis connection string is exposed as an environment variable like `REDIS_URL`. This PR adds support for those by allowing the following config;

```yml
framework:
    cache:
        default_redis_provider: "%env(REDIS_URL)%"
```

In the referenced issue there was some discussion about maybe a new config options like `default_redis_url`, but this makes it hard to check in the extension for the case that an user configured a custom _default_redis_provider_ and also has configured the default url.

Commits
-------

4e6086f Add support for REDIS_URL environment variables.
2016-12-13 13:50:45 +01:00
Robin van der Vleuten
4e6086f7db Add support for REDIS_URL environment variables. 2016-12-13 13:50:44 +01:00
Fabien Potencier
a163a16554 bumped Symfony version to 2.8.16 2016-12-13 13:44:14 +01:00
Fabien Potencier
3ec15b9379 Merge pull request #20892 from fabpot/release-2.8.15
released v2.8.15
2016-12-13 13:16:34 +01:00
Fabien Potencier
5b5311c130 updated VERSION for 2.8.15 2016-12-13 13:16:15 +01:00
Fabien Potencier
42fbabd470 updated CHANGELOG for 2.8.15 2016-12-13 13:16:09 +01:00
Fabien Potencier
f22a505629 bumped Symfony version to 2.7.23 2016-12-13 13:12:22 +01:00
Fabien Potencier
4b0fd9881d Merge pull request #20890 from fabpot/release-2.7.22
released v2.7.22
2016-12-13 11:53:44 +01:00
Fabien Potencier
bdb6bf985f updated VERSION for 2.7.22 2016-12-13 11:53:27 +01:00
Fabien Potencier
c5ab208642 update CONTRIBUTORS for 2.7.22 2016-12-13 11:53:11 +01:00
Fabien Potencier
9cd884312f updated CHANGELOG for 2.7.22 2016-12-13 11:53:02 +01:00
Fabien Potencier
1e1a01804e Merge branch '3.1' into 3.2
* 3.1:
  Define a GitHub issue template to avoid support questions
2016-12-13 11:41:36 +01:00
Fabien Potencier
c9beeb7de8 Merge branch '2.8' into 3.1
* 2.8:
  Define a GitHub issue template to avoid support questions
2016-12-13 11:41:27 +01:00
Fabien Potencier
5af7f1afc1 Merge branch '2.7' into 2.8
* 2.7:
  Define a GitHub issue template to avoid support questions
2016-12-13 11:41:19 +01:00
Fabien Potencier
cf02e3cc3d minor #20295 Define a GitHub issue template to avoid support questions (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #20295).

Discussion
----------

Define a GitHub issue template to avoid support questions

We're getting a lot of issues that are in fact support questions. Should we give a try at defining a GitHub Issue template to try to minimize this problem?

The text contents are temporary. This is how they'd look:

![issue_template](https://cloud.githubusercontent.com/assets/73419/19683472/9be02128-9ab2-11e6-90a7-987ddcb49d97.png)

Commits
-------

eeaca5c Define a GitHub issue template to avoid support questions
2016-12-13 11:28:06 +01:00
Javier Eguiluz
eeaca5c96b Define a GitHub issue template to avoid support questions 2016-12-13 11:28:04 +01:00
Fabien Potencier
1943c26d47 Merge branch '3.1' into 3.2
* 3.1:
  Write an exception message in a one heading line
  [Finder] Refine phpdoc about argument for NumberComparator
  Fixed max width from ajax request url element (td)
  Fix unresolved parameters from default bundle configs in debug:config
  [github] Tweak PR template
  [Serializer] Optimize max depth checking
2016-12-13 10:39:43 +01:00
Fabien Potencier
ed73b0c629 Merge branch '2.8' into 3.1
* 2.8:
  Write an exception message in a one heading line
  [Finder] Refine phpdoc about argument for NumberComparator
  Fix unresolved parameters from default bundle configs in debug:config
  [github] Tweak PR template
2016-12-13 10:38:21 +01:00
Fabien Potencier
c9d08b61c3 Merge branch '2.7' into 2.8
* 2.7:
  Write an exception message in a one heading line
  [Finder] Refine phpdoc about argument for NumberComparator
  Fix unresolved parameters from default bundle configs in debug:config
  [github] Tweak PR template
2016-12-13 10:38:12 +01:00
Fabien Potencier
3f04132b26 minor #20381 [github] Tweak PR template (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[github] Tweak PR template

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

Related to #20295

Commits
-------

2acaf5f [github] Tweak PR template
2016-12-13 10:24:16 +01:00
Fabien Potencier
e55f79b5c6 minor #20529 [Serializer] Optimize max depth checking (dunglas)
This PR was merged into the 3.1 branch.

Discussion
----------

[Serializer] Optimize max depth checking

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

Avoid to call the metadata factory for each attribute when max depth checking is enabled.
Prepare the code for the "serialized name" feature (that also requires metadata) in Symfony 3.3.

Commits
-------

bb3ee76 [Serializer] Optimize max depth checking
2016-12-13 10:15:55 +01:00
Fabien Potencier
25c0103571 bug #20724 [WebProfilerBundle] Fix AJAX panel with fetch requests (OnekO)
This PR was squashed before being merged into the 3.2 branch (closes #20724).

Discussion
----------

[WebProfilerBundle] Fix AJAX panel with fetch requests

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

Commits
-------

5527ee3 [WebProfilerBundle] Fix AJAX panel with fetch requests
2016-12-13 09:50:09 +01:00
Karlos
5527ee3d11 [WebProfilerBundle] Fix AJAX panel with fetch requests 2016-12-13 09:50:07 +01:00
Fabien Potencier
0a6f1274de minor #20715 [WebProfilerBundle] Fix AJAX panel width for long URLs (yceruto)
This PR was merged into the 3.1 branch.

Discussion
----------

[WebProfilerBundle] Fix AJAX panel width for long URLs

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

When the AJAX url path is very long, the **profile ``<td>``** token value is not fully displayed.

### Before

![before](https://cloud.githubusercontent.com/assets/2028198/20801819/16949c88-b7b8-11e6-9186-c350cb0f6868.png)

### After

![after](https://cloud.githubusercontent.com/assets/2028198/20804230/1519a7ec-b7c0-11e6-8ebe-f2ebfa5ab08e.png)

### Other Possible Solutions

1. Fix ``max-width`` from ``.sf-toolbar-block:hover .sf-toolbar-info`` class to ``512px``. (same result but the AJAX panel is a bit longer)
2. Fix ``max-width`` from ``.sf-toolbar-block:hover .sf-toolbar-info`` class to ``none`` or remove it. It would avoid future issues (mainly with third bundles) with children width greater than ``480px``. (Promising) ?

//cc @javiereguiluz

Commits
-------

b0a8f8e Fixed max width from ajax request url element (td)
2016-12-13 09:48:35 +01:00