Skip to content

Commit 976441d

Browse files
committed
[TASK] Use DiagramRenderer interface for decorator dependency
Change DecoratingPlantumlBinaryRenderer constructor to accept DiagramRenderer interface instead of concrete PlantumlRenderer. This improves testability and follows dependency inversion principle. The decorator only needs the interface contract, not the concrete implementation. Relates: TYPO3-Documentation#1099
1 parent b8a6475 commit 976441d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/typo3-docs-theme/src/Renderer/DecoratingPlantumlBinaryRenderer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace T3Docs\Typo3DocsTheme\Renderer;
66

77
use phpDocumentor\Guides\Graphs\Renderer\DiagramRenderer;
8-
use phpDocumentor\Guides\Graphs\Renderer\PlantumlRenderer;
98
use phpDocumentor\Guides\RenderContext;
109

1110
use function is_dir;
@@ -24,7 +23,7 @@ final class DecoratingPlantumlBinaryRenderer implements DiagramRenderer
2423
{
2524
private const TEMP_SUBDIRECTORY = '/phpdocumentor';
2625

27-
public function __construct(private readonly PlantumlRenderer $innerRenderer) {}
26+
public function __construct(private readonly DiagramRenderer $innerRenderer) {}
2827

2928
public function render(RenderContext $renderContext, string $diagram): string|null
3029
{

0 commit comments

Comments
 (0)