From 516f675b074fc92165e0ac9d0e1cf73945932def Mon Sep 17 00:00:00 2001 From: Pollora maintainer Date: Mon, 23 Nov 2026 09:43:42 +0100 Subject: [PATCH] refactor!: make DiscoveryManager final (CONV-08) --- CHANGELOG.md | 1 + src/Application/Services/DiscoveryManager.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bce54a3..deb5ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **BREAKING**: `DiscoveryManager` is now `final` (and `readonly`, its only property being the engine it was given) (CONV-08). A class that extends it no longer loads, and a test can no longer mock it with Mockery: build it over a `DiscoveryEngineInterface` (mocked or real), which is the one collaborator it has - `CircularDependencyException` is now `final` (CONV-08). This is a restriction of the API for anyone who extended it: a class that is not an extension point can no longer be subclassed; compose it instead ## [0.2.0] - 2026-11-19 diff --git a/src/Application/Services/DiscoveryManager.php b/src/Application/Services/DiscoveryManager.php index c3fd48a..3769ecd 100644 --- a/src/Application/Services/DiscoveryManager.php +++ b/src/Application/Services/DiscoveryManager.php @@ -19,7 +19,7 @@ * * Inspired by Tempest Framework's API while leveraging Spatie's structure discovery. */ -class DiscoveryManager +final readonly class DiscoveryManager { /** * Create a new discovery manager @@ -27,7 +27,7 @@ class DiscoveryManager * @param DiscoveryEngineInterface $engine The discovery engine */ public function __construct( - private readonly DiscoveryEngineInterface $engine + private DiscoveryEngineInterface $engine ) {} /**