- Issue created by @mparker17
- Merge request !48Issue #3518008: Deprecate passing extra parameters to __construct() to prepare for 3.0.x → (Merged) created by mparker17
- 🇨🇦Canada spiderman Halifax, NS
I've reviewed this issue in some detail, looking carefully at the code changes, and also running tests locally on my branch. This was partly an exercise to re-familiarize myself with this project codebase, but also validated that the MR @mparker17 put together is solid.
Out of curiosity, I went looking for documentation about the "new style" dependency injection technique we're moving toward here. It took a bit of digging, but I believe what we're talking about is a move from "constructor injection" to "setter injection": https://symfony.com/doc/current/service_container/calls.html.
The reasoning for this makes sense to me, and I believe the
create()
pattern ensures the downside of this approach (namely, that you can't guarantee your dependencies are present upon being constructed) are mitigated, although I couldn't find much to back this up (is there something in Symfony or Drupal's Kernel or some such that ensurescreate()
is always called?)At any rate, this all looks great to me, and I'm marking as RTBC. I will file the follow-up issues now, and I think it's safe to commit this change anytime :)
- 🇨🇦Canada mparker17 UTC-4
I was about to merge this and noticed a new phpcs message...
The deprecation-version 'structure_sync:2.x' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or project:n.x-n.n-label[n] or project:n.n.n or project:n.n.n-label[n] (Drupal.Semantics.FunctionTriggerError.TriggerErrorVersion)
... so I fixed it in another commit; and verified there were no new errors, so I'm going to merge this.
-
mparker17 →
committed 24b1a436 on 2.x
Issue #3518008 by mparker17, spiderman: Deprecate passing extra...
-
mparker17 →
committed 24b1a436 on 2.x
- 🇫🇷France dydave
Great job @mparker17 and @spiderman! 🥳
Thanks a lot for the great documentation in this ticket and the very clean approach taken in the merge request to deprecate previous API signatures. It's definitely a great example and source of inspiration to me in terms of steps you have taken to drop support for certain versions 👍
Glad to see the project moving forward!
Thanks again for all the great work to keep the module well maintained! 🙏 - 🇨🇦Canada mparker17 UTC-4
Thanks @dydave for the kind words! :)
Thanks @spiderman for filing a follow-up, ✨ Deprecate the constructors in BlocksController, TaxonomiesController, and MenuLinksController Active
- 🇨🇦Canada spiderman Halifax, NS
Thanks @mparker17! I've also filed the other follow-up you mentioned, ✨ Remove constructors and extra constructor parameters from Controllers and Form classes Active and ticked that off here.
I'm wondering if it makes sense to get ✨ Deprecate the constructors in BlocksController, TaxonomiesController, and MenuLinksController Active in before cutting a new release, or if you prefer to cut 2.0.9 here, and then the further deprecations in a 2.0.10 release?
- 🇨🇦Canada mparker17 UTC-4
@spiderman, thank you very much!
I'm wondering if it makes sense to get ✨ Deprecate the constructors in BlocksController, TaxonomiesController, and MenuLinksController Active in before cutting a new release, or if you prefer to cut 2.0.9 here, and then the further deprecations in a 2.0.10 release?
I think it's worth it to get #3519479 in before cutting a new release.
- 🇨🇦Canada spiderman Halifax, NS
Ok great, in that case, I'll strike that task from the list and put it on ✨ Deprecate the constructors in BlocksController, TaxonomiesController, and MenuLinksController Active instead.
Automatically closed - issue fixed for 2 weeks with no activity.