From 8fa50c308974b6601959782b1f266351c0453b73 Mon Sep 17 00:00:00 2001 From: Sascha Bruemmer Date: Fri, 19 Aug 2022 11:13:06 +0200 Subject: [PATCH] [WIP] v11: fix DI --- Classes/View/MjmlBasedView.php | 4 +--- Configuration/Services.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 Configuration/Services.yaml diff --git a/Classes/View/MjmlBasedView.php b/Classes/View/MjmlBasedView.php index 4844cea..4a179b3 100644 --- a/Classes/View/MjmlBasedView.php +++ b/Classes/View/MjmlBasedView.php @@ -3,7 +3,6 @@ namespace Saccas\Mjml\View; use Saccas\Mjml\Domain\Renderer\RendererInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; @@ -17,8 +16,7 @@ class MjmlBasedView extends StandaloneView $this->renderer = $renderer; if ($this->renderer === null) { - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); - $this->renderer = $objectManager->get(RendererInterface::class); + $this->renderer = GeneralUtility::makeInstance(RendererInterface::class); } } diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100755 index 0000000..756fee3 --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,8 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + Saccas\Mjml\: + resource: '../Classes/*'