Commit Graph

24573 Commits

Author SHA1 Message Date
Fabien Potencier
420989f5a9 feature #17113 [Serializer] Add a MaxDepth option (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17113).

Discussion
----------

[Serializer] Add a MaxDepth option

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/14924#issuecomment-111977173, https://github.com/dunglas/DunglasApiBundle/issues/104#issuecomment-110644569
| License       | MIT
| Doc PR        | todo

Add a max depth option during the normalization process. Especially useful when normalizing trees.

Usage:

```php
use Symfony\Component\Serializer\Annotation\MaxDepth;

class MyObj
{
    /**
     * @MaxDepth(2)
     */
    public $foo;

    /**
     * @var self
     */
    public $child;
}

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;

$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$normalizer = new ObjectNormalizer($classMetadataFactory);
$serializer = new Serializer(array($this->normalizer));

$level1 = new MyObj();
$level1->foo = 'level1';

$level2 = new MyObj();
$level2->foo = 'level2';
$level1->child = $level2;

$level3 = new MyObj();
$level3->foo = 'level3';
$level2->child = $level3;
$result = $serializer->normalize($level1, null, array(ObjectNormalizer::ENABLE_MAX_DEPTH => true));
/*      $result = array(
            'foo' => 'level1',
            'child' => array(
                    'foo' => 'level2',
                    'child' => array(
                            'child' => null,
                        ),
                ),
        );
*/
```

* [x] Metadata support
* [x] `@MaxDepth(2)` annotation and loader
* [x] XML loader
* [x] YAML loader
* [x] Delegate recursive normalization at the end of the process
* [x] Use constants with Late Static Binding in the abstract class instead of raw strings
* [x] Move common logic to the abstract class

/cc @mRoca @csarrazi

Commits
-------

a44bead [Serializer] Add a MaxDepth option
2016-01-26 13:18:18 +01:00
Kévin Dunglas
a44beade1e [Serializer] Add a MaxDepth option 2016-01-26 13:18:08 +01:00
Fabien Potencier
c5a78860f5 feature #17530 [Cache] Handle and log errors properly (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Handle and log errors properly

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

Best viewed ignoring white-spaces:
https://github.com/symfony/symfony/pull/17530/files?w=1

Commits
-------

d21fab0 [Cache] Handle and log errors properly
2016-01-26 08:03:55 +01:00
Nicolas Grekas
d21fab0d0b [Cache] Handle and log errors properly 2016-01-25 20:18:55 +01:00
Fabien Potencier
48d91a83b6 feature #17522 [Cache] Use generator in ArrayAdapter (gcds)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Use generator in ArrayAdapter

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

Commits
-------

367e784 [Cache] Use generator in ArrayAdapter
2016-01-25 15:53:15 +01:00
Aurimas Niekis
367e784f25 [Cache] Use generator in ArrayAdapter 2016-01-25 15:49:11 +01:00
Fabien Potencier
acfa9abfdc feature #16164 [Serializer] Add a data: URI normalizer (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #16164).

Discussion
----------

[Serializer] Add a data: URI normalizer

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

A new normalizer to transform `\SplFileInfo`, `\SplFileObject` and `\Symfony\Component\HttpFoundation\File\File` to [`data:` URI](https://en.wikipedia.org/wiki/Data_URI_scheme) and the opposite.

It's convenient when dealing with the JavaScript `FileReader` API.

Usage:

```php
$normalizer = new DataUriNormalizer();
echo $normalizer->normalize(new File(__DIR__.'/test.gif'));
// data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=

echo $normalizer->normalize(new File(__DIR__.'/test.txt'));
// data:text/plain,K%C3%A9vin%20Dunglas%0A

var_dump($normalizer->denormalize('data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=', 'SplFileObject');
// a SplFileObject (also supports HttpFoundation file if the composant is installed)
```
cc @clementtalleu

Commits
-------

cc7b5af [Serializer] Add a data: URI normalizer
2016-01-25 15:33:51 +01:00
Kévin Dunglas
cc7b5af170 [Serializer] Add a data: URI normalizer 2016-01-25 15:33:44 +01:00
Fabien Potencier
cda6cbafa3 feature #15279 Added {{ value }} message placeholder to UniqueEntityValidator (jperovic)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #15279).

Discussion
----------

Added {{ value }} message placeholder to UniqueEntityValidator

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

Apologize if I missed something. This is my first contribution to a large scale project.

Commits
-------

9cf1ce9 Added {{ value }} message placeholder to UniqueEntityValidator
2016-01-25 13:43:57 +01:00
Jovan Perovic
9cf1ce918d Added {{ value }} message placeholder to UniqueEntityValidator 2016-01-25 13:43:51 +01:00
Fabien Potencier
c650b8fa3e feature #16652 [console] Add truncate method to FormatterHelper (mheki)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #16652).

Discussion
----------

[console] Add truncate method to FormatterHelper

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

This PR adds a `truncate` method to `FormatterHelper`.
Message is truncated to the given length, then the suffix is appended to end of that string.
If the length is negative, number of letters to truncate is counted from the end of the message.
Suffix is always appended, unless truncate length is longer than message and suffix length.

Commits
-------

a16b1a0 [console] Add truncate method to FormatterHelper
2016-01-25 13:26:46 +01:00
Marek Pietrzak
a16b1a0228 [console] Add truncate method to FormatterHelper 2016-01-25 13:26:46 +01:00
Fabien Potencier
0d3bde8ae6 feature #17438 [Cache] Allow and use generators in AbstractAdapter (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Allow and use generators in AbstractAdapter

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

The most important enhancement is allowing doFetch to return a generator, which wasn't possible before.
The other changes add strictness.

Commits
-------

0ba851a [Cache] Allow and use generators in AbstractAdapter
2016-01-25 13:23:12 +01:00
Fabien Potencier
05dfbdbf40 minor #16635 [Security] add USERNAME_NONE_PROVIDED constant (SofHad)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #16635).

Discussion
----------

[Security] add USERNAME_NONE_PROVIDED constant

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

I think that is better if we use a constant to define this string.

Commits
-------

3f60598 [Security] add USERNAME_NONE_PROVIDED constant
2016-01-25 13:06:56 +01:00
SofHad
3f605982e1 [Security] add USERNAME_NONE_PROVIDED constant 2016-01-25 13:06:55 +01:00
Fabien Potencier
0974606d60 made some cleanup in tests 2016-01-25 12:33:17 +01:00
Fabien Potencier
0b2948f97a feature #17111 [HttpKernel] added a setter for the headers property in the HttpException (smatyas)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #17111).

Discussion
----------

[HttpKernel] added a setter for the headers property in the HttpException

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

Added this setter, because it's now impossible to use those handy, meaningful, already implemented exceptions (like NotFound...) if one wants to set some custom headers. This PR solves this problem.
It's a backward compatible solution in this way, but maybe it would be better if the `HttpExceptionInterface` would contain the `setHeaders` function as well. Of course this would be a BC break, that's why it is missing now.

TODO:
- [x] submit changes to the documentation

Commits
-------

6a1080f [HttpKernel] added a setter for the headers property in the HttpException
2016-01-25 12:19:01 +01:00
Mátyás Somfai
6a1080f899 [HttpKernel] added a setter for the headers property in the HttpException 2016-01-25 12:19:00 +01:00
Fabien Potencier
e9e4869c98 feature #17132 [DependencyInjection] Properly ignore invalid reference arguments in collection arguments (ogizanagi)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[DependencyInjection] Properly ignore invalid reference arguments in collection arguments

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

With this new feature, the following configuration:

```xml
<service id="baz" class="Baz"/>

<service id="foo" class="Foo">
    <argument type="collection">
        <argument type="service" id="bar" on-invalid="ignore" />
        <argument type="service" id="baz" />
        <argument type="service" id="moo" on-invalid="null" />
    </argument>

    <argument type="service" id="bar" on-invalid="ignore" />
    <argument type="service" id="baz" />
    <argument type="service" id="moo" on-invalid="null" />

    <call method="foo">
        <argument type="service" id="bar" on-invalid="ignore" />
    </call>
    <call method="fooCollection">
        <argument type="collection">
            <argument type="service" id="bar" on-invalid="ignore" />
            <argument type="service" id="baz" />
            <argument type="service" id="moo" on-invalid="null" />
        </argument>
    </call>
</service>
```

will result into the following `Definition`:

```php
Definition {#64 ▼
  -class: "Foo"
  // […]
  -calls: array:1 [▼
    0 => array:2 [▼
      0 => "fooCollection"
      1 => array:1 [▼
        0 => array:2 [▼
          0 => Reference {#59 ▼
            -id: "baz"
            -invalidBehavior: 1
          }
          1 => null
        ]
      ]
    ]
  ]
  // […]
  #arguments: array:4 [▼
    0 => array:2 [▼
      0 => Reference {#63 ▼
        -id: "baz"
        -invalidBehavior: 1
      }
      1 => null
    ]
    1 => null
    2 => Reference {#56 ▼
      -id: "baz"
      -invalidBehavior: 1
    }
    3 => null
  ]
}
```

Invalid references are ignored instead of replaced by `null` when they are part of a collection argument.
If the collection argument is part of a method call and contains an invalid reference, the method call is kept, but the invalid reference removed.

The behavior stays the same as before for non-collection arguments.

🎄

Commits
-------

cfc4879 [DependencyInjection] Properly ignore invalid reference arguments in collection arguments
2016-01-25 12:14:38 +01:00
Fabien Potencier
d55114ef34 feature #17427 [Process] Allow a callback whenever the output is disabled (romainneutron)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Process] Allow a callback whenever the output is disabled

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #17390
| License       | MIT

This was not allowed in the past. However, it's possible with these changes

Commits
-------

02f0fc7 [Process] Allow a callback whenever the output is disabled
2016-01-25 12:11:57 +01:00
Fabien Potencier
8c51a94e13 fixed CS 2016-01-25 10:20:12 +01:00
Fabien Potencier
8ecc322c56 feature #17327 Added support links to exception and toolbar (peterrehm)
This PR was squashed before being merged into the 3.1-dev branch (closes #17327).

Discussion
----------

Added support links to exception and toolbar

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

Exception Page:
<img width="1041" alt="bildschirmfoto 2016-01-10 um 17 33 09" src="https://cloud.githubusercontent.com/assets/2010989/12222567/528ed2f6-b7c0-11e5-9e48-d136a8ac0767.png">

Toolbar:
<img width="568" alt="bildschirmfoto 2016-01-10 um 17 35 09" src="https://cloud.githubusercontent.com/assets/2010989/12222582/a1bec0b6-b7c0-11e5-8bf8-325c0ed806c1.png">

I am not yet sure if the link at the top of the exception is visible enough.

Commits
-------

1d05157 Added support links to exception and toolbar
2016-01-25 10:19:49 +01:00
Peter Rehm
1d0515790b Added support links to exception and toolbar 2016-01-25 10:19:46 +01:00
Fabien Potencier
36c2961def feature #16909 Allows access to payload in callback validator (conradkleinespel)
This PR was merged into the 3.1-dev branch.

Discussion
----------

Allows access to payload in callback validator

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

Commits
-------

26cd91d allows access to payload in callback validator
2016-01-25 09:16:45 +01:00
Fabien Potencier
e23804e1e9 feature #17402 [Profiler] make it possible to omit the link var (xabbuh)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Profiler] make it possible to omit the link var

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

Currently, when you do not want to have a section in the web profiler,
you would have to explicitly pass `false` as value for the `link`
variable. With this change you can omit it when including the toolbar
item template.

Commits
-------

c430a47 [Profiler] make it possible to omit the link var
2016-01-25 08:44:31 +01:00
Kévin Dunglas
ed2cdfa827 feature #17411 [Serializer] Add a new DateTime normalizer (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Serializer] Add a new DateTime normalizer

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

This PR add support for dates and times to the Normalizer component. It supports all date and time formats supported by PHP. Dates and times are normalized in the RFC 3339 format by default. The output format can be customized using the `$context` parameter. The default format can be changed using a constructor parameter.

Usage:

```php
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Serializer;

$serializer = new Serializer(array(new DateTimeNormalizer()));

echo $serializer->normalize(new \DateTimeImmutable('2016/01/01'));
// 2016-01-01T00:00:00+00:00

echo $serializer->normalize(new \DateTime('2016/01/01'));
// 2016-01-01T00:00:00+00:00

echo $serializer->normalize(new \DateTime('2016/01/01'), null, array(DateTimeNormalizer::FORMAT_KEY => 'Y'))
// 2016

var_dump($serializer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeInterface::class));
// class DateTimeImmutable#1 (3) {
//   public $date =>
//   string(26) "2016-01-01 00:00:00.000000"
//   public $timezone_type =>
//   int(1)
//   public $timezone =>
//   string(6) "+00:00"
// }

var_dump($serializer->denormalize('2016-01-01T00:00:00+00:00', \DateTime::class));
// class DateTime#1 (3) {
//   public $date =>
//   string(26) "2016-01-01 00:00:00.000000"
//   public $timezone_type =>
//   int(1)
//   public $timezone =>
//   string(6) "+00:00"
// }
```

Commits
-------

6749a70 [Serializer] Add a new DateTime normalizer
2016-01-22 08:40:56 +01:00
Kévin Dunglas
6749a70326 [Serializer] Add a new DateTime normalizer 2016-01-22 08:14:37 +01:00
Fabien Potencier
ab951a44ba feature #17462 [Yaml] deprecate parsing the !!php/object tag (xabbuh)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Yaml] deprecate parsing the !!php/object tag

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

Commits
-------

3380346 [Yaml] deprecate parsing the !!php/object tag
f146c8d tag for dumped PHP objects must be a local one
2016-01-22 07:37:40 +01:00
Fabien Potencier
09f92ba516 Merge branch '3.0'
* 3.0:
  fixed CS
  fixed CS
  fixed CS
  fixed test
  fixed CS
  Remove default match from AbstractConfigCommand::findExtension
  Remove unused imports
  [FrameworkBundle][Validator] Fix apc cache service deprecation
2016-01-21 11:01:50 +01:00
Fabien Potencier
7a90d5cd4b minor #17473 fixed CS (fabpot)
This PR was merged into the 3.0 branch.

Discussion
----------

fixed CS

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

Commits
-------

e9143fd fixed CS
2016-01-21 11:01:39 +01:00
Fabien Potencier
e9143fd837 fixed CS 2016-01-21 10:55:31 +01:00
Fabien Potencier
2b1daa462f minor #17465 Remove unused imports (Koc)
This PR was merged into the 3.0 branch.

Discussion
----------

Remove unused imports

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

Commits
-------

b8028f6 Remove unused imports
2016-01-21 10:53:31 +01:00
Fabien Potencier
dba07f35c1 Merge branch '2.8' into 3.0
* 2.8:
  fixed CS
  fixed CS
  fixed test
  fixed CS
  Remove default match from AbstractConfigCommand::findExtension
  [FrameworkBundle][Validator] Fix apc cache service deprecation
2016-01-21 10:38:31 +01:00
Fabien Potencier
295f5ee626 minor #17472 fixed CS (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

fixed CS

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

Commits
-------

3aafa78 fixed CS
2016-01-21 10:35:25 +01:00
Fabien Potencier
3aafa78f4d fixed CS 2016-01-21 10:24:53 +01:00
Fabien Potencier
9188f0507d Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
  fixed test
  fixed CS
  Remove default match from AbstractConfigCommand::findExtension
2016-01-21 10:05:51 +01:00
Fabien Potencier
15c37c2442 minor #17471 fixed CS (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed CS

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

Commits
-------

06b958a fixed CS
2016-01-21 10:04:27 +01:00
Fabien Potencier
06b958a17e fixed CS 2016-01-21 09:40:25 +01:00
Fabien Potencier
9afd7e02e0 Merge branch '2.3' into 2.7
* 2.3:
  fixed test
2016-01-21 09:40:12 +01:00
Fabien Potencier
6eda9ad834 fixed test 2016-01-21 09:40:05 +01:00
Fabien Potencier
05afbb8fa8 minor #17469 [Form] Make tests compatible with master (paradajozsef)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Form] Make tests compatible with master

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

I wrote tests in this PR: #17406 which was compatible only with 2.7. @xabbuh fixed it in 2.8 and 3.0 here: #17463. And this PR fixes deprecated notices in master.

Kind of an unfortunate situation...

Commits
-------

96e40b2 Fix unit tests in master
2016-01-21 09:37:12 +01:00
Paráda József
96e40b22b2 Fix unit tests in master 2016-01-21 09:17:58 +01:00
Fabien Potencier
0c28d753e2 bug #16822 [FrameworkBundle][Validator] Fix apc cache service deprecation (ogizanagi)
This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle][Validator] Fix apc cache service deprecation

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

Related to #16795

I guess the deprecation was on the wrong service.
Also, no deprecation notice was triggered about using `"apc"` as the value of the `framework.validation.cache` configuration option. This PR adds the missing deprecation.

> 📝 _NOTE_: The standard edition will need to be updated [here](https://github.com/symfony/symfony-standard/blob/2.8/app/config/config_prod.yml#L6).

Commits
-------

907bbec [FrameworkBundle][Validator] Fix apc cache service deprecation
2016-01-21 08:28:13 +01:00
Fabien Potencier
ddc668d1cb Merge branch '2.3' into 2.7
* 2.3:
  fixed CS
2016-01-21 07:59:09 +01:00
Fabien Potencier
b81cac880e minor #17467 fixed CS (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

fixed CS

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

Commits
-------

42862c4 fixed CS
2016-01-21 07:57:24 +01:00
Fabien Potencier
64515b8049 Merge branch '3.0'
* 3.0:
  make tests compatible with Symfony 2.8 and 3.0
2016-01-21 07:33:52 +01:00
Fabien Potencier
78c8543d25 Merge branch '2.8' into 3.0
* 2.8:
  make tests compatible with Symfony 2.8 and 3.0
2016-01-21 07:33:42 +01:00
Fabien Potencier
9efa223132 bug #17463 [Form] make tests compatible with Symfony 2.8 and 3.0 (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] make tests compatible with Symfony 2.8 and 3.0

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

Commits
-------

4d2930e make tests compatible with Symfony 2.8 and 3.0
2016-01-21 07:33:04 +01:00
Fabien Potencier
42862c4668 fixed CS 2016-01-21 07:28:40 +01:00
Fabien Potencier
00c31922e2 bug #17456 [DX] Remove default match from AbstractConfigCommand::findExtension (kix)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #17456).

Discussion
----------

[DX] Remove default match from AbstractConfigCommand::findExtension

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

Previously, `findExtension` would return the first extension that might not even match the `$name` parameter, which would quite confuse the user:

```
$ app/console config:debug TotallyNonExistentBundle
# Current configuration for "TotallyNonExistentBundle"
knp_paginator:
    default_options:
        sort_field_name: sort
        sort_direction_name: direction
        filter_field_name: filterField
        filter_value_name: filterValue
        page_name: page
        distinct: true
    template:
        pagination: 'KnpPaginatorBundle:Pagination:sliding.html.twig'
        filtration: 'KnpPaginatorBundle:Pagination:filtration.html.twig'
        sortable: 'KnpPaginatorBundle:Pagination:sortable_link.html.twig'
    page_range: 5
```

Same problem goes for the `config:dump` command. When you dumped the config for a bundle you thought you've registered, but, for example, you'd use a name that's not exactly matching, you'd get confusing output for a different bundle's configuration.

The problem was, an `Extension` [was always fetched in the finder method](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php#L51), and name/alias misses were ignored.

Commits
-------

b85059a Remove default match from AbstractConfigCommand::findExtension
2016-01-21 07:10:38 +01:00