Commit Graph

24597 Commits

Author SHA1 Message Date
Fabien Potencier
8f3c06bb14 minor #17583 Introduce 3.1 and 4.0 upgrade files (xabbuh)
This PR was merged into the 3.1-dev branch.

Discussion
----------

Introduce 3.1 and 4.0 upgrade files

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

Commits
-------

f68e94a introduce 3.1 and 4.0 upgrade files
2016-01-29 09:15:08 +01:00
Christian Flothmann
f68e94a8cf introduce 3.1 and 4.0 upgrade files 2016-01-28 11:23:27 +01:00
Fabien Potencier
5b5970364e minor #17564 [Serializer] Use ::class in new tests (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Serializer] Use ::class in new tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/17446#discussion_r50965366
| License       | MIT
| Doc PR        | n/a

Commits
-------

48e8041 [Serializer] Use ::class in new tests
2016-01-27 16:30:34 +01:00
Fabien Potencier
7a965781b0 minor #17570 Change few occurences of a public setUp() method to protected (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

Change few occurences of a public setUp() method to protected

| 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

A new rule for fabbot.io 😊?

Commits
-------

31696b7 Change few occurences of a public setUp() method to protected
2016-01-27 16:25:00 +01:00
Kévin Dunglas
31696b7e98 Change few occurences of a public setUp() method to protected 2016-01-27 13:43:54 +01:00
Kévin Dunglas
48e8041611 [Serializer] Use ::class in new tests 2016-01-27 12:24:42 +01:00
Fabien Potencier
4f26a2e6e5 feature #14288 [Console] Add getters for Application::$autoExit and $catchExceptions (VasekPurchart)
This PR was submitted for the 2.7 branch but it was merged into the 3.1-dev branch instead (closes #14288).

Discussion
----------

[Console] Add getters for Application::$autoExit and $catchExceptions

There is currently no way to retrieve this information from Application (afaik) and since this can be set from outside (and is even part of the `@api`) it should be retrievable.

This might come handy for example when working with an Application instance inside your code - for example when creating a Console exception listener - then you need information about how the application was run.

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

Commits
-------

5d191d3 [Console] Add getters for Application:: and
2016-01-27 12:22:59 +01:00
Vasek Purchart
5d191d3cba [Console] Add getters for Application:: and 2016-01-27 12:22:49 +01:00
Fabien Potencier
26ad4ff93a feature #17504 [Console] Show code when an exception is thrown (maidmaid)
This PR was squashed before being merged into the 3.1-dev branch (closes #17504).

Discussion
----------

[Console] Show code when an exception is thrown

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

Hi !

When an exception is thrown, sf console doesn't show the code exception, while this code is very useful during developpement (for example, [guzzle put http status code in his code exception](https://github.com/guzzle/guzzle/blob/6.1.1/src/Exception/RequestException.php#L30-L33)).

I propose you that we show the code exception only when the code exception > 0 and with ``-v`` verbosity. It means :

- ``throw new Exception('Not found', 0)`` with normal verbosity --> no change
- ``throw new Exception('Not found', 0)`` with ``-v`` verbosity --> no change
- ``throw new Exception('Not found', 404)`` with normal verbosity --> no change
- **but** ``throw new Exception('Not found', 404)`` with ``-v`` verbosity --> showing :

![image](https://cloud.githubusercontent.com/assets/4578773/12530638/052991f2-c1e5-11e5-92f1-b7b3f60cc4ba.png)

Commits
-------

f8cd9e8 [Console] Show code when an exception is thrown
2016-01-27 05:55:20 +01:00
Dany Maillard
f8cd9e8263 [Console] Show code when an exception is thrown 2016-01-27 05:55:18 +01:00
Fabien Potencier
1525cce831 feature #17540 [WebProfilerBundle] Add HTTP return code in the Ajax request list table (kucharovic)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #17540).

Discussion
----------

[WebProfilerBundle] Add HTTP return code in the Ajax request list table

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

Commits
-------

9192e1b [WebProfilerBundle] Add HTTP return code in the Ajax request list table
2016-01-27 05:51:46 +01:00
Jakub Kucharovic
9192e1b34f [WebProfilerBundle] Add HTTP return code in the Ajax request list table 2016-01-27 05:51:46 +01:00
Fabien Potencier
cb16bffb28 feature #17446 [Serializer] Add PSR-6 adapter (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17446).

Discussion
----------

[Serializer] Add PSR-6 adapter

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

- [x] Add tests

Commits
-------

4bf9d05 [Serializer] Add PSR-6 adapter
2016-01-27 05:42:02 +01:00
Kévin Dunglas
4bf9d05237 [Serializer] Add PSR-6 adapter 2016-01-27 05:42:01 +01:00
Fabien Potencier
127538ef26 feature #16917 [PropertyInfo] Cache support (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #16917).

Discussion
----------

[PropertyInfo] Cache support

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

Replace #16893 with several advantages:

- Less complex patch
- Work for all usages of PropertyInfo (even outside of the Serializer)
- Avoid a circular reference between Serializer's CallMetadataFactory and PropertyInfo's SerializerExtractor
- Allow @mihai-stancu's #16143 to work as-is

Commits
-------

86c20df [PropertyInfo] Cache support
2016-01-27 05:40:32 +01:00
Kévin Dunglas
86c20df53c [PropertyInfo] Cache support 2016-01-27 05:40:30 +01:00
Fabien Potencier
712eeed5bb minor #17549 [Validator] Minor fixes for the PSR-6 adapter (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Validator] Minor fixes for the PSR-6 adapter

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

Follows #17440. Take into account comments of @Tobion.

Commits
-------

aa60d5b [Validator] Minor fixes for the PSR-6 adapter
2016-01-27 05:36:25 +01:00
Fabien Potencier
52384fb85e minor #17550 [Validator] PSR-6 cache: Avoid name collision (dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Validator] PSR-6 cache: Avoid name collision

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

See tests.

Commits
-------

12852c2 [Validator] PSR-6 cache: Avoid name collision
2016-01-27 05:34:32 +01:00
Kévin Dunglas
12852c2aea [Validator] PSR-6 cache: Avoid name collision 2016-01-26 20:26:38 +01:00
Kévin Dunglas
aa60d5be20 [Validator] Minor fixes for the PSR-6 adapter 2016-01-26 19:13:14 +01:00
Fabien Potencier
f1cdc6fd26 feature #17532 [Asset] Version as service (ewgRa)
This PR was squashed before being merged into the 3.1-dev branch (closes #17532).

Discussion
----------

[Asset] Version as service

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

While I working on #14832 I realize that all this problems and hidden magic can be avoided, if we will have ability to set asset version strategy as service.

This PR implementation of this idea.

Now it is possible to do something like this:

```yaml
framework:
    assets:
        version_strategy: assets.custom_version_strategy
        base_urls: http://cdn.example.com
        packages:
            foo:
                base_urls: ["https://example.com"]
                version_strategy: assets.custom_version_strategy
```

There is can be some conflicts with #16511 when it will be in master

Commits
-------

52d116b [Asset] Version as service
2016-01-26 13:34:43 +01:00
Evgeniy Sokolov
52d116bee5 [Asset] Version as service 2016-01-26 13:34:42 +01:00
Fabien Potencier
37f526467e feature #17440 [Validator] Add a PSR-6 adapter (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17440).

Discussion
----------

[Validator] Add a PSR-6 adapter

| 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

Commits
-------

1f0ba00 [Validator] Add a PSR-6 adapter
2016-01-26 13:31:07 +01:00
Kévin Dunglas
1f0ba00109 [Validator] Add a PSR-6 adapter 2016-01-26 13:31:05 +01:00
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