- 🇫🇷France t.maquin
Hello @akshay.singh,
Thanks for your review in #4.
I'm working on a way to remove those \Drupal calls in my static functions but can't find any solutions.Have you ever managed to do dependency injection in a batch context ?
- 🇮🇳India akshay.singh Noida
Hey @t.maquin,
I have done that and it is possible. I can see from your code that you have already injected some of the services through arguments which is the right way to do that. What is the trouble here?
- 🇫🇷France MacSim
#9 Nope it's not possible to use dependencies injection in a static method (
using $this in not an object context
). Either the method doesn't need to be static and we can use a dependency injection, either the static needs to be static and we have to use static calls - 🇮🇹Italy apaderno Brescia, 🇮🇹
Since static methods do not have access to
$this
, they can only access static properties, which means no injected dependencies. - 🇮🇹Italy apaderno Brescia, 🇮🇹
I take what reported has been already changed, apart the use of DI in static methods, has not it?
- Status changed to Needs review
almost 2 years ago 3:19pm 13 March 2023 - 🇫🇷France t.maquin
#11 Indeed, I think there is nothing more to change right now.
- Assigned to apaderno
- Status changed to RTBC
almost 2 years ago 8:05pm 13 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
src/Form/MicrowaveSettingsForm.php
/** * Constructs a \Drupal\system\ConfigFormBase object. *
The documentation comment is referring the wrong class.
- Status changed to Fixed
almost 2 years ago 8:07pm 13 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
Thank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
- Dries → ' post on Responsible maintainers
- Best practices for creating and maintaining projects →
- Maintaining a drupal.org project with Git →
- Commit messages - providing history and credit →
- Release naming conventions → .
- Helping maintainers in the issue queues →
You can find more contributors chatting on the Slack → #contribute channel. So, come hang out and stay involved → .
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review → . I encourage you to learn more about that process and join the group of reviewers.I thank all the reviewers.
- Issue was unassigned.
- 🇫🇷France t.maquin
@apaderno
Thank you for your contribution and the informations about maintaining,
I took care of the constructor comment.Thanks all for your contribution !
- Assigned to apaderno
Automatically closed - issue fixed for 2 weeks with no activity.