74853[FEATURE] Introduce MailerInterface
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Klee +1
- Kevin Appelt +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Benni Mack +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 21
- typo3/sysext/backend/Classes/Authentication/PasswordReset.php6+5 −3
- typo3/sysext/backend/Classes/Security/EmailLoginNotification.php2+3 −2
- typo3/sysext/backend/Classes/Security/FailedLoginAttemptNotification.php+3 −2
- typo3/sysext/backend/Tests/Unit/Security/EmailLoginNotificationTest.php2+9 −9
- typo3/sysext/core/Classes/Command/SendEmailCommand.php2+4 −5
- typo3/sysext/core/Classes/Mail/Mailer.php+0 −1
- typo3/sysext/core/Classes/Mail/MailerInterface.php10new+34 −0
- typo3/sysext/core/Classes/Mail/MailMessage.php+3 −2
- typo3/sysext/core/Classes/Mail/MemorySpool.php+2 −1
- typo3/sysext/core/Configuration/Services.yaml2+3 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97747-IntroduceMailerInterface.rst3new+43 −0
- typo3/sysext/core/Tests/Unit/Command/SendEmailCommandTest.php4+2 −5
- typo3/sysext/felogin/Classes/Service/RecoveryService.php+2 −2
- typo3/sysext/felogin/Tests/Unit/Service/RecoveryServiceTest.php+2 −2
- typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php+3 −2
- typo3/sysext/install/Classes/Authentication/AuthenticationService.php+3 −2
- typo3/sysext/install/Classes/Controller/EnvironmentController.php+3 −2
- typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php+3 −2
- typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php+3 −2
- typo3/sysext/workspaces/Classes/Notification/StageChangeNotification.php+6 −21
Show 1 more file
Review log 92123
Show 7298 earlier messages
-
Rudy Gnodde uploaded patch set 1 06/08/22, 09:10
-
Rudy Gnodde updated the commit message in patch set 2 06/08/22, 09:12
-
core-ci voted on patch set 1 V -1 06/08/22, 09:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27794
-
Rudy Gnodde uploaded patch set 3 06/08/22, 09:20
-
core-ci voted on patch set 2 V -1 06/08/22, 09:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27795
-
core-ci voted on patch set 3 V -1 06/08/22, 09:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27796
-
Rudy Gnodde uploaded patch set 4 06/08/22, 09:43
-
Oliver Klee commented on patch set 4 06/08/22, 09:44
EmailLoginNotificationTest.php:23Ditto. -
Rudy Gnodde uploaded patch set 5 06/08/22, 09:47
-
Rudy Gnodde commented on patch set 5 06/08/22, 09:48
EmailLoginNotification.php:24ReplyDoneEmailLoginNotificationTest.php:23ReplyDone -
core-ci voted on patch set 4 V +1 06/08/22, 09:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27797
-
core-ci voted on patch set 5 V +1 06/08/22, 09:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27798
-
Oliver Klee commented on patch set 5 06/08/22, 10:43
SendEmailCommand.php:88We can drop this line now as it only duplicates the native return type declaration.MailerInterface.php:8This interface deserves a short description about what it's purpose is and how/when it should be used.MailerInterface.php:14Do we know more about the array which we can put into a PHPDoc type annotation? And should/can the array be nullable?SendEmailCommandTest.php:46You don't need the disableOriginalConstructor call anymore when mocking the interface, which allows you to simplify this to using creatMock(). -
Rudy Gnodde uploaded patch set 6 06/08/22, 11:34
-
Rudy Gnodde commented on patch set 5 06/08/22, 11:34
SendEmailCommand.php:88ReplyDoneMailerInterface.php:8ReplyDoneMailerInterface.php:14ReplyI checked and this method is only used in the Unit test for the Mailer class. So it can be removed from the interface.SendEmailCommandTest.php:46ReplyDone -
core-ci voted on patch set 6 V +1 06/08/22, 11:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27806
-
Oliver Klee commented on patch set 6 06/08/22, 11:46
MailerInterface.php:9As I understand it, it should also be used when instantiating the mailer with makeInstance.SendEmailCommandTest.php:45Probably this shorter version will also work: $mailer = $this->createMock(MailerInterface::class); -
Rudy Gnodde uploaded patch set 7 06/08/22, 11:55
-
Rudy Gnodde commented on patch set 7 06/08/22, 11:56
MailerInterface.php:9ReplyDoneSendEmailCommandTest.php:45ReplyDone -
Jeroen Schutte uploaded patch set 8 06/08/22, 12:04
-
core-ci voted on patch set 7 V +1 06/08/22, 12:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27811
-
core-ci voted on patch set 8 V -1 06/08/22, 12:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27812
-
Jeroen Schutte uploaded patch set 9 06/08/22, 12:35
-
core-ci voted on patch set 9 V +1 06/08/22, 12:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27813
-
Jeroen Schutte updated the commit message in patch set 10 06/08/22, 12:46
-
Joey Bouten commented on patch set 9 06/08/22, 12:51
Feature-97747-MailerInterfaceIntroduction.rst:14I think this should be capital cased. -
Jeroen Schutte uploaded patch set 11 06/08/22, 12:53
-
core-ci voted on patch set 10 V +1 06/08/22, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27814
-
core-ci voted on patch set 11 V +1 06/08/22, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27816
-
Jeroen Schutte commented on patch set 11 06/08/22, 13:09
Feature-97747-MailerInterfaceIntroduction.rst:14ReplyDone -
Oliver Klee commented on patch set 12 06/08/22, 15:28
Published edit on patch set 11. -
Oliver Klee voted on patch set 12 CR +1 06/08/22, 15:29
-
core-ci voted on patch set 12 V +1 06/08/22, 15:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27829
-
Simon Schaufelberger commented on patch set 12 CR -1 06/09/22, 02:19
MailerInterface.php:5license header missingFeature-97747-MailerInterfaceIntroduction.rst:25\ missing before TYPO3 -
Rudy Gnodde uploaded patch set 13 06/09/22, 06:42
-
Rudy Gnodde commented on patch set 12 06/09/22, 06:42
MailerInterface.php:5ReplyDoneFeature-97747-MailerInterfaceIntroduction.rst:25ReplyDone -
core-ci voted on patch set 13 V +1 06/09/22, 06:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27855
-
Oliver Klee commented on patch set 13 06/09/22, 07:44
MailerInterface.php:3Please let's make the file strict. -
Oliver Klee commented on patch set 14 06/09/22, 09:03
Published edit on patch set 13. -
Oliver Klee commented on patch set 14 CR +1 06/09/22, 09:03
MailerInterface.php:3ReplyDone -
core-ci voted on patch set 14 V +1 06/09/22, 09:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27865
-
Simon Schaufelberger voted on patch set 14 CR +1 06/09/22, 09:50
-
Simon Schaufelberger updated the commit message in patch set 15 06/09/22, 11:58
-
Oliver Klee voted on patch set 15 CR +1 06/09/22, 12:01
-
Simon Schaufelberger commented on patch set 15 06/09/22, 12:03
Feature-97747-MailerInterfaceIntroduction.rst:30I'm thinking if it could be useful to roughly describe how an own Mailer class can be registered. That would also help the documentation team. -
core-ci voted on patch set 15 V +1 06/09/22, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27885
-
Oliver Klee voted on patch set 15 CR 0 06/09/22, 12:18
-
Jeroen Schutte uploaded patch set 16 06/09/22, 19:21
-
core-ci voted on patch set 16 V +1 06/09/22, 19:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27899
-
Oliver Klee commented on patch set 16 CR -1 06/09/22, 19:38
Jeroen, I think you accidentally uploaded patchset 11 again, overwriting all changes that have been uploaded after that. -
Jeroen Schutte uploaded patch set 17 06/09/22, 20:46
-
Jeroen Schutte commented on patch set 17 06/09/22, 20:49
Reply
Thanks for noticing. I pushed a fixFeature-97747-MailerInterfaceIntroduction.rst:30ReplyDone -
core-ci voted on patch set 17 V +1 06/09/22, 20:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27900
-
Simon Schaufelberger updated the commit message in patch set 18 06/09/22, 20:56
-
Simon Schaufelberger commented on patch set 18 06/09/22, 21:00
I've just updated the commit message a bit. Please always download the latest patch set before updating code. If you have your own branch, use the Download->Reset to link -
Simon Schaufelberger commented on patch set 18 V +1 CR +1 06/09/22, 21:00
Well done, now I really like it! -
core-ci voted on patch set 18 V +1 06/09/22, 21:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27901
-
Simon Schaufelberger commented on patch set 18 06/09/22, 21:04
One more question: You defined this as TASK but in the REST file you define it as FEATURE. I'm not sure myself but do you consider this more like a feature or a task? I think a feature fits slightly more as you can now register your own mailer class which was not (or only with lots of effort) possible. -
Simon Schaufelberger commented on patch set 18 CR -1 06/09/22, 21:05
Feature-97747-MailerInterfaceIntroduction.rst:6I would rephrase it to "Introduce MailerInterface" or someting like that so that it actually sounds like a feature. -
Andreas Kienast commented on patch set 18 06/10/22, 08:16
Feature-97747-MailerInterfaceIntroduction.rst:6ReplyThe patch is marked as [TASK], therefor I'd drop the rst file at all. -
Jeroen Schutte uploaded patch set 19 06/10/22, 08:45
-
Jeroen Schutte commented on patch set 18 06/10/22, 08:46
Reply
We have also discussed this ourselves. The intention was not to add anything new, but to retain functionality and better apply design principles. Based on that, we chose to make it a Task. Since Task is not supported in REST and it is better to have definition equally on those, I changed this in Feature -
Jeroen Schutte commented on patch set 19 06/10/22, 08:48
Feature-97747-MailerInterfaceIntroduction.rst:6ReplyTask > Feature -
core-ci voted on patch set 19 V +1 06/10/22, 08:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27909
-
Rudy Gnodde voted on patch set 19 V +1 CR +1 06/10/22, 09:11
-
Andreas Kienast commented on patch set 20 06/10/22, 10:11
Published edit on patch set 19. -
core-ci voted on patch set 20 V +1 06/10/22, 10:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27911
-
Oliver Klee voted on patch set 20 CR +1 06/10/22, 12:01
-
Simon Schaufelberger updated the commit message in patch set 21 06/10/22, 12:53
-
Simon Schaufelberger voted on patch set 21 V +1 CR +1 06/10/22, 12:53
-
Simon Schaufelberger uploaded patch set 22 06/10/22, 12:56
-
Simon Schaufelberger voted on patch set 22 V +1 CR +1 06/10/22, 12:56
-
Oliver Klee voted on patch set 22 CR +1 06/10/22, 13:02
-
core-ci voted on patch set 21 V -1 06/10/22, 13:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27922
-
Rudy Gnodde rebased onto patch set 23 06/10/22, 13:03
-
Jeroen Schutte commented on patch set 22 06/10/22, 13:03
Feature-97747-MailerInterfaceIntroduction.rst:45I wonder why this was removed? -
core-ci voted on patch set 22 V +1 06/10/22, 13:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27923
-
Simon Schaufelberger commented on patch set 23 06/10/22, 13:09
Feature-97747-MailerInterfaceIntroduction.rst:45ReplyBecause this link can change any time and is part of the documentation. No need to reference the documentation. -
core-ci voted on patch set 23 V +1 06/10/22, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27924
-
Oliver Klee voted on patch set 23 CR +1 06/10/22, 13:19
-
Simon Schaufelberger voted on patch set 23 V +1 CR +1 06/10/22, 13:34
-
Mathias Brodala commented on patch set 23 CR -1 06/21/22, 09:16
PasswordReset.php:197It is rather unusual (and actually unknown to the TYPO3 world) that one can make an instance of an interface. You should use DI instead to have the mailer injected.Services.yaml:367This can be dropped if DI is used everywhere instead. -
Guido Schmechel commented on patch set 23 06/21/22, 09:19
Feature-97747-IntroduceMailerInterface.rst:30Can you add a concrete example here if necessary? Based on the RsT and the ticket, I lack the imagination of what this could be used for and what advantages it brings with it? The specific question: Why should I register my own mailer? -
Rudy Gnodde commented on patch set 23 06/21/22, 09:38
PasswordReset.php:197ReplyAlthough I agree DI would probably be better (though wouldn't it be better performance wise like this if it is only needed in a single function that's not always called?), we wanted to keep this change as small as possible, so just replace `makeInstance(Mailer:class)` with `makeInstance(MailerInterface::class)`. I checked before making this change and it is done multiple times in core extensions (just do a regex search for `makeInstance\(.*?Interface`) -
Mathias Brodala commented on patch set 23 06/21/22, 09:45
PasswordReset.php:197ReplyTrue, but many wrongs don't necessarily make something right. ;-) So I really urge to make it right here and don't get confused by the other places which need to be fixed sooner or later. -
Oli Bartsch commented on patch set 23 06/21/22, 09:47
PasswordReset.php:197ReplyIt's actually the same as for e.g. EventDispatcherInterface, which is also instantiated with makeInstance() at various places. It's unfortunately not easily possible in those classes to change to DI. IMO using makeInstance at those places is fine for now, especially because this is no DI refactoring but just replacing an actual implementation with an interface, similar to this one https://review.typo3.org/c/Packages/TYPO3.CMS/+/73186 -
Mathias Brodala commented on patch set 23 CR 0 06/21/22, 09:55
PasswordReset.php:197ReplyYeah, looks similar. I'm not going to block this but will suggest to at least leave a TODO comment everywhere here so it is kept in mind for refactoring to DI at some point. This can be skipped if there are plans/strategies for this already. -
Simon Schaufelberger uploaded patch set 24 07/21/22, 02:17
-
core-ci voted on patch set 24 V +1 07/21/22, 02:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29388
-
Oliver Klee voted on patch set 24 CR +1 07/21/22, 10:35
-
Simon Schaufelberger rebased onto patch set 25 08/12/22, 12:08
-
Simon Schaufelberger commented on patch set 25 08/12/22, 12:09
@Mathias, can we move forward here or is anything still blocking? -
core-ci voted on patch set 25 V +1 08/12/22, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30088
-
Oliver Klee voted on patch set 25 CR +1 08/17/22, 16:53
-
Simon Schaufelberger uploaded patch set 26 08/17/22, 21:02
-
core-ci voted on patch set 26 V +1 08/17/22, 21:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30251
-
Oliver Klee voted on patch set 26 CR +1 08/17/22, 21:13
-
Simon Schaufelberger uploaded patch set 27 08/17/22, 21:41
-
Simon Schaufelberger commented on patch set 26 08/17/22, 21:41
PasswordReset.php:197ReplyDoneServices.yaml:367ReplyDone -
core-ci voted on patch set 27 V -1 08/17/22, 21:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30253
-
Simon Schaufelberger uploaded patch set 28 08/17/22, 22:08
-
Simon Schaufelberger uploaded patch set 29 08/17/22, 22:13
-
core-ci voted on patch set 28 V -1 08/17/22, 22:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30254
-
core-ci voted on patch set 29 V -1 08/17/22, 22:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30255
-
Simon Schaufelberger uploaded patch set 30 08/17/22, 22:30
-
core-ci voted on patch set 30 V +1 08/17/22, 22:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30256
-
Oliver Klee voted on patch set 30 CR +1 08/18/22, 06:49
-
Simon Schaufelberger voted on patch set 30 CR +1 08/18/22, 21:52
-
Benni Mack uploaded patch set 31 10/01/22, 15:05
-
core-ci voted on patch set 31 V +1 10/01/22, 15:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31829
-
Simon Schaufelberger voted on patch set 31 CR +1 10/01/22, 19:26
-
Benni Mack commented on patch set 31 V +1 CR +1 10/01/22, 21:42
Fine with the current implementation. If anyone wants to extend the RST, feel free! -
Oliver Klee voted on patch set 31 CR +1 10/01/22, 21:47
-
Kevin Appelt voted on patch set 31 CR +1 10/02/22, 22:19
-
Simon Schaufelberger commented on patch set 31 10/05/22, 04:34
Feature-97747-IntroduceMailerInterface.rst:30ReplyA good example that I could think of are functional tests where you want to mock a mailer. Laravel has a great use case for it: https://laravel.com/docs/9.x/mocking#mail-fake -
Simon Schaufelberger commented on patch set 31 V +1 10/05/22, 04:35
Feature-97747-IntroduceMailerInterface.rst:30ReplyDone -
Benni Mack voted on patch set 31 V +2 CR +2 10/11/22, 06:40
-
Benni Mack merged patch set 32 10/11/22, 06:40
-
Benni Mack commented on patch set 32 10/11/22, 06:41
aaargh, this file should have been in 12.1 -
Simon Schaufelberger commented on patch set 32 10/12/22, 07:21
Benni, will you take care and move this file into the 12.1 directory? -
Christian Kuhn commented on patch set 32 10/12/22, 09:00
Reply
merged already. -
Simon Schaufelberger commented on patch set 32 10/12/22, 09:05
Reply
yes but someone can still move the file to the correct location. -
Benni Mack commented on patch set 32 10/12/22, 09:31
Reply
I did move the file, and this change was also merged already. https://github.com/TYPO3/typo3/commit/39a4d9c2ddb4d89c272db2e852d1dbe92133a467
EmailLoginNotification.php:24