* 5.2:
Bump Symfony version to 5.2.8
Update VERSION for 5.2.7
Update CHANGELOG for 5.2.7
Bump Symfony version to 4.4.23
Update VERSION for 4.4.22
Update CONTRIBUTORS for 4.4.22
Update CHANGELOG for 4.4.22
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Add missing French translations for logging throttling
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40863 (at least for French)
| License | MIT
| Doc PR | N/A
Note: this PR replaces #40889 as somehow force-push closed the other PR.
Also this one targets 4.4 branch directly :)
Commits
-------
b64efd2848 [Security] Add missing French translations for logging throttling
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle][HttpKernel] Move IDE file link formats from FrameworkExtension to FileLinkFormatter
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40901
| License | MIT
| Doc PR | N/A
I made `FileLinkFormatter` aware of IDEs file link formats so that you can set `framework.ide` as an env var containing a name (like `atom`).
Not sure how to test it from the `FrameworkExtension` POV though 🤔
Commits
-------
42a27b2770 Move IDE file link formats from FrameworkExtension to FileLinkFormatter
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[Routing] allow extending Route attribute
| Q | A
| ------------- | ---
| Branch? | 5.x <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | <!-- required for new features -->
There is probably missed `\ReflectionAttribute::IS_INSTANCEOF` parameter and because of that Route attribute class could not be extended. This could be used by some popular bundles like `FOSRestBundle` for example. Right
now it's not possible to add attributes support there like it was before (extending Route Annotation).
Commits
-------
d733b78f88 [Routing] allow extending Route attribute
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Config ]Remove log message when no configuration is found in ConfigBuilder
| Q | A
| ------------- | ---
| Branch? | 5.x for features / 4.4 or 5.2 for bug fixes <!-- see below -->
| Bug fix? | -
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch 5.x.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
I think when a bundle has no configuration we should also not log an warning.
Commits
-------
20c03b5c87 Remove log message when not configuration is found
This PR was merged into the 5.2 branch.
Discussion
----------
run tests against doctrine/persistence 2.2 again
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
9159fd317d run tests against doctrine/persistence 2.2 again
This PR was merged into the 5.3-dev branch.
Discussion
----------
[OptionsResolver] Add prototype definition support for nested options
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#34207
| License | MIT
| Doc PR | symfony/symfony-docs#...
This proposal adds a new method `setPrototype(true)` to the `OptionsResolver` component to mark options definition as array prototype:
```php
$this->resolver
->setDefault('connections', static function (OptionsResolver $resolver) { // nested option
$resolver
->setPrototype(true) // <- the new method
->setRequired('table')
->setDefaults(['user' => 'root', 'password' => null]);
})
;
```
This feature will allow passing options this way:
```php
$this->resolver->resolve([
'connections' => [
'default' => [ // <- the array index "default" is optional and validation free
'table' => 'default',
],
'custom' => [
'user' => 'foo',
'password' => 'pa$$',
'table' => 'symfony',
],
],
])
```
You can add as many items as you want with the advantage of validating each item according to its prototype definition.
The result for this example would be:
```php
[
'connections' => [
'default' => [
'user' => 'root',
'password' => null,
'table' => 'default',
],
'custom' => [
'user' => 'foo',
'password' => 'pa$$',
'table' => 'symfony',
],
],
]
```
This feature is feasible only for nested options so far and the nested option (e.g. "connections") must be of type array of array.
See the test cases for more details about this feature.
Cheers!
Commits
-------
29d41b1970 Add prototype definition support for nested options
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle] Use more explicite wording for debug:container command
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I spent too much time debugging something stupid (in my app) and I do think Symfony could do better to help.
In the application, there was:
```yaml
services:
_defaults:
autoconfigure: true
get_set_method_normalizer:
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
tags:
- { name: serializer.normalizer }
```
And I had to edit the priority. To ensure everything was right, I ran:
```
Symfony Container Services Tagged with "serializer.normalizer" Tag
==================================================================
------------------------------------------------------------ ---------- ---------------------------------------------------------------------------
Service ID priority Class name
------------------------------------------------------------ ---------- ---------------------------------------------------------------------------
Symfony\Component\Serializer\Normalizer\DateTimeNormalizer 1 Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
App\Serializer\Normalizer\JsonApiItemNormalizer App\Serializer\Normalizer\JsonApiItemNormalizer
get_set_method_normalizer Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
" -900
serializer.normalizer.constraint_violation_list -915 Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer
serializer.normalizer.datetimezone -915 Symfony\Component\Serializer\Normalizer\DateTimeZoneNormalizer
serializer.normalizer.dateinterval -915 Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer
serializer.normalizer.data_uri -920 Symfony\Component\Serializer\Normalizer\DataUriNormalizer
serializer.normalizer.datetime -910 Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
serializer.normalizer.json_serializable -900 Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
serializer.normalizer.problem -890 Symfony\Component\Serializer\Normalizer\ProblemNormalizer
serializer.normalizer.object -1000 Symfony\Component\Serializer\Normalizer\ObjectNormalizer
serializer.denormalizer.array -990 Symfony\Component\Serializer\Normalizer\ArrayDenormalizer
fos_rest.serializer.form_error_normalizer -10 FOS\RestBundle\Serializer\Normalizer\FormErrorNormalizer
fos_rest.serializer.exception_normalizer.symfony -10 FOS\RestBundle\Serializer\Normalizer\ExceptionNormalizer
fos_rest.serializer.flatten_exception_normalizer -10 FOS\RestBundle\Serializer\Normalizer\FlattenExceptionNormalizer
------------------------------------------------------------ ---------- ---------------------------------------------------------------------------
```
Please, focus on the `get_set_method_normalizer` line and the `" -900` line.
To me, it's understandable. I first thought it's a bug in Symfony. But it is not.
The bug is in my application. since the service have `autoconfigure` + an explicit tag it has finally 2 tags.
And the command was not really helpful
* the usage of `"` instead of a clear message is highly misleading.
* the fact Symfony registers the tag (`autoconfigure`) without a `priority` (nothing is displayed in the console) does not help either. BTW, we might registry tag with an explicit priority (0) instead of nothing. WDYT? I could do another PR for that.
So with this patch, I hope it'll be clearer:
```
root /app php bin/console debug:container --tag=serializer.normalizer
Symfony Container Services Tagged with "serializer.normalizer" Tag
==================================================================
------------------------------------------------------------ ---------- ---------------------------------------------------------------------------
Service ID priority Class name
------------------------------------------------------------ ---------- ---------------------------------------------------------------------------
Symfony\Component\Serializer\Normalizer\DateTimeNormalizer 1 Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
App\Serializer\Normalizer\JsonApiItemNormalizer App\Serializer\Normalizer\JsonApiItemNormalizer
get_set_method_normalizer Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
(same service as previous, another tag) -900
serializer.normalizer.constraint_violation_list -915 Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer
serializer.normalizer.datetimezone -915 Symfony\Component\Serializer\Normalizer\DateTimeZoneNormalizer
serializer.normalizer.dateinterval -915 Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer
serializer.normalizer.data_uri -920 Symfony\Component\Serializer\Normalizer\DataUriNormalizer
serializer.normalizer.datetime -910 Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
serializer.normalizer.json_serializable -900 Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
serializer.normalizer.problem -890 Symfony\Component\Serializer\Normalizer\ProblemNormalizer
serializer.normalizer.object -1000 Symfony\Component\Serializer\Normalizer\ObjectNormalizer
serializer.denormalizer.array -990 Symfony\Component\Serializer\Normalizer\ArrayDenormalizer
fos_rest.serializer.form_error_normalizer -10 FOS\RestBundle\Serializer\Normalizer\FormErrorNormalizer
fos_rest.serializer.exception_normalizer.symfony -10 FOS\RestBundle\Serializer\Normalizer\ExceptionNormalizer
fos_rest.serializer.flatten_exception_normalizer -10 FOS\RestBundle\Serializer\Normalizer\FlattenExceptionNormalizer
------
```
Commits
-------
3abebb16de [FrameworkBundle] Use more explicite wording for debug:container command
This PR was merged into the 5.2 branch.
Discussion
----------
[Security] Do not try to rehash null-passwords
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#41005
| License | MIT
| Doc PR | -
Make sure no exception occurs when a passwordless user logs in.
Commits
-------
a2a944e668 [Security] Do not try to rehash null-passwords
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Console] Remove spaces between arguments GithubActionReporter
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no (there is not release yet)
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
There shouldn't be blank spaces between the arguments of the `GithubActionReporter`, otherwise it shows the message in the wrong line, it can be seen here: https://github.com/franmomu/test_yaml_lint/pull/3/files
Both messages are supposed to be for line 3, but the warning one (with blank spaces) appears on line 1 (Check warning on line 1 in wrong_yaml.yaml).
Commits
-------
bd638a0fd8 Remove spaces between arguments
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Small phpdoc improvement
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I have been looking for a way to emulate `$_REQUEST` in Symfony, and I always thought the `get` method is useless for that, because it only looks at some custom routing stuff, GET and whatever BODY might be. Only today I actually looked at the source code and found out that it's actually (almost) doing what I was looking for, i.e. check `$_GET`, and then `$_POST`. So I figured it would be good to be a bit more explicit in the phpdoc (analoguous to the phpdoc for `$request->request`, which says "Request body parameters ($_POST).").
Commits
-------
a53f256b4b Small phpdoc imporvement
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
This limitation of bcrypt creates a risk for migrations. But we can remove it, so here we are.
Commits
-------
a5d3b89472 [PasswordHasher] accept hashing passwords with nul bytes or longer than 72 bytes when using bcrypt
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] [Security/Core] fix checking for bcrypt
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Spotted while working on #40920
Because of the logic in the constructor, if bcrypt is used, it's not cast to string.
Commits
-------
f01ea99254 [Security/Core] fix checking for bcrypt
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle] Make debug:event-dispatcher search case insensitive
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I was playing with the new features of `debug:event-dispatcher` and I thought that making the new search feature case insensitive could be better:
### Before
```
$ php bin/console debug:event-dispatcher mailer
[WARNING] The event "mailer" does not have any registered listeners.
```
### After
```
$ php bin/console debug:event-dispatcher mailer
Registered Listeners of Event Dispatcher "debug.event_dispatcher" for "Symfony\Component\Mailer\Event\MessageEvent" Event
=========================================================================================================================
------- --------------------------------------------------------------------------- ----------
Order Callable Priority
------- --------------------------------------------------------------------------- ----------
#1 Symfony\Component\Mailer\EventListener\MessageListener::onMessage() 0
#2 Symfony\Component\Mailer\EventListener\EnvelopeListener::onMessage() -255
#3 Symfony\Component\Mailer\EventListener\MessageLoggerListener::onMessage() -255
------- --------------------------------------------------------------------------- ----------
```
Commits
-------
1e4c7d9c5d [FrameworkBundle] Make debug:event-dispatcher search case insensitive