From 3d98cd2888aa9c197a87af36c09b32c590c9ad0f Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Mon, 19 Oct 2026 11:51:44 +0200 Subject: [PATCH] #55 - Mark the classes not meant to be extended @final and the infrastructure classes @internal - @final since 3.3 (final in 4.0): `RequestTask`, `RequestTransformer`, `ClientRegistry`, `CleverAgeSoapProcessBundle`. Extending them triggers a deprecation with the Symfony DebugClassLoader. - Stay open: `Client` (extended by the applications, see `docs/reference/client.md`), `MissingClientException` (exceptions stay open, as in process-bundle), `SoapCallOptionsTrait`. - @internal: `CleverAgeSoapProcessExtension`, `RegisterClientsPass`. - Same model as cleverage/process-bundle#279. Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 1 + src/CleverAgeSoapProcessBundle.php | 3 +++ src/DependencyInjection/CleverAgeSoapProcessExtension.php | 2 ++ src/DependencyInjection/Compiler/RegisterClientsPass.php | 2 ++ src/Registry/ClientRegistry.php | 2 ++ src/Task/RequestTask.php | 2 ++ src/Transformer/RequestTransformer.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bd3c25..6e6291c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Latest ------ ### Changes +* [#55](https://github.com/cleverage/soap-process-bundle/issues/55) Define the public API (Symfony BC promise, as [cleverage/process-bundle#279](https://github.com/cleverage/process-bundle/issues/279)): `RequestTask`, `RequestTransformer`, `ClientRegistry` and `CleverAgeSoapProcessBundle` are marked `@final since 3.3`, they will be `final` in 4.0: extending them triggers a deprecation with the Symfony `DebugClassLoader`. `Client` (extended by the applications) and `MissingClientException` stay open. `CleverAgeSoapProcessExtension` and `RegisterClientsPass` are marked `@internal`. * [#54](https://github.com/cleverage/soap-process-bundle/issues/54) `CleverAgeSoapProcessExtension::findServices()` loads the service definition files with a glob pattern instead of a `Finder` (same files, as [cleverage/process-bundle#271](https://github.com/cleverage/process-bundle/issues/271)), `symfony/finder` is no longer required. Add tests. * [#52](https://github.com/cleverage/soap-process-bundle/issues/52) ClientRegistry: the clients are loaded lazily from a service locator indexed by code: a client is only instantiated when a task or the transformer uses it (an error in a client that a process does not use no longer makes it fail). The code is given by the new `code` attribute of the `cleverage.soap.client` tag, or by the new `#[AsSoapClient(code: '...')]` attribute (autoconfiguration); it must be the one returned by `getCode()`. Duplicate or empty codes fail the container compilation. A client tagged without `code` is still registered eagerly, with `ClientRegistry::addClient()`, which is deprecated (the `code` will be required in 4.0). New optional `ClientRegistry` constructor argument (the locator); `ClientRegistry` is autowirable by its class name. Require `symfony/service-contracts`. Update documentation, add tests. * [#50](https://github.com/cleverage/soap-process-bundle/issues/50) Require `symfony/polyfill-php83`, `symfony/polyfill-php84` and `symfony/polyfill-php85` ([cleverage/process-bundle#299](https://github.com/cleverage/process-bundle/issues/299)), so the functions of PHP 8.3 to 8.5 can be used while supporting PHP 8.2. Configure Rector for PHP 8.2 with its polyfills set (it was configured for PHP 8.5, and could introduce PHP 8.3+ functions without polyfill). No code change: no Rector rule applies and no manual replacement keeps an identical behaviour. Document it in `CONTRIBUTING.md`. diff --git a/src/CleverAgeSoapProcessBundle.php b/src/CleverAgeSoapProcessBundle.php index 0ea4ef7..f4c8086 100644 --- a/src/CleverAgeSoapProcessBundle.php +++ b/src/CleverAgeSoapProcessBundle.php @@ -17,6 +17,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; +/** + * @final since 3.3 + */ class CleverAgeSoapProcessBundle extends Bundle { /** diff --git a/src/DependencyInjection/CleverAgeSoapProcessExtension.php b/src/DependencyInjection/CleverAgeSoapProcessExtension.php index eb3802a..4283c5f 100644 --- a/src/DependencyInjection/CleverAgeSoapProcessExtension.php +++ b/src/DependencyInjection/CleverAgeSoapProcessExtension.php @@ -24,6 +24,8 @@ * This is the class that loads and manages your bundle configuration. * * @see https://symfony.com/doc/current/bundles/extension.html + * + * @internal */ class CleverAgeSoapProcessExtension extends Extension { diff --git a/src/DependencyInjection/Compiler/RegisterClientsPass.php b/src/DependencyInjection/Compiler/RegisterClientsPass.php index 18ace92..ff5438c 100644 --- a/src/DependencyInjection/Compiler/RegisterClientsPass.php +++ b/src/DependencyInjection/Compiler/RegisterClientsPass.php @@ -22,6 +22,8 @@ /** * Registers the `cleverage.soap.client` tagged services in the client registry: in a service locator indexed by the * `code` attribute of the tag (lazy), or, without `code` (deprecated), with an addClient() call (eager). + * + * @internal */ class RegisterClientsPass implements CompilerPassInterface { diff --git a/src/Registry/ClientRegistry.php b/src/Registry/ClientRegistry.php index e408f0f..f928717 100644 --- a/src/Registry/ClientRegistry.php +++ b/src/Registry/ClientRegistry.php @@ -25,6 +25,8 @@ * is used. * * @author Madeline Veyrenc + * + * @final since 3.3 */ class ClientRegistry { diff --git a/src/Task/RequestTask.php b/src/Task/RequestTask.php index 10873e4..ac8ca6c 100644 --- a/src/Task/RequestTask.php +++ b/src/Task/RequestTask.php @@ -27,6 +27,8 @@ * 'soap_call_options': array|null, * 'soap_call_headers': array<\SoapHeader>|null, * } + * + * @final since 3.3 */ class RequestTask extends AbstractConfigurableTask { diff --git a/src/Transformer/RequestTransformer.php b/src/Transformer/RequestTransformer.php index c819a4b..5680b52 100644 --- a/src/Transformer/RequestTransformer.php +++ b/src/Transformer/RequestTransformer.php @@ -25,6 +25,8 @@ * 'soap_call_options': array|null, * 'soap_call_headers': array<\SoapHeader>|null, * } + * + * @final since 3.3 */ class RequestTransformer implements ConfigurableTransformerInterface {