From fbd1a9d10b650836c02a4c8808bcb19387ca25bf Mon Sep 17 00:00:00 2001 From: Jaapio Date: Fri, 19 Jan 2024 17:57:41 +0100 Subject: [PATCH] [!!!TASK] Make all classes final This library has a very large number of extension points via interfaces and abstract classes. All other classes should not be extended by users and shall theirfor be marked as final. There are a few classes left that should also be marked as final but those require some extra attention. --- src/Graphs/DependencyInjection/Configuration.php | 2 +- src/Graphs/DependencyInjection/GraphsExtension.php | 2 +- src/Graphs/Nodes/UmlNode.php | 2 +- src/Graphs/Renderer/PlantumlRenderer.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Graphs/DependencyInjection/Configuration.php b/src/Graphs/DependencyInjection/Configuration.php index 2cb9c58..9a91024 100644 --- a/src/Graphs/DependencyInjection/Configuration.php +++ b/src/Graphs/DependencyInjection/Configuration.php @@ -19,7 +19,7 @@ use function assert; -class Configuration implements ConfigurationInterface +final class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { diff --git a/src/Graphs/DependencyInjection/GraphsExtension.php b/src/Graphs/DependencyInjection/GraphsExtension.php index 0fb0708..a05b3f3 100644 --- a/src/Graphs/DependencyInjection/GraphsExtension.php +++ b/src/Graphs/DependencyInjection/GraphsExtension.php @@ -21,7 +21,7 @@ use function dirname; -class GraphsExtension extends Extension implements PrependExtensionInterface +final class GraphsExtension extends Extension implements PrependExtensionInterface { /** @param mixed[] $configs */ public function load(array $configs, ContainerBuilder $container): void diff --git a/src/Graphs/Nodes/UmlNode.php b/src/Graphs/Nodes/UmlNode.php index d684a8f..3fd5edc 100644 --- a/src/Graphs/Nodes/UmlNode.php +++ b/src/Graphs/Nodes/UmlNode.php @@ -15,7 +15,7 @@ use phpDocumentor\Guides\Nodes\TextNode; -class UmlNode extends TextNode +final class UmlNode extends TextNode { private string $caption = ''; diff --git a/src/Graphs/Renderer/PlantumlRenderer.php b/src/Graphs/Renderer/PlantumlRenderer.php index 4bed351..758ae85 100644 --- a/src/Graphs/Renderer/PlantumlRenderer.php +++ b/src/Graphs/Renderer/PlantumlRenderer.php @@ -24,7 +24,7 @@ use function sys_get_temp_dir; use function tempnam; -class PlantumlRenderer implements DiagramRenderer +final class PlantumlRenderer implements DiagramRenderer { public function __construct(private readonly LoggerInterface $logger, private readonly string $plantUmlBinaryPath) {