@@ -208,7 +208,7 @@ public function createAction(Mail $mail, string $hash = ''): ResponseInterface
208208 if ($ this ->isNoOptin ($ mail , $ hash )) {
209209 $ this ->sendMailPreflight ($ mail , $ hash );
210210 } else {
211- $ mailPreflight = $ this -> objectManager -> get (
211+ $ mailPreflight = GeneralUtility:: makeInstance (
212212 SendOptinConfirmationMailPreflight::class,
213213 $ this ->settings ,
214214 $ this ->conf
@@ -224,7 +224,7 @@ public function createAction(Mail $mail, string $hash = ''): ResponseInterface
224224 $ this ->signalDispatch (__CLASS__ , __FUNCTION__ . 'AfterSubmitView ' , [$ mail , $ hash , $ this ]);
225225 $ this ->prepareOutput ($ mail );
226226
227- $ finisherRunner = $ this -> objectManager -> get (FinisherRunner::class);
227+ $ finisherRunner = GeneralUtility:: makeInstance (FinisherRunner::class);
228228 /** @noinspection PhpUnhandledExceptionInspection */
229229 $ finisherRunner ->callFinishers (
230230 $ mail ,
@@ -246,15 +246,15 @@ protected function sendMailPreflight(Mail $mail, string $hash = ''): void
246246 {
247247 try {
248248 if ($ this ->isSenderMailEnabled () && $ this ->mailRepository ->getSenderMailFromArguments ($ mail )) {
249- $ mailPreflight = $ this -> objectManager -> get (
249+ $ mailPreflight = GeneralUtility:: makeInstance (
250250 SendSenderMailPreflight::class,
251251 $ this ->settings ,
252252 $ this ->conf
253253 );
254254 $ mailPreflight ->sendSenderMail ($ mail );
255255 }
256256 if ($ this ->isReceiverMailEnabled ()) {
257- $ mailPreflight = $ this -> objectManager -> get (SendReceiverMailPreflight::class, $ this ->settings );
257+ $ mailPreflight = GeneralUtility:: makeInstance (SendReceiverMailPreflight::class, $ this ->settings );
258258 $ isSent = $ mailPreflight ->sendReceiverMail ($ mail , $ hash );
259259 if ($ isSent === false ) {
260260 $ this ->addFlashMessage (
@@ -311,7 +311,7 @@ protected function prepareOutput(Mail $mail): void
311311 */
312312 protected function saveMail (Mail $ mail ): void
313313 {
314- $ mailFactory = $ this -> objectManager -> get (MailFactory::class);
314+ $ mailFactory = GeneralUtility:: makeInstance (MailFactory::class);
315315 $ mailFactory ->prepareMailForPersistence ($ mail , $ this ->settings );
316316 $ this ->mailRepository ->add ($ mail );
317317 $ this ->persistenceManager ->persistAll ();
@@ -370,7 +370,11 @@ public function disclaimerAction(int $mail, string $hash): ResponseInterface
370370 $ mail = $ this ->mailRepository ->findByUid ($ mail );
371371 $ status = false ;
372372 if ($ mail !== null && HashUtility::isHashValid ($ hash , $ mail , 'disclaimer ' )) {
373- $ mailService = $ this ->objectManager ->get (SendDisclaimedMailPreflight::class, $ this ->settings , $ this ->conf );
373+ $ mailService = GeneralUtility::makeInstance (
374+ SendDisclaimedMailPreflight::class,
375+ $ this ->settings ,
376+ $ this ->conf
377+ );
374378 $ mailService ->sendMail ($ mail );
375379 $ this ->mailRepository ->removeFromDatabase ($ mail ->getUid ());
376380 $ status = true ;
@@ -415,7 +419,7 @@ public function initializeObject()
415419 {
416420 // @extensionScannerIgnoreLine Seems to be a false positive: getContentObject() is still correct in 9.0
417421 $ this ->contentObject = $ this ->configurationManager ->getContentObject ();
418- $ configurationService = $ this -> objectManager -> get (ConfigurationService::class);
422+ $ configurationService = GeneralUtility:: makeInstance (ConfigurationService::class);
419423 $ this ->conf = $ configurationService ->getTypoScriptConfiguration ();
420424 $ this ->settings = ConfigurationUtility::mergeTypoScript2FlexForm ($ this ->settings );
421425 if (ArrayUtility::isValidPath ($ this ->settings , 'debug/settings ' ) && $ this ->settings ['debug ' ]['settings ' ]) {
0 commit comments