Skip to content

Commit

Permalink
[CLEANUP] Rename settings variable
Browse files Browse the repository at this point in the history
  • Loading branch information
extcode committed Apr 15, 2024
1 parent 33088d7 commit 7a82602
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Classes/EventListener/Mail/AttachmentFromOrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand All @@ -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;
}

Expand All @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions Classes/EventListener/Mail/AttachmentFromTypoScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function filesFromTypoScriptAddedToAttachmentList()

$attachmentFromTypoScriot = new AttachmentFromTypoScript(GeneralUtility::makeInstance(ConfigurationManager::class));

$pluginSettings = [
$settings = [
'mail' => [
'buyer' => [
'attachments' => [
Expand All @@ -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);

Expand Down

0 comments on commit 7a82602

Please sign in to comment.