-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add deprecation when injecting registry in command #6420
Add deprecation when injecting registry in command #6420
Conversation
The problem I see with this is that as it is, is that it will throw an unavoidable deprecation because
If we don't pass it, it will be BC-break (because the |
Sure. Could you give me the code to write in the |
61f8b95
to
e7567df
Compare
I guess this would work: ->set(GenerateObjectAclCommand::class, GenerateObjectAclCommand::class)
->public()
->tag('console.command')
->args([
new ReferenceConfigurator('sonata.admin.pool'),
[]
])
->call('setRegistry', [(new ReferenceConfigurator('doctrine'))->nullOnInvalid()]) |
5957e5e
to
04e3352
Compare
Thanks @franmomu, I've made the changes |
Could you please rebase your PR and fix merge conflicts? |
04e3352
to
a2c687f
Compare
d3458c2
to
c379a67
Compare
0c53e54
to
cae9643
Compare
* | ||
* NEXT_MAJOR: Remove this class | ||
*/ | ||
class DeprecatedGenerateObjectAclCommandTest extends TestCase |
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.
class DeprecatedGenerateObjectAclCommandTest extends TestCase | |
final class DeprecatedGenerateObjectAclCommandTest extends TestCase |
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.
Just a minor comment
faf6016
cae9643
to
faf6016
Compare
I made the requested change @OskarStark |
$pool = new Pool($this->container, '', ''); | ||
|
||
$registry = $this->createStub(RegistryInterface::class); | ||
$this->expectDeprecation('Passing a third argument to %s() is deprecated since sonata-project/admin-bundle 3.x.'); |
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.
Is that normal? If not, why did the test pass? They don't pass when trying to merge this up.
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.
Indeed, %s()
is weird... I think I have made a mistake
Subject
I am targeting this branch, because BC.
Some deprecation and some tests updates were missing in #6413
Changelog