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
This PR was squashed before being merged into the 2.6-dev branch (closes#12180).
Discussion
----------
Prevent an empty choice list being passed in debug:container
Hi guys!
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | --
| License | MIT
| Doc PR | n/a
Currently, there is a "bug" where if you pass an empty array to ChoiceList, then you get this following warning from `QuestionHelper::doAsk()`:
>
Warning: max(): Array must contain at least one element
That should probably be fixed too, but it would go on an earlier version, so I didn't want to mix fixes for different branches.
Thanks!
Commits
-------
ef23b63 Prevent an empty choice list being passed in debug:container
This PR was merged into the 2.6-dev branch.
Discussion
----------
[HttpKernel] properly handle exceptions in translator listener
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The `setLocale()` method can throw an `\InvalidArgumentException` when
an invalid locale has been passed. These exceptions must be handled by
the `TranslatorListener` which should then pass the request's default
locale instead.
Commits
-------
d3a0a55 properly handle exceptions in translator listener
This PR was merged into the 2.6-dev branch.
Discussion
----------
[FrameworkBundle] register `TranslatorListener` service
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12167
| License | MIT
| Doc PR |
Since the `TranslatorListener` was not registered as a service, the
proper locale would never have been passed from the current request
to the translator.
Commits
-------
3b578a6 register `TranslatorListener` service
Since the `TranslatorListener` was not registered as a service, the
proper locale would never have been passed from the current request
to the translator.
The `setLocale()` method can throw an `\InvalidArgumentException` when
an invalid locale has been passed. These exceptions must be handled by
the `TranslatorListener` which should then pass the request's default
locale instead.
This PR was submitted for the 2.5 branch but it was merged into the 2.6-dev branch instead (closes#12108).
Discussion
----------
[Routing] Moving include instruction to separate method
| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | #12106
| License | MIT
Commits
-------
60ce31d [Routing] Moving include instruction to separate method
[HttpFoundation] fixed the docs so that it gives some explanation about how you are vulnerable to CSRF when you enable the httpMethodeParameterOverride
This PR was merged into the 2.6-dev branch.
Discussion
----------
[VarDumper] Sfdump JS ns and VarCloner replacing Ext+PhpCloner
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12140
| License | MIT
| Doc PR | -
As VarDumper is independant of the WDT, this patch creates a new JavaScript namespace used for HTML dumps.
Commits
-------
da96ad8 [VarDumper] Sfdump JS ns and VarCloner replacing Ext+PhpCloner
This PR was squashed before being merged into the 2.6-dev branch (closes#12146).
Discussion
----------
[HttpFoundation] Fix PdoSessionHandler to work properly with streams
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Ref: https://github.com/symfony/symfony/pull/10931#discussion_r18387931
Commits
-------
9531a2b [HttpFoundation] Fix PdoSessionHandler to work properly with streams
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Framework+SecurityBundle] remove recently introduced *.class parameters
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This is just a cleanup that removes `*.class` parameters introduced in the master branch (and not in the 2.5 one).
#12145 also removes the remaining params for the Debug/TwigBundle
Commits
-------
56ae544 [Framework+SecurityBundle] remove recently introduced *.class parameters
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes#12151).
Discussion
----------
[Framework][DX] Set the proper validator class according to the configured api version
| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | -
| License | MIT
| Doc PR | -
With this change the proper validator class will be dumped and therefore used for code completion in IDE's like PhpStorm which rely on the dumped container.
If you have 2.4 or 2.5-bc API the class will be
Symfony\Component\Validator\ValidatorInterface
If you use the 2.5 API the class will be
Symfony\Component\Validator\Validator\ValidatorInterface
I consider this also as important for the developer experience since a wrong type hint can easily cause issues since the method signatures of the validate() method have changed.
From
````php
public function validate($value, $groups = null, $traverse = false, $deep = false);
````
To
````php
public function validate($value, $constraints = null, $groups = null);
````
So if you want to validate specific groups you now have to pass them as the third argument instead of the second.
Commits
-------
eb3dd0f [Framework][DX] Set the proper validator class according to the configured api version
This PR was squashed before being merged into the 2.6-dev branch (closes#12142).
Discussion
----------
[TwigBridge] fix `DumpExtension` tests
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Make test compatible with the changes from #12125.
Commits
-------
e3332ad [TwigBridge] fix tests
This PR was squashed before being merged into the 2.6-dev branch (closes#11976).
Discussion
----------
[Yaml] Ensure whole number floats have their data type is persisted.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | Yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | no
See http://yaml.org/spec/1.1/#id858936 specifically the spec about specific data types.
Sample code that exposes the issue:
```php
$yaml = new \Symfony\Component\Yaml\Yaml();
$expected = array('float' => (float) 1);
$test = $yaml->parse($yaml->dump($expected));
if ($expected === $test) {
print "match!\n";
}
else {
var_dump($test);
}
```
This will output
```
array(1) {
'float' =>
int(1)
}
```
Commits
-------
6a507cc [Yaml] Ensure whole number floats have their data type is persisted.
This PR was merged into the 2.6-dev branch.
Discussion
----------
[VarDumper] Dynamic HTML dumper
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12109
| License | MIT
| Doc PR | -
This PR partially reverts #12109 because it didn't take into account that many dumps can share a single style tag.
More importantly, this PR enhance dump rendering with some cute JS navigation effects:
- references highlighting on hovering
- moving references toggling
Here is a screenshot (note the yellow background and the fact that `#2` appears after the first `@2`):
![capture du 2014-10-04 09 45 44](https://cloud.githubusercontent.com/assets/243674/4514936/4431c67e-4b9b-11e4-9809-8d06836be824.png)
Commits
-------
b799844 [VarDumper] Dynamic HTML dumper