8000 [FrameworkBundle] Deprecate not setting some options (uid, validation) by Jean-Beru · Pull Request #51357 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Deprecate not setting some options (uid, validation) #51357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign 8000 up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Jean-Beru
Copy link
Contributor
@Jean-Beru Jean-Beru commented Aug 11, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? yes
Tickets Fix #51097
License MIT
Doc PR

This PR deprecates not setting 4 options in framework configuration to match the v7.0 recipe:

  • uid.default_uuid_version which is 6 by default and is set to 7 by recipe
  • uid.time_based_uuid_version which is 6 by default and is set to 7 by recipe
  • validation.email_validation_mode which is null by default and is set to html5 by recipe

See #51097.

->validate()
->always(function (array $v): array {
if (empty($v['password_hashers'])) {
trigger_deprecation('symfony/framework-bundle', '6.4', 'Not setting the "security.password_hashers" config option is deprecated. It will default to "Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: auto" in 7.0.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this deprecation. Default values for a prototyped array node are not merged with provided config. So as soon as any config file (or config prepended by a bundle) adds some other config for password hashers, the config for PasswordAuthenticatedUserInterface would be lost.

I'd suggest keeping that one in the recipe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They would be merged if we didn't call performNoDeepMerging, isn't it?
Why don't we perform deep merging BTW?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, let's drop this, it's not needed to deprecate not setting this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 a5cfc22 "some bug fixes in DIC config classes"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolas-grekas no. deep merging is about the various configs received as input, not the defaults

@nicolas-grekas nicolas-grekas force-pushed the framework-bundle/deprecate-not-setting-router-uid-validator branch 2 times, most recently from d1c71de to ab2faa1 Compare August 14, 2023 09:50
@nicolas-grekas nicolas-grekas changed the title [FrameworkBundle] Deprecate not setting some options (uid, validator, security) [FrameworkBundle] Deprecate not setting some options (uid, validation) Aug 14, 2023
nicolas-grekas
nicolas-grekas previously approved these changes Aug 14, 2023
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed @stof's review.

@nicolas-grekas nicolas-grekas dismissed their stale review August 14, 2023 09:55

There are remaning deprecations, please fix them.

@nicolas-grekas nicolas-grekas force-pushed the framework-bundle/deprecate-not-setting-router-uid-validator branch from ab2faa1 to 878cda2 Compare August 17, 2023 16:04
nicolas-grekas and others added 3 commits August 17, 2023 18:09
…tions (Jean-Beru)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] Deprecate not setting some options

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix symfony#51097
| License       | MIT
| Doc PR        |

This PR deprecates not setting 5 options in framework configuration to match the v7.0 recipe:
* `handle_all_throwables` which is `false` by default and is set to `true` by recipe
* `php_errors.log` which use `$debug` value by default and is set to `true` by recipe
* `session.cookie_secure` (if session is enabled) which is `null` by default and is set to `auto` by recipe
* `session.cookie_samesite` (if session is enabled) which is `null` by default and is set to `lax` by recipe
* `session.handler_id` (if session is enabled) which is `session.handler.native_file` by default and is set to `null` by recipe (could be `session.handler.native_file` if `framework.session.save_path` is set)

See symfony#51097.

Commits
-------

7f9998e [FrameworkBundle] Deprecate not setting some options
@nicolas-grekas nicolas-grekas force-pushed the framework-bundle/deprecate-not-setting-router-uid-validator branch from 878cda2 to aa3fbc5 Compare August 17, 2023 16:15
@nicolas-grekas
Copy link
Member

Thank you @Jean-Beru.

nicolas-grekas added a commit that referenced this pull request Aug 23, 2023
…daubois)

This PR was merged into the 7.0 branch.

Discussion
----------

[FrameworkBundle] Remove config deprecations

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | -
| License       | MIT
| Doc PR        | Todo

Follow-up of:
- #51325
- #51357

Commits
-------

4fe6f5b [FrameworkBundle] Remove config deprecations
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Shrink recipes for v7
5 participants
0