From 8fe7b2ed37dad388366bf377a840c07a8b0a8be9 Mon Sep 17 00:00:00 2001
From: Henning <leutz@pcsg.de>
Date: Mon, 10 Feb 2025 14:27:40 +0100
Subject: [PATCH] fix: argument must be of type OutputProviderInterface

Changed the variable name `$OutputProvider` to `$outputProvider` to adhere to camelCase naming
standards. Also moved the instantiation of `$outputProvider` inside an if block to prevent
unnecessary instantiation when `$outputProvider` is empty.

Related: pcsg/kunden/libellio/b2c/core#196
---
 bin/output/frontend/download.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/output/frontend/download.php b/bin/output/frontend/download.php
index f258e67..15fcf4d 100644
--- a/bin/output/frontend/download.php
+++ b/bin/output/frontend/download.php
@@ -19,12 +19,14 @@
 $entityType = Orthos::clear($Request->query->get('t'));
 
 try {
-    $OutputProvider = Output::getOutputProviderByEntityType($entityType);
+    $outputProvider = Output::getOutputProviderByEntityType($entityType);
 
-    if (empty($OutputProvider)) {
+    if (empty($outputProvider)) {
         exit;
     }
 
+    $OutputProvider = new $outputProvider();
+
     if (!$OutputProvider::hasDownloadPermission($entityId, $User)) {
         exit;
     }
-- 
GitLab