diff --git a/Classes/EventListener/Mail/AttachmentFromOrderItem.php b/Classes/EventListener/Mail/AttachmentFromOrderItem.php index 9c390a5c..69ca3c2a 100644 --- a/Classes/EventListener/Mail/AttachmentFromOrderItem.php +++ b/Classes/EventListener/Mail/AttachmentFromOrderItem.php @@ -17,12 +17,12 @@ class AttachmentFromOrderItem { - private array $pluginSettings; + private array $settings; public function __construct( private ConfigurationManager $configurationManager ) { - $this->pluginSettings = $this->configurationManager->getConfiguration( + $this->settings = $this->configurationManager->getConfiguration( ConfigurationManager::CONFIGURATION_TYPE_FRAMEWORK, 'Cart' ); @@ -31,7 +31,7 @@ public function __construct( public function __invoke(AttachmentEvent $event): void { $type = $event->getType(); - if (!isset($this->pluginSettings['mail'][$type]['attachDocuments'])) { + if (!isset($this->settings['mail'][$type]['attachDocuments'])) { return; } @@ -40,7 +40,7 @@ public function __invoke(AttachmentEvent $event): void return; } - foreach ($this->pluginSettings['mail'][$type]['attachDocuments'] as $pdfType => $pdfData) { + foreach ($this->settings['mail'][$type]['attachDocuments'] as $pdfType => $pdfData) { $getter = 'get' . ucfirst($pdfType) . 'Pdfs'; $pdfs = $orderItem->$getter(); if ($pdfs && ($pdfs instanceof ObjectStorage)) { diff --git a/Classes/EventListener/Mail/AttachmentFromTypoScript.php b/Classes/EventListener/Mail/AttachmentFromTypoScript.php index c359ec45..3390a1f1 100644 --- a/Classes/EventListener/Mail/AttachmentFromTypoScript.php +++ b/Classes/EventListener/Mail/AttachmentFromTypoScript.php @@ -17,12 +17,12 @@ class AttachmentFromTypoScript { - private array $pluginSettings; + private array $settings; public function __construct( private ConfigurationManager $configurationManager ) { - $this->pluginSettings = $this->configurationManager->getConfiguration( + $this->settings = $this->configurationManager->getConfiguration( ConfigurationManager::CONFIGURATION_TYPE_FRAMEWORK, 'Cart' ); @@ -31,11 +31,11 @@ public function __construct( public function __invoke(AttachmentEvent $event): void { $type = $event->getType(); - if (!isset($this->pluginSettings['mail'][$type]['attachments'])) { + if (!isset($this->settings['mail'][$type]['attachments'])) { return; } - $attachments = $this->pluginSettings['mail'][$type]['attachments']; + $attachments = $this->settings['mail'][$type]['attachments']; foreach ($attachments as $attachment) { $attachmentFile = GeneralUtility::getFileAbsFileName($attachment); diff --git a/Tests/Functional/EventListener/Mail/AttachmentFromTypoScriptTest.php b/Tests/Functional/EventListener/Mail/AttachmentFromTypoScriptTest.php index 02593275..997a4c98 100644 --- a/Tests/Functional/EventListener/Mail/AttachmentFromTypoScriptTest.php +++ b/Tests/Functional/EventListener/Mail/AttachmentFromTypoScriptTest.php @@ -56,7 +56,7 @@ public function filesFromTypoScriptAddedToAttachmentList() $attachmentFromTypoScriot = new AttachmentFromTypoScript(GeneralUtility::makeInstance(ConfigurationManager::class)); - $pluginSettings = [ + $settings = [ 'mail' => [ 'buyer' => [ 'attachments' => [ @@ -69,8 +69,8 @@ public function filesFromTypoScriptAddedToAttachmentList() ]; $reflection = new \ReflectionClass($attachmentFromTypoScriot); - $reflection_property = $reflection->getProperty('pluginSettings'); - $reflection_property->setValue($attachmentFromTypoScriot, $pluginSettings); + $reflection_property = $reflection->getProperty('settings'); + $reflection_property->setValue($attachmentFromTypoScriot, $settings); $attachmentFromTypoScriot->__invoke($attachmentEvent);