-
-
Notifications
You must be signed in to change notification settings - Fork 424
[make:user] Legacy <= 5.3 & Doctrine Cleanup #1107
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 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
3d38390
to
ddc814e
Compare
@@ -28,7 +28,7 @@ | |||
"require-dev": { | |||
"composer/semver": "^3.0", | |||
"doctrine/doctrine-bundle": "^2.4", | |||
"doctrine/orm": "^2.3", | |||
"doctrine/orm": "^2.10.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially controversial.. need to double check dependency dependencies to ensure this is possible... Reasoning being the bump to 10 / conflict w/ <2.9 is primarily related to the new exception classes introduced in 2.10 that will become interfaces in 3.0..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial thought is: it's ok. ORM 2.10 was released Oct 3rd, 2021. Maker now requires Symfony 5.4, which was released at the end of November 2021. So, if you have 5.4, you've been upgrading already. And bumping to 2.10 is a minor release bump.
230942e
to
c095088
Compare
if ('password_hashers' === $keyName && isset($newData['security']['encoders'])) { | ||
// fallback to "encoders" if the user already defined encoder config | ||
$this->updatePasswordHashers($userConfig, $userClass, 'encoders'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re for situations where a user still has security.encoders
set - we could do any of:
A) Throw an exception e.g. "MakerBundle does not support password encoders.."
B) Remove the existing security.encoders
and continue with setting security.password_hashers
The problem with the latter is we dont have a way to tell the user that we're removing the existing encoders.. I suppose we could start linking make:user
's IO to SecurityConfigUpdater
or something to make this "async" but that just feels like a headache w/ not alot of gain.
If we just throw an exception, what action do we tell the user to take to correct the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If encoders
is set, let's throw a clear exception that explains to change to password_hashers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like a plan
57fb893
to
bce7788
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very complex, nice work! Minor comments
src/DependencyInjection/CompilerPass/SetDoctrineManagerRegistryClassPass.php
Outdated
Show resolved
Hide resolved
if ('password_hashers' === $keyName && isset($newData['security']['encoders'])) { | ||
// fallback to "encoders" if the user already defined encoder config | ||
$this->updatePasswordHashers($userConfig, $userClass, 'encoders'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If encoders
is set, let's throw a clear exception that explains to change to password_hashers
.
bce7788
to
616806d
Compare
004a131
to
e0c5f2b
Compare
HUGE work - thanks Jesse! |
TemplateComponentGenerator::generateUseStatements()
can now handle use statements with aliases.Add
doctrine/orm
conflict w/<2.10
drop legacy Symfony <
5.4
Doctrine && User conditionalsremove legacy
UserBuilder
testsfixes make:user & password_hashers: skip password_hashers update if possible #990
Depends on [make:auth] drop guard support and legacy code cleanup #1104