This PR was merged into the 2.6-dev branch.
Discussion
----------
[Serializer] Handle circular references
| Q | A
| ------------- | ---
| Bug fix? | Yes: avoid infinite loops. Allows to improve #5347
| New feature? | yes (circular reference handler)
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
| Doc PR | symfony/symfony-docs#4299
This PR adds handling of circular references in the `Serializer` component.
The number of allowed iterations is configurable (one by default).
The behavior when a circular reference is detected is configurable. By default an exception is thrown. Instead of throwing an exception, it's possible to register a custom handler (e.g.: a Doctrine Handler returning the object ID).
Usage:
```php
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
use Symfony\Component\Serializer\Serializer;
class MyObj
{
private $id = 1312;
public function getId()
{
return $this->getId();
}
public function getMe()
{
return $this;
}
}
$normalizer = new GetSetMethodNormalizer();
$normalizer->setCircularReferenceLimit(3);
$normalizer->setCircularReferenceHandler(function ($obj) {
return $obj->getId();
});
$serializer = new Serializer([$normalizer]);
$serializer->normalize(new MyObj());
```
Commits
-------
48491c4 [Serializer] Handle circular references
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Bridge][Doctrine][Form] Add entity manager instance support for em option
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10157
| License | MIT
| Doc PR | symfony/symfony-docs#4336
This PR allows to pass an explicit entity manager instance as em option.
Commits
-------
d84e3a8 [Bridge][Doctrine][Form] Add entity manager instance support for em option
This PR was merged into the 2.3 branch.
Discussion
----------
[FrameworkBundle] improve server:run feedback
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
In #12253, improved feedback was added to the `server:run` command
instructing the user how to terminate the built-in web server. This
is hereby backported to the `2.3` branch.
Commits
-------
264c37a [FrameworkBundle] improve server:run feedback
In #12253, improved feedback was added to the `server:run` command
instructing the user how to terminate the built-in web server. This
is hereby backported to the `2.3` branch.
This PR was merged into the 2.6-dev branch.
Discussion
----------
[FrameworkBundle] improve server commands feedback
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | kind of
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12153
| License | MIT
| Doc PR |
* display a message when `server:start` is executed and the PCNTL
extension is not loaded
* print instructions about how to terminate the `server:run` command
Commits
-------
bf174cf [FrameworkBundle] improve server commands feedback
* display a message when `server:start` is executed and the PCNTL
extension is not loaded
* print instructions about how to terminate the `server:run` command
This PR was merged into the 2.6-dev branch.
Discussion
----------
[VarDumper] enhance dumping refs
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | nicolas-grekas/Patchwork-Dumper#39
| License | MIT
| Doc PR | -
This makes dumps prettier:
- VarCloner now exposes the "isref" state of a PHP variable
- on hard refs, `#n` suffix is replaced by `&n` prefix
- `#n`/`@n` (object/resource refs) are moved inside the `{ }`
- all repetitive dumps of the same object are toggle-able
- all repetitive dumps of the same object / hard ref are *visually* identical
- dumps expose local ref counts and object's handle
I also simplified the `Cloner\DumperInterface`.
For the same (circumvoluted) variable:
Before:
![before](https://cloud.githubusercontent.com/assets/243674/4595026/f6b2a98c-5094-11e4-9fe0-dc6d24da3f14.png)
After:
![after](https://cloud.githubusercontent.com/assets/243674/4595035/07e04980-5095-11e4-9e45-54a1e7453547.png)
Commits
-------
3c401af [VarDumper] enhance dumping refs
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11696).
Discussion
----------
[Form] Fix#11694 - Enforce options value type check in some form types
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11694
| License | MIT
| Doc PR | none
`Symfony\Component\Form\Extension\Core\Type\RepeatedType` allowed passing strings as options, which caused problems as in #11694.
Commits
-------
0af6467 [Form] Fix#11694 - Enforce options value type check in some form types
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#12183).
Discussion
----------
[Router] Cleanup
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Removed unused imports, variables, arguments.
Commits
-------
5a6677d [Router] Cleanup
This PR was merged into the 2.3 branch.
Discussion
----------
Add missing argument
`->dump` has 5 arguments (the 3th argument, the indent, was not provided in the twig extension).
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | let's see
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
ac696b8 Add missing argument
This PR was squashed before being merged into the 2.6-dev branch (closes#12191).
Discussion
----------
[Security] More accurate docblocks for AbstractVoter
| Q | A
| ------------- | ---
| Fixed tickets | none
| License | MIT
Two fixes for docblocks in AbstractVoter:
1. Previously the example return value for a few methods used PHP's short array syntax (>= PHP 5.4). Symfony minimum PHP is 5.3 so the docblock examples should be compatible with that.
2. Previously getSupportedClasses() docblock had an example return value showing a FQCN using a leading slash. AbstractVoter looks for `get_class($object)` in the array of getSupportedClasses() returned values, and `get_class()` returns the FQCN without a leading slash.
Commits
-------
ed226ec [Security] More accurate docblocks for AbstractVoter
This PR was merged into the 2.3 branch.
Discussion
----------
[TwigBundle] do not pass a template reference to twig
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
twig does not know about template references and only expects a string.
this commit also fixes that name parsing and locating was called twice for nonexistent templates.
Commits
-------
7fe33e3 [TwigBundle] do not pass a template reference to twig
This PR was merged into the 2.3 branch.
Discussion
----------
[TwigBundle] show correct fallback exception template in debug mode
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
In debug mode, the exception controller did not show the correct template in case the format is unknown.
It falls back to html but the logic for `exception_full` was not applied there. So it was just returning the partial html.
Commits
-------
b97acd9 [TwigBundle] show correct fallback exception template in debug mode
twig does not know about template references and only expects a string.
this commit also fixes that name parsing and locating was called twice for nonexistent templates
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Routing] unify RequestContext as fluent class
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | partly
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
- [x] <del>some methods were tagged with `@api` which makes no sense since the class is already tagged as stable. this automatically includes all methods. also our bc promise is only about `@api` on classes</del>
- [x] setParameters the only fluent method! I made them all fluent which makes sense for this class
Commits
-------
41412f9 [Routing] unify fluent interface in RequestContext
This PR was merged into the 2.3 branch.
Discussion
----------
use meta charset in layouts without legacy http-equiv
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
`<meta charset="UTF-8" />` is now the recommended approach
Commits
-------
96e7b01 use meta charset in layouts without legacy http-equiv
* 2.5:
[Routing] add tests for RequestContext
[Routing] fix inconsistencies in RequestContext
don't raise warnings when exception is thrown
[Framework][DX] Set the proper validator class according to the configured api version
This PR was merged into the 2.3 branch.
Discussion
----------
[Routing] fix type inconsistencies in RequestContext
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fixed inconsistencies in RequestContext:
- [x] port setters and getters inconsistent with constructor (string vs int)
- [x] host should be lowercased for easier case-insensitivity, see #9072
- [x] fix setQueryString with null
- [x] fix return phpdoc typehint
Commits
-------
676c4a0 [Routing] add tests for RequestContext
f61607f [Routing] fix inconsistencies in RequestContext
This PR was merged into the 2.3 branch.
Discussion
----------
[CssSelector] don't raise warnings when exception is thrown
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11947
| License | MIT
| Doc PR |
`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.
Commits
-------
38e9623 don't raise warnings when exception is thrown
`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.
This PR was merged into the 2.6-dev branch.
Discussion
----------
[FrameworkBundle] add changelog entry for web server commands
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I just noticed that I forgot to add a changelog entry in #11311.
Commits
-------
292088f add changelog entry for web server commands