From 8c977a44b43e73d38d937d450754dd380b4bd936 Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Thu, 15 Oct 2026 13:31:27 +0200 Subject: [PATCH] #279 - Mark the classes not meant to be extended @final and the infrastructure classes @internal - @final since 5.4 (final in v6.0) on the engine (ProcessManager, the registries, ContextualOptionResolver), the models (ProcessState, ProcessHistory, SubprocessInstance, the configurations, the events, the Filesystem files) and the concrete tasks and transformers: extending them triggers a deprecation with the Symfony DebugClassLoader. - Stay open: the abstract classes, interfaces, traits, exceptions and the file tasks extended by other tasks (FileReaderTask, LineReaderTask, FolderBrowserTask, CsvReaderTask, InputCsvReaderTask, CsvResource). - TaskRegistry, not released yet, is final. - @internal on the extension, Configuration, the commands, DataQueueEventListener, PhpFunctionProvider, the Monolog processors, ProcessLogger and TaskLogger. - Good practices: extend the bundle without inheriting its classes. Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 1 + docs/05-good_practices.md | 22 +++++++++++++++++++ src/Command/ExecuteProcessCommand.php | 2 ++ src/Command/ListProcessCommand.php | 2 ++ src/Command/ProcessHelpCommand.php | 2 ++ src/Configuration/ProcessConfiguration.php | 2 ++ src/Configuration/TaskConfiguration.php | 2 ++ src/Context/ContextualOptionResolver.php | 3 +++ .../CleverAgeProcessExtension.php | 2 ++ src/DependencyInjection/Configuration.php | 2 ++ src/Event/ConsoleProcessEvent.php | 2 ++ src/Event/EventDispatcherTaskEvent.php | 3 +++ src/Event/ProcessEvent.php | 2 ++ src/EventListener/DataQueueEventListener.php | 2 ++ .../PhpFunctionProvider.php | 2 ++ src/Filesystem/CsvFile.php | 2 ++ src/Filesystem/JsonStreamFile.php | 2 ++ src/Filesystem/SplFile.php | 2 ++ src/Filesystem/XmlFile.php | 2 ++ src/Logger/AbstractProcessor.php | 3 +++ src/Logger/ProcessLogger.php | 3 +++ src/Logger/ProcessProcessor.php | 3 +++ src/Logger/TaskLogger.php | 3 +++ src/Logger/TaskProcessor.php | 3 +++ src/Logger/TransformerProcessor.php | 3 +++ src/Manager/ProcessManager.php | 2 ++ src/Model/ProcessHistory.php | 2 ++ src/Model/ProcessState.php | 3 +++ src/Model/SubprocessInstance.php | 3 +++ src/Registry/ProcessConfigurationRegistry.php | 2 ++ src/Registry/TaskRegistry.php | 2 +- src/Registry/TransformerRegistry.php | 2 ++ src/Task/AggregateIterableTask.php | 2 ++ src/Task/ArrayMergeTask.php | 2 ++ src/Task/ColumnAggregatorTask.php | 2 ++ src/Task/ConstantIterableOutputTask.php | 2 ++ src/Task/ConstantOutputTask.php | 2 ++ src/Task/CounterTask.php | 2 ++ src/Task/Debug/DebugTask.php | 2 ++ src/Task/Debug/DieTask.php | 2 ++ src/Task/Debug/ErrorForwarderTask.php | 2 ++ src/Task/Debug/StopwatchTask.php | 2 ++ src/Task/DummyTask.php | 2 ++ src/Task/Event/EventDispatcherTask.php | 2 ++ src/Task/File/Csv/CsvSplitterTask.php | 2 ++ src/Task/File/Csv/CsvWriterTask.php | 2 ++ src/Task/File/FileMoverTask.php | 2 ++ src/Task/File/FileRemoverTask.php | 2 ++ src/Task/File/FileSplitterTask.php | 2 ++ src/Task/File/FileWriterTask.php | 3 +++ src/Task/File/InputFileReaderTask.php | 2 ++ src/Task/File/InputFolderBrowserTask.php | 2 ++ src/Task/File/InputLineReaderTask.php | 2 ++ .../File/JsonStream/JsonStreamReaderTask.php | 3 +++ .../File/JsonStream/JsonStreamWriterTask.php | 3 +++ src/Task/File/Xml/XmlReaderTask.php | 2 ++ src/Task/File/Xml/XmlStreamReaderTask.php | 2 ++ src/Task/File/Xml/XmlWriterTask.php | 2 ++ src/Task/File/Yaml/YamlReaderTask.php | 2 ++ src/Task/File/Yaml/YamlWriterTask.php | 2 ++ src/Task/FilterTask.php | 2 ++ src/Task/GroupByAggregateIterableTask.php | 2 ++ src/Task/InputIteratorTask.php | 2 ++ src/Task/IterableBatchTask.php | 2 ++ src/Task/ObjectUpdaterTask.php | 2 ++ src/Task/Process/CommandRunnerTask.php | 2 ++ src/Task/Process/ProcessExecutorTask.php | 2 ++ src/Task/Process/ProcessLauncherTask.php | 2 ++ src/Task/PropertyGetterTask.php | 2 ++ src/Task/PropertySetterTask.php | 2 ++ .../Reporting/AdvancedStatCounterTask.php | 2 ++ src/Task/Reporting/LoggerTask.php | 2 ++ src/Task/Reporting/StatCounterTask.php | 2 ++ src/Task/RowAggregatorTask.php | 2 ++ src/Task/Serialization/DenormalizerTask.php | 2 ++ src/Task/Serialization/DeserializerTask.php | 3 +++ src/Task/Serialization/NormalizerTask.php | 2 ++ src/Task/Serialization/SerializerTask.php | 3 +++ src/Task/SimpleBatchTask.php | 2 ++ src/Task/SkipEmptyTask.php | 2 ++ src/Task/SplitJoinLineTask.php | 2 ++ src/Task/StopTask.php | 2 ++ src/Task/TransformerTask.php | 2 ++ src/Task/Validation/ValidatorTask.php | 2 ++ .../Array/ArrayElementTransformer.php | 2 ++ .../Array/ArrayFilterTransformer.php | 2 ++ .../Array/ArrayFirstTransformer.php | 2 ++ .../Array/ArrayLastTransformer.php | 2 ++ src/Transformer/Array/ArrayMapTransformer.php | 2 ++ .../Array/ArrayUnsetTransformer.php | 2 ++ src/Transformer/CachedTransformer.php | 3 +++ src/Transformer/CallbackTransformer.php | 2 ++ src/Transformer/CastTransformer.php | 2 ++ src/Transformer/ConstantTransformer.php | 2 ++ src/Transformer/ConvertValueTransformer.php | 2 ++ .../Date/DateFormatTransformer.php | 2 ++ .../Date/DateParserTransformer.php | 2 ++ src/Transformer/DebugTransformer.php | 2 ++ src/Transformer/DefaultTransformer.php | 2 ++ src/Transformer/EvaluatorTransformer.php | 3 +++ .../ExpressionLanguageMapTransformer.php | 2 ++ src/Transformer/GenericTransformer.php | 2 ++ src/Transformer/MappingTransformer.php | 2 ++ src/Transformer/MultiReplaceTransformer.php | 2 ++ .../Object/InstantiateTransformer.php | 2 ++ .../Object/PropertyAccessorTransformer.php | 2 ++ .../RecursivePropertySetterTransformer.php | 2 ++ src/Transformer/PregFilterTransformer.php | 4 ++++ src/Transformer/RulesTransformer.php | 2 ++ .../Serialization/DenormalizeTransformer.php | 2 ++ .../Serialization/NormalizeTransformer.php | 2 ++ src/Transformer/String/ExplodeTransformer.php | 2 ++ src/Transformer/String/HashTransformer.php | 2 ++ src/Transformer/String/ImplodeTransformer.php | 2 ++ .../String/PregMatchTransformer.php | 2 ++ src/Transformer/String/SlugifyTransformer.php | 2 ++ src/Transformer/String/SprintfTransformer.php | 2 ++ src/Transformer/String/TrimTransformer.php | 2 ++ src/Transformer/TypeSetterTransformer.php | 3 +++ src/Transformer/UnsetTransformer.php | 2 ++ src/Transformer/WrapperTransformer.php | 3 +++ .../Xml/XpathEvaluatorTransformer.php | 2 ++ src/Validator/ConstraintLoader.php | 3 +++ 123 files changed, 286 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be9c527..134470ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Latest ------ ## Changes +* [#279](https://github.com/cleverage/process-bundle/issues/279) Define the public API (Symfony BC promise): the classes not meant to be extended are marked `@final since 5.4` (the engine: `ProcessManager`, `ProcessConfigurationRegistry`, `TransformerRegistry`, `ContextualOptionResolver`; the models: `ProcessState`, `ProcessHistory`, `SubprocessInstance`, the configurations, the events, the `Filesystem` files; the concrete tasks and transformers), they will be `final` in v6.0: extending them triggers a deprecation with the Symfony `DebugClassLoader`. The abstract classes, interfaces, traits, exceptions and the file tasks extended by other tasks (`FileReaderTask`, `LineReaderTask`, `FolderBrowserTask`, `CsvReaderTask`, `InputCsvReaderTask`, `Filesystem\CsvResource`) stay open. `TaskRegistry`, new in this version, is `final`. The infrastructure classes are marked `@internal`: `CleverAgeProcessExtension`, `Configuration`, the commands, `DataQueueEventListener`, `PhpFunctionProvider`, the Monolog processors, `ProcessLogger` and `TaskLogger`. Update documentation. * [#269](https://github.com/cleverage/process-bundle/issues/269) Composer: `symfony/process`, `symfony/stopwatch`, `symfony/var-dumper` and `symfony/monolog-bundle` are no longer required, they are suggested (applications using them must require them). Without `symfony/process` (`CommandRunnerTask`, `ProcessLauncherTask`) or `symfony/stopwatch` (`StopwatchTask`), the container still compiles and these tasks fail with an explicit message (`UnavailableServicesCompilerPass`); without `symfony/var-dumper`, nothing is dumped (as before); without `symfony/monolog-bundle`, the `cleverage_process*` channels and processors are not registered and the default logger is used. `monolog/monolog` stays required (`Logger\*Processor`). Remove the unused `symfony/monolog-bridge` dependency. `ProcessConfiguration` no longer uses `array_any()` (PHP 8.4), whose polyfill was only installed by the removed packages. Add a `conflict` with `cleverage/doctrine-process-bundle`, `cleverage/soap-process-bundle` and `cleverage/ui-process-bundle` `<3.3`, which use the MonologBundle without requiring it. Update documentation, add tests. * [#91](https://github.com/cleverage/process-bundle/issues/91) Reference a task by a code in the process configurations: new `task` key (`task: transformer`), next to its `options`. The code of a task service is declared with the new `code` attribute of the `cleverage.task` tag or the new `#[AsTask(code: '...')]` attribute (autoconfiguration); every task of the bundle has a code, given on its reference page (snake case of its class name without `Task`, e.g. `transformer`, `constant_output`, `csv_reader`). The codes are resolved when the container is compiled (`TaskLocatorCompilerPass`): an unknown or duplicate code fails the compilation. Referencing a task by its `service` (e.g. `service: '@CleverAge\ProcessBundle\Task\TransformerTask'`) is deprecated (configuration deprecation), it will be removed in v6.0: use `task: `. The documentation examples use the codes. Update documentation, add tests. * [#276](https://github.com/cleverage/process-bundle/issues/276) TransformerRegistry: the transformers are loaded lazily from a service locator indexed by code (new internal `TransformerLocatorCompilerPass`, new optional `TransformerRegistry` constructor argument): a transformer is only instantiated when a process uses it. The code is given by the new `code` attribute of the `cleverage.transformer` tag, or by the new `#[AsTransformer(code: '...')]` attribute (autoconfiguration); it must be the one returned by `getCode()`. All the bundle transformers and the generic transformers have their code. Duplicate codes fail the container compilation. A transformer tagged without `code` is still registered eagerly, with `TransformerRegistry::addTransformer()`, which is deprecated (the `code` will be required in v6.0, #280). `RegistryCompilerPass` is no longer used and deprecated. `TransformerInterface::getCode()` is deprecated (`@deprecated` PHPDoc: no runtime notice is possible for an interface method), it will be removed from the interface in v6.0 (#280): keep implementing it, returning the code of the tag until then. Update documentation, add tests. diff --git a/docs/05-good_practices.md b/docs/05-good_practices.md index b71b9d99..2f23df41 100644 --- a/docs/05-good_practices.md +++ b/docs/05-good_practices.md @@ -79,3 +79,25 @@ relying on the order in which branches are executed. Values that change between executions (a file name, a date, a limit...) should not be hard-coded in the process configuration: pass them as [contextual values](01-quick_start.md#contextual-values) (`-c key:value`) and use `{{ key }}` placeholders in the task options. + +## Extend the bundle without inheriting its classes + +The classes meant to be extended are the abstract ones (`AbstractConfigurableTask`, `AbstractIterableOutputTask`, +`AbstractCsvTask`, `Logger\AbstractLogger`...), the interfaces and traits, the exceptions, and a few file tasks used as +a base by other tasks (`FileReaderTask`, `LineReaderTask`, `FolderBrowserTask`, `CsvReaderTask`, `InputCsvReaderTask` +and `Filesystem\CsvResource`). + +The other classes are marked `@final since 5.4`, they will be `final` in v6.0: the engine (`ProcessManager`, the +registries, `ContextualOptionResolver`), the models (`ProcessState`, the configurations, the events) and the concrete +tasks and transformers. Extending one of them triggers a deprecation (with the Symfony `DebugClassLoader`, enabled by +`symfony/error-handler` in debug mode). Instead: + +- write your own task (extending `AbstractConfigurableTask`) or transformer, and inject the services of the bundle you + need; +- [decorate](https://symfony.com/doc/current/service_container/service_decoration.html) a service, or listen to the + process [events](04-advanced_workflow.md); +- chain existing tasks and transformers in the process configuration. + +The classes marked `@internal` (the dependency injection extension, configuration and compiler passes, the commands, the +event listeners, the Monolog processors, `ProcessLogger`, `TaskLogger` and `PhpFunctionProvider`) are not part of the +public API: they can change in any version. diff --git a/src/Command/ExecuteProcessCommand.php b/src/Command/ExecuteProcessCommand.php index 088428f5..e2739a5d 100644 --- a/src/Command/ExecuteProcessCommand.php +++ b/src/Command/ExecuteProcessCommand.php @@ -30,6 +30,8 @@ /** * Run a process from the command line interface. + * + * @internal */ #[AsCommand(name: 'cleverage:process:execute', description: 'Execute a process', )] class ExecuteProcessCommand extends Command diff --git a/src/Command/ListProcessCommand.php b/src/Command/ListProcessCommand.php index 41818247..b7ec1d93 100644 --- a/src/Command/ListProcessCommand.php +++ b/src/Command/ListProcessCommand.php @@ -23,6 +23,8 @@ /** * List all configured processes. + * + * @internal */ #[AsCommand(name: 'cleverage:process:list', description: 'List defined processes', )] class ListProcessCommand extends Command diff --git a/src/Command/ProcessHelpCommand.php b/src/Command/ProcessHelpCommand.php index c0060f68..adfc96bf 100644 --- a/src/Command/ProcessHelpCommand.php +++ b/src/Command/ProcessHelpCommand.php @@ -34,6 +34,8 @@ /** * Describe a process configuration * This is a POC, waiting to evolve properly. + * + * @internal */ #[AsCommand(name: 'cleverage:process:help', description: 'Describe a process', )] class ProcessHelpCommand extends Command diff --git a/src/Configuration/ProcessConfiguration.php b/src/Configuration/ProcessConfiguration.php index 7c7ce9c7..767d9bbd 100644 --- a/src/Configuration/ProcessConfiguration.php +++ b/src/Configuration/ProcessConfiguration.php @@ -19,6 +19,8 @@ /** * Holds the processes configuration to launch a task. + * + * @final since 5.4 */ class ProcessConfiguration { diff --git a/src/Configuration/TaskConfiguration.php b/src/Configuration/TaskConfiguration.php index eea7aed0..eafa061e 100644 --- a/src/Configuration/TaskConfiguration.php +++ b/src/Configuration/TaskConfiguration.php @@ -19,6 +19,8 @@ /** * Represents a task configuration inside a process. + * + * @final since 5.4 */ class TaskConfiguration { diff --git a/src/Context/ContextualOptionResolver.php b/src/Context/ContextualOptionResolver.php index ef3014b4..f4d67677 100644 --- a/src/Context/ContextualOptionResolver.php +++ b/src/Context/ContextualOptionResolver.php @@ -13,6 +13,9 @@ namespace CleverAge\ProcessBundle\Context; +/** + * @final since 5.4 + */ class ContextualOptionResolver { /** diff --git a/src/DependencyInjection/CleverAgeProcessExtension.php b/src/DependencyInjection/CleverAgeProcessExtension.php index 4045cfbc..b266012c 100644 --- a/src/DependencyInjection/CleverAgeProcessExtension.php +++ b/src/DependencyInjection/CleverAgeProcessExtension.php @@ -31,6 +31,8 @@ * This is the class that loads and manages your bundle configuration. * * @see https://symfony.com/doc/current/bundles/extension.html + * + * @internal */ class CleverAgeProcessExtension extends Extension { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 9fcd0f38..3d8ef275 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -23,6 +23,8 @@ * This is the class that validates and merges configuration from your app/config files. * * @see https://symfony.com/doc/current/bundles/configuration.html + * + * @internal */ class Configuration implements ConfigurationInterface { diff --git a/src/Event/ConsoleProcessEvent.php b/src/Event/ConsoleProcessEvent.php index 317d0047..e25efcdf 100644 --- a/src/Event/ConsoleProcessEvent.php +++ b/src/Event/ConsoleProcessEvent.php @@ -19,6 +19,8 @@ /** * Event object used during CLI process manipulation. + * + * @final since 5.4 */ class ConsoleProcessEvent extends Event { diff --git a/src/Event/EventDispatcherTaskEvent.php b/src/Event/EventDispatcherTaskEvent.php index e148e973..c598c0fa 100644 --- a/src/Event/EventDispatcherTaskEvent.php +++ b/src/Event/EventDispatcherTaskEvent.php @@ -16,6 +16,9 @@ use CleverAge\ProcessBundle\Model\ProcessState; use Symfony\Contracts\EventDispatcher\Event; +/** + * @final since 5.4 + */ class EventDispatcherTaskEvent extends Event { public function __construct( diff --git a/src/Event/ProcessEvent.php b/src/Event/ProcessEvent.php index 7e9c8f53..15ac9555 100644 --- a/src/Event/ProcessEvent.php +++ b/src/Event/ProcessEvent.php @@ -17,6 +17,8 @@ /** * Event object for process start/stop/fail. + * + * @final since 5.4 */ class ProcessEvent extends Event { diff --git a/src/EventListener/DataQueueEventListener.php b/src/EventListener/DataQueueEventListener.php index 2d0de8e1..d5f1bb89 100644 --- a/src/EventListener/DataQueueEventListener.php +++ b/src/EventListener/DataQueueEventListener.php @@ -20,6 +20,8 @@ * Class DataQueueEventListener * This is a basic queue, mainly aiming to catch data coming out of a process * Used mostly for testing purpose. + * + * @internal */ class DataQueueEventListener { diff --git a/src/ExpressionLanguage/PhpFunctionProvider.php b/src/ExpressionLanguage/PhpFunctionProvider.php index bd931429..2e63db5f 100644 --- a/src/ExpressionLanguage/PhpFunctionProvider.php +++ b/src/ExpressionLanguage/PhpFunctionProvider.php @@ -18,6 +18,8 @@ /** * Allow to inject a set of PHP function into an ExpressionLanguage instance. + * + * @internal */ class PhpFunctionProvider implements ExpressionFunctionProviderInterface { diff --git a/src/Filesystem/CsvFile.php b/src/Filesystem/CsvFile.php index 5678c00a..db87489f 100644 --- a/src/Filesystem/CsvFile.php +++ b/src/Filesystem/CsvFile.php @@ -15,6 +15,8 @@ /** * Read and write CSV files through a simple API. + * + * @final since 5.4 */ class CsvFile extends CsvResource { diff --git a/src/Filesystem/JsonStreamFile.php b/src/Filesystem/JsonStreamFile.php index 18d0b66a..7a5fd171 100644 --- a/src/Filesystem/JsonStreamFile.php +++ b/src/Filesystem/JsonStreamFile.php @@ -15,6 +15,8 @@ /** * Wrapper around JSON files to read them in a stream. + * + * @final since 5.4 */ class JsonStreamFile implements FileStreamInterface, WritableFileInterface { diff --git a/src/Filesystem/SplFile.php b/src/Filesystem/SplFile.php index a7f55ec8..04c600f4 100644 --- a/src/Filesystem/SplFile.php +++ b/src/Filesystem/SplFile.php @@ -15,6 +15,8 @@ /** * Wrapper around files to read/write them. + * + * @final since 5.4 */ class SplFile { diff --git a/src/Filesystem/XmlFile.php b/src/Filesystem/XmlFile.php index 4fecd2f1..abb6f2b8 100644 --- a/src/Filesystem/XmlFile.php +++ b/src/Filesystem/XmlFile.php @@ -15,6 +15,8 @@ /** * Read and write XML files. + * + * @final since 5.4 */ class XmlFile { diff --git a/src/Logger/AbstractProcessor.php b/src/Logger/AbstractProcessor.php index fb7b1e62..6be48ccc 100644 --- a/src/Logger/AbstractProcessor.php +++ b/src/Logger/AbstractProcessor.php @@ -18,6 +18,9 @@ use CleverAge\ProcessBundle\Model\ProcessHistory; use Monolog\LogRecord; +/** + * @internal + */ class AbstractProcessor { public function __construct( diff --git a/src/Logger/ProcessLogger.php b/src/Logger/ProcessLogger.php index 5b17b68c..1c47ca39 100644 --- a/src/Logger/ProcessLogger.php +++ b/src/Logger/ProcessLogger.php @@ -13,6 +13,9 @@ namespace CleverAge\ProcessBundle\Logger; +/** + * @internal + */ class ProcessLogger extends AbstractLogger { } diff --git a/src/Logger/ProcessProcessor.php b/src/Logger/ProcessProcessor.php index 819ddf1b..852ada24 100644 --- a/src/Logger/ProcessProcessor.php +++ b/src/Logger/ProcessProcessor.php @@ -13,6 +13,9 @@ namespace CleverAge\ProcessBundle\Logger; +/** + * @internal + */ class ProcessProcessor extends AbstractProcessor { } diff --git a/src/Logger/TaskLogger.php b/src/Logger/TaskLogger.php index 8bee634e..b6be5353 100644 --- a/src/Logger/TaskLogger.php +++ b/src/Logger/TaskLogger.php @@ -13,6 +13,9 @@ namespace CleverAge\ProcessBundle\Logger; +/** + * @internal + */ class TaskLogger extends AbstractLogger { } diff --git a/src/Logger/TaskProcessor.php b/src/Logger/TaskProcessor.php index 374c5e46..04069eb0 100644 --- a/src/Logger/TaskProcessor.php +++ b/src/Logger/TaskProcessor.php @@ -15,6 +15,9 @@ use Monolog\LogRecord; +/** + * @internal + */ class TaskProcessor extends AbstractProcessor { #[\Override] diff --git a/src/Logger/TransformerProcessor.php b/src/Logger/TransformerProcessor.php index b296b016..eb87be3d 100644 --- a/src/Logger/TransformerProcessor.php +++ b/src/Logger/TransformerProcessor.php @@ -15,6 +15,9 @@ use Monolog\LogRecord; +/** + * @internal + */ class TransformerProcessor extends AbstractProcessor { #[\Override] diff --git a/src/Manager/ProcessManager.php b/src/Manager/ProcessManager.php index 2ea3579a..0ebf3e51 100644 --- a/src/Manager/ProcessManager.php +++ b/src/Manager/ProcessManager.php @@ -38,6 +38,8 @@ /** * Execute processes. + * + * @final since 5.4 */ class ProcessManager { diff --git a/src/Model/ProcessHistory.php b/src/Model/ProcessHistory.php index de7c51e5..5cf7d050 100644 --- a/src/Model/ProcessHistory.php +++ b/src/Model/ProcessHistory.php @@ -17,6 +17,8 @@ /** * Logs information about a process. + * + * @final since 5.4 */ class ProcessHistory implements \Stringable { diff --git a/src/Model/ProcessState.php b/src/Model/ProcessState.php index d34c2b29..bfd691b1 100644 --- a/src/Model/ProcessState.php +++ b/src/Model/ProcessState.php @@ -19,6 +19,8 @@ /** * Used to pass information between tasks. + * + * @final since 5.4 */ class ProcessState { @@ -298,6 +300,7 @@ public function setContext(array $context): void /** * @return array|null */ + // @phpstan-ignore return.unusedType (narrowing the return type of a non-final class breaks the child classes, see #279) public function getContextualizedOptions(): ?array { if (!$this->contextualizedOptions) { diff --git a/src/Model/SubprocessInstance.php b/src/Model/SubprocessInstance.php index 18b074af..983f6383 100644 --- a/src/Model/SubprocessInstance.php +++ b/src/Model/SubprocessInstance.php @@ -19,6 +19,9 @@ use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; +/** + * @final since 5.4 + */ class SubprocessInstance { final public const OPTION_JSON_BUFFERING = 'json-buffering'; diff --git a/src/Registry/ProcessConfigurationRegistry.php b/src/Registry/ProcessConfigurationRegistry.php index 1e057aba..848cea51 100644 --- a/src/Registry/ProcessConfigurationRegistry.php +++ b/src/Registry/ProcessConfigurationRegistry.php @@ -21,6 +21,8 @@ /** * Build and holds all the process configurations. + * + * @final since 5.4 */ class ProcessConfigurationRegistry { diff --git a/src/Registry/TaskRegistry.php b/src/Registry/TaskRegistry.php index 5d77271a..ba000ab3 100644 --- a/src/Registry/TaskRegistry.php +++ b/src/Registry/TaskRegistry.php @@ -24,7 +24,7 @@ * (see TaskLocatorCompilerPass). The fallback container is only used, with a deprecation, for services that are not * in the locator (e.g. a process configuration added at runtime). */ -class TaskRegistry +final class TaskRegistry { public function __construct( protected ContainerInterface $locator, diff --git a/src/Registry/TransformerRegistry.php b/src/Registry/TransformerRegistry.php index 8d11f5d0..db4d5999 100644 --- a/src/Registry/TransformerRegistry.php +++ b/src/Registry/TransformerRegistry.php @@ -23,6 +23,8 @@ * The transformer services are fetched lazily from a service locator indexed by code (`code` attribute of the * `cleverage.transformer` tag, or `#[AsTransformer]`, see TransformerLocatorCompilerPass): a transformer is only * instantiated when it is used. + * + * @final since 5.4 */ class TransformerRegistry { diff --git a/src/Task/AggregateIterableTask.php b/src/Task/AggregateIterableTask.php index bc87bf34..cf67d36d 100644 --- a/src/Task/AggregateIterableTask.php +++ b/src/Task/AggregateIterableTask.php @@ -20,6 +20,8 @@ * Class AggregateIterableTask. * * Aggregate the result of iterable tasks in an array + * + * @final since 5.4 */ class AggregateIterableTask implements BlockingTaskInterface { diff --git a/src/Task/ArrayMergeTask.php b/src/Task/ArrayMergeTask.php index 93a2ebb5..452e5e0d 100644 --- a/src/Task/ArrayMergeTask.php +++ b/src/Task/ArrayMergeTask.php @@ -20,6 +20,8 @@ /** * Merge every input array, and return the result. + * + * @final since 5.4 */ class ArrayMergeTask extends AbstractConfigurableTask implements BlockingTaskInterface { diff --git a/src/Task/ColumnAggregatorTask.php b/src/Task/ColumnAggregatorTask.php index b3feaf21..031e3211 100644 --- a/src/Task/ColumnAggregatorTask.php +++ b/src/Task/ColumnAggregatorTask.php @@ -24,6 +24,8 @@ /** * For each configured column, collect the input rows that contain this column (and match the optional condition), and * output all the groups once all previous tasks are resolved. + * + * @final since 5.4 */ class ColumnAggregatorTask extends AbstractConfigurableTask implements BlockingTaskInterface { diff --git a/src/Task/ConstantIterableOutputTask.php b/src/Task/ConstantIterableOutputTask.php index 60eeeb56..5ba589b9 100644 --- a/src/Task/ConstantIterableOutputTask.php +++ b/src/Task/ConstantIterableOutputTask.php @@ -18,6 +18,8 @@ /** * Always send the same output regardless of the input, only accepts array for values and iterate over it. + * + * @final since 5.4 */ class ConstantIterableOutputTask extends AbstractIterableOutputTask { diff --git a/src/Task/ConstantOutputTask.php b/src/Task/ConstantOutputTask.php index 7037cafa..9a820a2a 100644 --- a/src/Task/ConstantOutputTask.php +++ b/src/Task/ConstantOutputTask.php @@ -19,6 +19,8 @@ /** * Always send the same output regardless of the input. + * + * @final since 5.4 */ class ConstantOutputTask extends AbstractConfigurableTask { diff --git a/src/Task/CounterTask.php b/src/Task/CounterTask.php index 12e2a650..313ea676 100644 --- a/src/Task/CounterTask.php +++ b/src/Task/CounterTask.php @@ -21,6 +21,8 @@ /** * Count the number of times the task is processed and continue every N iteration (skip the rest of the time) * Flush at the end with the actual count. + * + * @final since 5.4 */ class CounterTask extends AbstractConfigurableTask implements FlushableTaskInterface { diff --git a/src/Task/Debug/DebugTask.php b/src/Task/Debug/DebugTask.php index 9020262d..9c71e678 100644 --- a/src/Task/Debug/DebugTask.php +++ b/src/Task/Debug/DebugTask.php @@ -19,6 +19,8 @@ /** * Dump the content of the input. + * + * @final since 5.4 */ class DebugTask implements TaskInterface { diff --git a/src/Task/Debug/DieTask.php b/src/Task/Debug/DieTask.php index b8625914..6b346c69 100644 --- a/src/Task/Debug/DieTask.php +++ b/src/Task/Debug/DieTask.php @@ -20,6 +20,8 @@ * Class DieTask. * * Stops the process brutally + * + * @final since 5.4 */ class DieTask implements TaskInterface { diff --git a/src/Task/Debug/ErrorForwarderTask.php b/src/Task/Debug/ErrorForwarderTask.php index 9dbc1da8..9d2684d3 100644 --- a/src/Task/Debug/ErrorForwarderTask.php +++ b/src/Task/Debug/ErrorForwarderTask.php @@ -19,6 +19,8 @@ /** * This is a dummy task mostly intended for testing purpose. * Forward any input to the error output. + * + * @final since 5.4 */ class ErrorForwarderTask implements TaskInterface { diff --git a/src/Task/Debug/StopwatchTask.php b/src/Task/Debug/StopwatchTask.php index 160db265..eb972e93 100644 --- a/src/Task/Debug/StopwatchTask.php +++ b/src/Task/Debug/StopwatchTask.php @@ -20,6 +20,8 @@ /** * Log all the __root__ events of the Stopwatch component. + * + * @final since 5.4 */ class StopwatchTask implements TaskInterface { diff --git a/src/Task/DummyTask.php b/src/Task/DummyTask.php index 7cb1bcae..dda70f59 100644 --- a/src/Task/DummyTask.php +++ b/src/Task/DummyTask.php @@ -18,6 +18,8 @@ /** * Dummy task that pass the input to the output. + * + * @final since 5.4 */ class DummyTask implements TaskInterface { diff --git a/src/Task/Event/EventDispatcherTask.php b/src/Task/Event/EventDispatcherTask.php index 1e092e16..d8c02a34 100644 --- a/src/Task/Event/EventDispatcherTask.php +++ b/src/Task/Event/EventDispatcherTask.php @@ -22,6 +22,8 @@ /** * Call the Symfony event dispatcher * If defined as passive (which is the default), it automatically set the output from the input. + * + * @final since 5.4 */ class EventDispatcherTask extends AbstractConfigurableTask { diff --git a/src/Task/File/Csv/CsvSplitterTask.php b/src/Task/File/Csv/CsvSplitterTask.php index a7803ec5..cdc76dfd 100644 --- a/src/Task/File/Csv/CsvSplitterTask.php +++ b/src/Task/File/Csv/CsvSplitterTask.php @@ -20,6 +20,8 @@ /** * Split long CSV files into smaller ones, keeping the headers. + * + * @final since 5.4 */ class CsvSplitterTask extends InputCsvReaderTask { diff --git a/src/Task/File/Csv/CsvWriterTask.php b/src/Task/File/Csv/CsvWriterTask.php index 2e36324c..003bd313 100644 --- a/src/Task/File/Csv/CsvWriterTask.php +++ b/src/Task/File/Csv/CsvWriterTask.php @@ -24,6 +24,8 @@ * Ignores any input. * * @property CsvFile $csv + * + * @final since 5.4 */ class CsvWriterTask extends AbstractCsvTask implements BlockingTaskInterface { diff --git a/src/Task/File/FileMoverTask.php b/src/Task/File/FileMoverTask.php index 6c5c334a..5d9c4f1f 100644 --- a/src/Task/File/FileMoverTask.php +++ b/src/Task/File/FileMoverTask.php @@ -20,6 +20,8 @@ /** * Move the file passed as input, requires the destination path in options. + * + * @final since 5.4 */ class FileMoverTask extends AbstractConfigurableTask { diff --git a/src/Task/File/FileRemoverTask.php b/src/Task/File/FileRemoverTask.php index dda53166..298b8f23 100644 --- a/src/Task/File/FileRemoverTask.php +++ b/src/Task/File/FileRemoverTask.php @@ -19,6 +19,8 @@ /** * Simply delete the file passed as input. + * + * @final since 5.4 */ class FileRemoverTask implements TaskInterface { diff --git a/src/Task/File/FileSplitterTask.php b/src/Task/File/FileSplitterTask.php index b455f8d3..f2a4fcb0 100644 --- a/src/Task/File/FileSplitterTask.php +++ b/src/Task/File/FileSplitterTask.php @@ -21,6 +21,8 @@ /** * Split long file into smaller ones. + * + * @final since 5.4 */ class FileSplitterTask extends AbstractConfigurableTask implements IterableTaskInterface { diff --git a/src/Task/File/FileWriterTask.php b/src/Task/File/FileWriterTask.php index 5378099b..2ae1351c 100644 --- a/src/Task/File/FileWriterTask.php +++ b/src/Task/File/FileWriterTask.php @@ -18,6 +18,9 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class FileWriterTask extends AbstractConfigurableTask { public function execute(ProcessState $state): void diff --git a/src/Task/File/InputFileReaderTask.php b/src/Task/File/InputFileReaderTask.php index 9d002370..61a32646 100644 --- a/src/Task/File/InputFileReaderTask.php +++ b/src/Task/File/InputFileReaderTask.php @@ -18,6 +18,8 @@ /** * Reads the whole input file and outputs its content. + * + * @final since 5.4 */ class InputFileReaderTask extends FileReaderTask { diff --git a/src/Task/File/InputFolderBrowserTask.php b/src/Task/File/InputFolderBrowserTask.php index ae7a98d3..a1d5ebd9 100644 --- a/src/Task/File/InputFolderBrowserTask.php +++ b/src/Task/File/InputFolderBrowserTask.php @@ -20,6 +20,8 @@ /** * Browse a folder with the path as an input and iterate each file for output. + * + * @final since 5.4 */ class InputFolderBrowserTask extends FolderBrowserTask implements FlushableTaskInterface { diff --git a/src/Task/File/InputLineReaderTask.php b/src/Task/File/InputLineReaderTask.php index 1737f404..c1f59ab7 100644 --- a/src/Task/File/InputLineReaderTask.php +++ b/src/Task/File/InputLineReaderTask.php @@ -18,6 +18,8 @@ /** * Reads an input file line by line and outputs each line. + * + * @final since 5.4 */ class InputLineReaderTask extends LineReaderTask { diff --git a/src/Task/File/JsonStream/JsonStreamReaderTask.php b/src/Task/File/JsonStream/JsonStreamReaderTask.php index 946a48a3..bbde165f 100644 --- a/src/Task/File/JsonStream/JsonStreamReaderTask.php +++ b/src/Task/File/JsonStream/JsonStreamReaderTask.php @@ -19,6 +19,9 @@ use CleverAge\ProcessBundle\Model\ProcessState; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class JsonStreamReaderTask extends AbstractConfigurableTask implements IterableTaskInterface { protected ?JsonStreamFile $file = null; diff --git a/src/Task/File/JsonStream/JsonStreamWriterTask.php b/src/Task/File/JsonStream/JsonStreamWriterTask.php index 4518dc35..66ca932d 100644 --- a/src/Task/File/JsonStream/JsonStreamWriterTask.php +++ b/src/Task/File/JsonStream/JsonStreamWriterTask.php @@ -21,6 +21,9 @@ use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class JsonStreamWriterTask extends AbstractConfigurableTask implements BlockingTaskInterface, FinalizableTaskInterface { protected ?JsonStreamFile $file = null; diff --git a/src/Task/File/Xml/XmlReaderTask.php b/src/Task/File/Xml/XmlReaderTask.php index 236420a1..0878b6b2 100644 --- a/src/Task/File/Xml/XmlReaderTask.php +++ b/src/Task/File/Xml/XmlReaderTask.php @@ -21,6 +21,8 @@ /** * Read an XML file. + * + * @final since 5.4 */ class XmlReaderTask extends AbstractConfigurableTask { diff --git a/src/Task/File/Xml/XmlStreamReaderTask.php b/src/Task/File/Xml/XmlStreamReaderTask.php index 688bc79c..9ba741a3 100644 --- a/src/Task/File/Xml/XmlStreamReaderTask.php +++ b/src/Task/File/Xml/XmlStreamReaderTask.php @@ -21,6 +21,8 @@ /** * Read an XML file element by element with \XMLReader, so that the whole file is never loaded in memory. + * + * @final since 5.4 */ class XmlStreamReaderTask extends AbstractConfigurableTask implements IterableTaskInterface, FinalizableTaskInterface { diff --git a/src/Task/File/Xml/XmlWriterTask.php b/src/Task/File/Xml/XmlWriterTask.php index 6c88226a..314021d8 100644 --- a/src/Task/File/Xml/XmlWriterTask.php +++ b/src/Task/File/Xml/XmlWriterTask.php @@ -21,6 +21,8 @@ /** * Write an XML file. + * + * @final since 5.4 */ class XmlWriterTask extends AbstractConfigurableTask { diff --git a/src/Task/File/Yaml/YamlReaderTask.php b/src/Task/File/Yaml/YamlReaderTask.php index 13277cf1..f6b9e92b 100644 --- a/src/Task/File/Yaml/YamlReaderTask.php +++ b/src/Task/File/Yaml/YamlReaderTask.php @@ -21,6 +21,8 @@ /** * Reads a YAML file and iterate over its root elements. + * + * @final since 5.4 */ class YamlReaderTask extends AbstractIterableOutputTask { diff --git a/src/Task/File/Yaml/YamlWriterTask.php b/src/Task/File/Yaml/YamlWriterTask.php index f557cae2..a2776224 100644 --- a/src/Task/File/Yaml/YamlWriterTask.php +++ b/src/Task/File/Yaml/YamlWriterTask.php @@ -20,6 +20,8 @@ /** * Writes a YAML file from an array. + * + * @final since 5.4 */ class YamlWriterTask extends AbstractConfigurableTask { diff --git a/src/Task/FilterTask.php b/src/Task/FilterTask.php index 1bbb3b37..ac7f2c9c 100644 --- a/src/Task/FilterTask.php +++ b/src/Task/FilterTask.php @@ -23,6 +23,8 @@ * Skip inputs under given matching conditions * - equality is strictly checked * - unexisting key is the same as null. + * + * @final since 5.4 */ class FilterTask extends AbstractConfigurableTask { diff --git a/src/Task/GroupByAggregateIterableTask.php b/src/Task/GroupByAggregateIterableTask.php index 6891add0..73b35f91 100644 --- a/src/Task/GroupByAggregateIterableTask.php +++ b/src/Task/GroupByAggregateIterableTask.php @@ -22,6 +22,8 @@ /** * Attempt to aggregate inputs in an associative array with a key formed by configurable fields of the input. * This task could be used to remove duplicates from the aggregate. + * + * @final since 5.4 */ class GroupByAggregateIterableTask extends AbstractConfigurableTask implements BlockingTaskInterface { diff --git a/src/Task/InputIteratorTask.php b/src/Task/InputIteratorTask.php index 4af27f80..c9618bf5 100644 --- a/src/Task/InputIteratorTask.php +++ b/src/Task/InputIteratorTask.php @@ -17,6 +17,8 @@ /** * Iterates from the input of the previous task. + * + * @final since 5.4 */ class InputIteratorTask extends AbstractIterableOutputTask { diff --git a/src/Task/IterableBatchTask.php b/src/Task/IterableBatchTask.php index ec247ccc..457d8525 100644 --- a/src/Task/IterableBatchTask.php +++ b/src/Task/IterableBatchTask.php @@ -23,6 +23,8 @@ /** * A Batch task that iterate on flush * It's mainly an example task since it's not useful as-is, but the processInput method may allow custom overrides. + * + * @final since 5.4 */ class IterableBatchTask extends AbstractConfigurableTask implements FlushableTaskInterface, IterableTaskInterface { diff --git a/src/Task/ObjectUpdaterTask.php b/src/Task/ObjectUpdaterTask.php index 0490a249..b62b1ab4 100644 --- a/src/Task/ObjectUpdaterTask.php +++ b/src/Task/ObjectUpdaterTask.php @@ -21,6 +21,8 @@ /** * Takes an array containing an object and a value updates an object's property with this value, then return the object. + * + * @final since 5.4 */ class ObjectUpdaterTask extends AbstractConfigurableTask { diff --git a/src/Task/Process/CommandRunnerTask.php b/src/Task/Process/CommandRunnerTask.php index 7e0ade0a..9482d8eb 100644 --- a/src/Task/Process/CommandRunnerTask.php +++ b/src/Task/Process/CommandRunnerTask.php @@ -21,6 +21,8 @@ /** * Launch a system command for each input, passing input to command. + * + * @final since 5.4 */ class CommandRunnerTask extends AbstractConfigurableTask { diff --git a/src/Task/Process/ProcessExecutorTask.php b/src/Task/Process/ProcessExecutorTask.php index 64a0424c..f9531ab3 100644 --- a/src/Task/Process/ProcessExecutorTask.php +++ b/src/Task/Process/ProcessExecutorTask.php @@ -25,6 +25,8 @@ /** * Execute a process for each input: the input is passed to the process entry point, and the output of its end point * becomes the task output. + * + * @final since 5.4 */ class ProcessExecutorTask extends AbstractConfigurableTask { diff --git a/src/Task/Process/ProcessLauncherTask.php b/src/Task/Process/ProcessLauncherTask.php index 82cdb58d..c066239d 100644 --- a/src/Task/Process/ProcessLauncherTask.php +++ b/src/Task/Process/ProcessLauncherTask.php @@ -27,6 +27,8 @@ /** * Launch a new process for each input received, input must be a scalar, a resource or a \Traversable. + * + * @final since 5.4 */ class ProcessLauncherTask extends AbstractConfigurableTask implements FlushableTaskInterface, IterableTaskInterface { diff --git a/src/Task/PropertyGetterTask.php b/src/Task/PropertyGetterTask.php index b5e4c0e8..8e3352a4 100644 --- a/src/Task/PropertyGetterTask.php +++ b/src/Task/PropertyGetterTask.php @@ -21,6 +21,8 @@ /** * Get a property on the input and return it with PropertyAccessor. + * + * @final since 5.4 */ class PropertyGetterTask extends AbstractConfigurableTask { diff --git a/src/Task/PropertySetterTask.php b/src/Task/PropertySetterTask.php index 9fcb767d..ed5088d9 100644 --- a/src/Task/PropertySetterTask.php +++ b/src/Task/PropertySetterTask.php @@ -21,6 +21,8 @@ /** * Accepts an object or an array as input and sets values from configuration. + * + * @final since 5.4 */ class PropertySetterTask extends AbstractConfigurableTask { diff --git a/src/Task/Reporting/AdvancedStatCounterTask.php b/src/Task/Reporting/AdvancedStatCounterTask.php index a4a87ce0..5e8018e1 100644 --- a/src/Task/Reporting/AdvancedStatCounterTask.php +++ b/src/Task/Reporting/AdvancedStatCounterTask.php @@ -20,6 +20,8 @@ /** * Count the time between 2 iterations, and log statistics every N executions. The input is passed to the output. + * + * @final since 5.4 */ class AdvancedStatCounterTask extends AbstractConfigurableTask { diff --git a/src/Task/Reporting/LoggerTask.php b/src/Task/Reporting/LoggerTask.php index f990a2c6..79e53dc4 100644 --- a/src/Task/Reporting/LoggerTask.php +++ b/src/Task/Reporting/LoggerTask.php @@ -23,6 +23,8 @@ * Class LoggerTask. * * Add custom log in state + * + * @final since 5.4 */ class LoggerTask extends AbstractConfigurableTask { diff --git a/src/Task/Reporting/StatCounterTask.php b/src/Task/Reporting/StatCounterTask.php index b394aa64..116f6632 100644 --- a/src/Task/Reporting/StatCounterTask.php +++ b/src/Task/Reporting/StatCounterTask.php @@ -19,6 +19,8 @@ /** * Count the number of times the task was executed, and log it when the process ends. The input is passed to the output. + * + * @final since 5.4 */ class StatCounterTask implements FinalizableTaskInterface { diff --git a/src/Task/RowAggregatorTask.php b/src/Task/RowAggregatorTask.php index f999982f..9989f841 100644 --- a/src/Task/RowAggregatorTask.php +++ b/src/Task/RowAggregatorTask.php @@ -24,6 +24,8 @@ * Group input rows sharing the same value for the "aggregate_by" column. Each group is made of the first received row * (without the "aggregate_columns"), plus a sub-array under "aggregation_key" listing the "aggregate_columns" values of * every row of the group. The groups are output once all previous tasks are resolved. + * + * @final since 5.4 */ class RowAggregatorTask extends AbstractConfigurableTask implements BlockingTaskInterface { diff --git a/src/Task/Serialization/DenormalizerTask.php b/src/Task/Serialization/DenormalizerTask.php index 6edecc00..8b18ad76 100644 --- a/src/Task/Serialization/DenormalizerTask.php +++ b/src/Task/Serialization/DenormalizerTask.php @@ -20,6 +20,8 @@ /** * Denormalize input to output with configurable class and format. + * + * @final since 5.4 */ class DenormalizerTask extends AbstractConfigurableTask { diff --git a/src/Task/Serialization/DeserializerTask.php b/src/Task/Serialization/DeserializerTask.php index 9035d1d9..1d4b70ee 100644 --- a/src/Task/Serialization/DeserializerTask.php +++ b/src/Task/Serialization/DeserializerTask.php @@ -18,6 +18,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; +/** + * @final since 5.4 + */ class DeserializerTask extends AbstractConfigurableTask { public function __construct( diff --git a/src/Task/Serialization/NormalizerTask.php b/src/Task/Serialization/NormalizerTask.php index f7126ac9..6cd8c52a 100644 --- a/src/Task/Serialization/NormalizerTask.php +++ b/src/Task/Serialization/NormalizerTask.php @@ -20,6 +20,8 @@ /** * Normalize input to output with configurable format. + * + * @final since 5.4 */ class NormalizerTask extends AbstractConfigurableTask { diff --git a/src/Task/Serialization/SerializerTask.php b/src/Task/Serialization/SerializerTask.php index 90953452..8293feda 100644 --- a/src/Task/Serialization/SerializerTask.php +++ b/src/Task/Serialization/SerializerTask.php @@ -18,6 +18,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Serializer\SerializerInterface; +/** + * @final since 5.4 + */ class SerializerTask extends AbstractConfigurableTask { public function __construct( diff --git a/src/Task/SimpleBatchTask.php b/src/Task/SimpleBatchTask.php index 8f711c20..b5245cf6 100644 --- a/src/Task/SimpleBatchTask.php +++ b/src/Task/SimpleBatchTask.php @@ -20,6 +20,8 @@ /** * Simple example of how to manage an internal buffer for batch processing. + * + * @final since 5.4 */ class SimpleBatchTask extends AbstractConfigurableTask implements FlushableTaskInterface { diff --git a/src/Task/SkipEmptyTask.php b/src/Task/SkipEmptyTask.php index 1663e28f..dc1c0892 100644 --- a/src/Task/SkipEmptyTask.php +++ b/src/Task/SkipEmptyTask.php @@ -19,6 +19,8 @@ /** * Allow to skip the execution on empty input. * Useful when combined with an aggregator task. + * + * @final since 5.4 */ class SkipEmptyTask implements TaskInterface { diff --git a/src/Task/SplitJoinLineTask.php b/src/Task/SplitJoinLineTask.php index 91eb06a1..55bffd4c 100644 --- a/src/Task/SplitJoinLineTask.php +++ b/src/Task/SplitJoinLineTask.php @@ -18,6 +18,8 @@ /** * Split a single line into multiple lines based on multiple columns and split characters. + * + * @final since 5.4 */ class SplitJoinLineTask extends AbstractIterableOutputTask { diff --git a/src/Task/StopTask.php b/src/Task/StopTask.php index c8945cd8..6d1aba2f 100644 --- a/src/Task/StopTask.php +++ b/src/Task/StopTask.php @@ -18,6 +18,8 @@ /** * Allows to directly stop a process, marking it as failed. + * + * @final since 5.4 */ class StopTask implements TaskInterface { diff --git a/src/Task/TransformerTask.php b/src/Task/TransformerTask.php index f04d8832..ef61f821 100644 --- a/src/Task/TransformerTask.php +++ b/src/Task/TransformerTask.php @@ -24,6 +24,8 @@ /** * Transform an array of data based on mapping and sub-transformers. + * + * @final since 5.4 */ class TransformerTask extends AbstractConfigurableTask { diff --git a/src/Task/Validation/ValidatorTask.php b/src/Task/Validation/ValidatorTask.php index ae7510b6..68770945 100644 --- a/src/Task/Validation/ValidatorTask.php +++ b/src/Task/Validation/ValidatorTask.php @@ -25,6 +25,8 @@ /** * Validate the input and pass it to the output. + * + * @final since 5.4 */ class ValidatorTask extends AbstractConfigurableTask { diff --git a/src/Transformer/Array/ArrayElementTransformer.php b/src/Transformer/Array/ArrayElementTransformer.php index 093e29d5..b0ea76b3 100644 --- a/src/Transformer/Array/ArrayElementTransformer.php +++ b/src/Transformer/Array/ArrayElementTransformer.php @@ -18,6 +18,8 @@ /** * Return the nth element of an array. + * + * @final since 5.4 */ class ArrayElementTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Array/ArrayFilterTransformer.php b/src/Transformer/Array/ArrayFilterTransformer.php index 198d3b1b..e6424224 100644 --- a/src/Transformer/Array/ArrayFilterTransformer.php +++ b/src/Transformer/Array/ArrayFilterTransformer.php @@ -22,6 +22,8 @@ * Array filtering transformer, should match native array_filter behavior. * * @see https://secure.php.net/manual/fr/function.array-filter.php + * + * @final since 5.4 */ class ArrayFilterTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Array/ArrayFirstTransformer.php b/src/Transformer/Array/ArrayFirstTransformer.php index 6a8a61fd..c8729473 100644 --- a/src/Transformer/Array/ArrayFirstTransformer.php +++ b/src/Transformer/Array/ArrayFirstTransformer.php @@ -18,6 +18,8 @@ /** * Return the first element of an array. + * + * @final since 5.4 */ class ArrayFirstTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Array/ArrayLastTransformer.php b/src/Transformer/Array/ArrayLastTransformer.php index 6a3c477f..a67ce257 100644 --- a/src/Transformer/Array/ArrayLastTransformer.php +++ b/src/Transformer/Array/ArrayLastTransformer.php @@ -17,6 +17,8 @@ /** * Return the last element of an array. + * + * @final since 5.4 */ class ArrayLastTransformer implements TransformerInterface { diff --git a/src/Transformer/Array/ArrayMapTransformer.php b/src/Transformer/Array/ArrayMapTransformer.php index e878021d..0ab0ff0e 100644 --- a/src/Transformer/Array/ArrayMapTransformer.php +++ b/src/Transformer/Array/ArrayMapTransformer.php @@ -21,6 +21,8 @@ /** * Applies transformers to each element of an array. + * + * @final since 5.4 */ class ArrayMapTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Array/ArrayUnsetTransformer.php b/src/Transformer/Array/ArrayUnsetTransformer.php index 51d6b400..0c5da954 100644 --- a/src/Transformer/Array/ArrayUnsetTransformer.php +++ b/src/Transformer/Array/ArrayUnsetTransformer.php @@ -18,6 +18,8 @@ /** * Unset a key from an array. + * + * @final since 5.4 */ class ArrayUnsetTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/CachedTransformer.php b/src/Transformer/CachedTransformer.php index eb6ea962..df74fea7 100644 --- a/src/Transformer/CachedTransformer.php +++ b/src/Transformer/CachedTransformer.php @@ -21,6 +21,9 @@ use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class CachedTransformer implements ConfigurableTransformerInterface { use TransformerTrait; diff --git a/src/Transformer/CallbackTransformer.php b/src/Transformer/CallbackTransformer.php index 2f17ef03..42a65817 100644 --- a/src/Transformer/CallbackTransformer.php +++ b/src/Transformer/CallbackTransformer.php @@ -19,6 +19,8 @@ /** * Convert input based on a callback. + * + * @final since 5.4 */ class CallbackTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/CastTransformer.php b/src/Transformer/CastTransformer.php index 7778ec04..ed60773d 100644 --- a/src/Transformer/CastTransformer.php +++ b/src/Transformer/CastTransformer.php @@ -17,6 +17,8 @@ /** * Cast a value to a different PHP type. + * + * @final since 5.4 */ class CastTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/ConstantTransformer.php b/src/Transformer/ConstantTransformer.php index 7f3c34d2..b4ca3d8e 100644 --- a/src/Transformer/ConstantTransformer.php +++ b/src/Transformer/ConstantTransformer.php @@ -18,6 +18,8 @@ /** * Return always the same value configured in options, redundant when used inside mapping except in certain useful * circumstances. + * + * @final since 5.4 */ class ConstantTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/ConvertValueTransformer.php b/src/Transformer/ConvertValueTransformer.php index 84579531..0548c7af 100644 --- a/src/Transformer/ConvertValueTransformer.php +++ b/src/Transformer/ConvertValueTransformer.php @@ -17,6 +17,8 @@ /** * Transform a value to another value based on a conversion table. + * + * @final since 5.4 */ class ConvertValueTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Date/DateFormatTransformer.php b/src/Transformer/Date/DateFormatTransformer.php index bdd5cecc..18cc0488 100644 --- a/src/Transformer/Date/DateFormatTransformer.php +++ b/src/Transformer/Date/DateFormatTransformer.php @@ -23,6 +23,8 @@ * transformers: * date_format: * format: Y-m-d + * + * @final since 5.4 */ class DateFormatTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Date/DateParserTransformer.php b/src/Transformer/Date/DateParserTransformer.php index cb5ade3f..ec197dcc 100644 --- a/src/Transformer/Date/DateParserTransformer.php +++ b/src/Transformer/Date/DateParserTransformer.php @@ -23,6 +23,8 @@ * transformers: * date_parser: * format: Y-m-d + * + * @final since 5.4 */ class DateParserTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/DebugTransformer.php b/src/Transformer/DebugTransformer.php index 2d528b09..35a8d661 100644 --- a/src/Transformer/DebugTransformer.php +++ b/src/Transformer/DebugTransformer.php @@ -17,6 +17,8 @@ /** * Simple dump in a transformer, passthrough for value. + * + * @final since 5.4 */ class DebugTransformer implements TransformerInterface { diff --git a/src/Transformer/DefaultTransformer.php b/src/Transformer/DefaultTransformer.php index f83effd0..fb1cfdee 100644 --- a/src/Transformer/DefaultTransformer.php +++ b/src/Transformer/DefaultTransformer.php @@ -17,6 +17,8 @@ /** * Return a default value when the input is falsy, otherwise return the input unchanged. + * + * @final since 5.4 */ class DefaultTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/EvaluatorTransformer.php b/src/Transformer/EvaluatorTransformer.php index a0ecdeb4..09da6071 100644 --- a/src/Transformer/EvaluatorTransformer.php +++ b/src/Transformer/EvaluatorTransformer.php @@ -18,6 +18,9 @@ use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class EvaluatorTransformer implements ConfigurableTransformerInterface { protected ExpressionLanguage $language; diff --git a/src/Transformer/ExpressionLanguageMapTransformer.php b/src/Transformer/ExpressionLanguageMapTransformer.php index 5ea27bff..4289429b 100644 --- a/src/Transformer/ExpressionLanguageMapTransformer.php +++ b/src/Transformer/ExpressionLanguageMapTransformer.php @@ -20,6 +20,8 @@ /** * Parse an input using the Expression Language and returning a specific value upon a specific condition. + * + * @final since 5.4 */ class ExpressionLanguageMapTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/GenericTransformer.php b/src/Transformer/GenericTransformer.php index 9a2a6bb9..283a1b3c 100644 --- a/src/Transformer/GenericTransformer.php +++ b/src/Transformer/GenericTransformer.php @@ -20,6 +20,8 @@ /** * A generic class that can be used to create configuration-driven transformer instances. + * + * @final since 5.4 */ class GenericTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/MappingTransformer.php b/src/Transformer/MappingTransformer.php index 8076ae2a..050bd9e4 100644 --- a/src/Transformer/MappingTransformer.php +++ b/src/Transformer/MappingTransformer.php @@ -24,6 +24,8 @@ /** * Maps properties of an array/object to an other array/object. + * + * @final since 5.4 */ class MappingTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/MultiReplaceTransformer.php b/src/Transformer/MultiReplaceTransformer.php index 849baf12..8c352dee 100644 --- a/src/Transformer/MultiReplaceTransformer.php +++ b/src/Transformer/MultiReplaceTransformer.php @@ -21,6 +21,8 @@ * ##### Options * * * `replace_mapping` (`array`, _required_): a list of _pattern_ => _replacement_ to apply on input strings + * + * @final since 5.4 */ class MultiReplaceTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Object/InstantiateTransformer.php b/src/Transformer/Object/InstantiateTransformer.php index 902ce037..8fd61771 100644 --- a/src/Transformer/Object/InstantiateTransformer.php +++ b/src/Transformer/Object/InstantiateTransformer.php @@ -18,6 +18,8 @@ /** * Instantiate a new object with parameters from the input array. + * + * @final since 5.4 */ class InstantiateTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Object/PropertyAccessorTransformer.php b/src/Transformer/Object/PropertyAccessorTransformer.php index 84497815..b783c5d8 100644 --- a/src/Transformer/Object/PropertyAccessorTransformer.php +++ b/src/Transformer/Object/PropertyAccessorTransformer.php @@ -19,6 +19,8 @@ /** * Read a property from the input value and return it. + * + * @final since 5.4 */ class PropertyAccessorTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Object/RecursivePropertySetterTransformer.php b/src/Transformer/Object/RecursivePropertySetterTransformer.php index 1402b6aa..963dfd9e 100644 --- a/src/Transformer/Object/RecursivePropertySetterTransformer.php +++ b/src/Transformer/Object/RecursivePropertySetterTransformer.php @@ -22,6 +22,8 @@ /** * Read an iterable from the input, then set one or more properties on each of its items, using values read from the * input itself. + * + * @final since 5.4 */ class RecursivePropertySetterTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/PregFilterTransformer.php b/src/Transformer/PregFilterTransformer.php index 9aa3aabf..cba994d2 100644 --- a/src/Transformer/PregFilterTransformer.php +++ b/src/Transformer/PregFilterTransformer.php @@ -17,6 +17,9 @@ use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class PregFilterTransformer implements ConfigurableTransformerInterface { /** @@ -24,6 +27,7 @@ class PregFilterTransformer implements ConfigurableTransformerInterface * * @return array|string|null */ + // @phpstan-ignore return.unusedType (narrowing the return type of a non-final class breaks the child classes, see #279) public function transform(mixed $value, array $options = []): array|string|null { $pattern = $options['pattern']; diff --git a/src/Transformer/RulesTransformer.php b/src/Transformer/RulesTransformer.php index 048d4c66..4efd5041 100644 --- a/src/Transformer/RulesTransformer.php +++ b/src/Transformer/RulesTransformer.php @@ -21,6 +21,8 @@ /** * Uses a set of rules to conditionally transform a value. + * + * @final since 5.4 */ class RulesTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Serialization/DenormalizeTransformer.php b/src/Transformer/Serialization/DenormalizeTransformer.php index 3e6526a6..36854da9 100644 --- a/src/Transformer/Serialization/DenormalizeTransformer.php +++ b/src/Transformer/Serialization/DenormalizeTransformer.php @@ -19,6 +19,8 @@ /** * Denormalize the given value based on options. + * + * @final since 5.4 */ class DenormalizeTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/Serialization/NormalizeTransformer.php b/src/Transformer/Serialization/NormalizeTransformer.php index b71e038e..d7b6144c 100644 --- a/src/Transformer/Serialization/NormalizeTransformer.php +++ b/src/Transformer/Serialization/NormalizeTransformer.php @@ -19,6 +19,8 @@ /** * Normalize the given value based on options. + * + * @final since 5.4 */ class NormalizeTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/ExplodeTransformer.php b/src/Transformer/String/ExplodeTransformer.php index fd2e4be6..0c2021c0 100644 --- a/src/Transformer/String/ExplodeTransformer.php +++ b/src/Transformer/String/ExplodeTransformer.php @@ -18,6 +18,8 @@ /** * Explode a string to an array based on a split character. + * + * @final since 5.4 */ class ExplodeTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/HashTransformer.php b/src/Transformer/String/HashTransformer.php index b8422a41..4ad919a2 100644 --- a/src/Transformer/String/HashTransformer.php +++ b/src/Transformer/String/HashTransformer.php @@ -18,6 +18,8 @@ /** * Use hash() function to generate hash value. + * + * @final since 5.4 */ class HashTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/ImplodeTransformer.php b/src/Transformer/String/ImplodeTransformer.php index d60e7ac0..5a7a994c 100644 --- a/src/Transformer/String/ImplodeTransformer.php +++ b/src/Transformer/String/ImplodeTransformer.php @@ -18,6 +18,8 @@ /** * Implode multiple array values to a string, based on a split character. + * + * @final since 5.4 */ class ImplodeTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/PregMatchTransformer.php b/src/Transformer/String/PregMatchTransformer.php index 38899f0e..f48da9cf 100644 --- a/src/Transformer/String/PregMatchTransformer.php +++ b/src/Transformer/String/PregMatchTransformer.php @@ -18,6 +18,8 @@ /** * Perform a regular expression match. + * + * @final since 5.4 */ class PregMatchTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/SlugifyTransformer.php b/src/Transformer/String/SlugifyTransformer.php index 81180ed3..dd5eaab2 100644 --- a/src/Transformer/String/SlugifyTransformer.php +++ b/src/Transformer/String/SlugifyTransformer.php @@ -20,6 +20,8 @@ /** * Slugify a value. + * + * @final since 5.4 */ class SlugifyTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/SprintfTransformer.php b/src/Transformer/String/SprintfTransformer.php index e87804ee..3b015248 100644 --- a/src/Transformer/String/SprintfTransformer.php +++ b/src/Transformer/String/SprintfTransformer.php @@ -18,6 +18,8 @@ /** * Use sprintf() function to format string. + * + * @final since 5.4 */ class SprintfTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/String/TrimTransformer.php b/src/Transformer/String/TrimTransformer.php index ad305cf9..8421a0fa 100644 --- a/src/Transformer/String/TrimTransformer.php +++ b/src/Transformer/String/TrimTransformer.php @@ -18,6 +18,8 @@ /** * Trim an input based on specific characters. + * + * @final since 5.4 */ class TrimTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/TypeSetterTransformer.php b/src/Transformer/TypeSetterTransformer.php index 35133e02..e8df1359 100644 --- a/src/Transformer/TypeSetterTransformer.php +++ b/src/Transformer/TypeSetterTransformer.php @@ -15,6 +15,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class TypeSetterTransformer implements ConfigurableTransformerInterface { public function configureOptions(OptionsResolver $resolver): void diff --git a/src/Transformer/UnsetTransformer.php b/src/Transformer/UnsetTransformer.php index 5b6caf76..2090d646 100644 --- a/src/Transformer/UnsetTransformer.php +++ b/src/Transformer/UnsetTransformer.php @@ -18,6 +18,8 @@ /** * Unset a given property. + * + * @final since 5.4 */ class UnsetTransformer implements ConfigurableTransformerInterface { diff --git a/src/Transformer/WrapperTransformer.php b/src/Transformer/WrapperTransformer.php index a3cd0b8d..a872f84a 100644 --- a/src/Transformer/WrapperTransformer.php +++ b/src/Transformer/WrapperTransformer.php @@ -15,6 +15,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; +/** + * @final since 5.4 + */ class WrapperTransformer implements ConfigurableTransformerInterface { /** diff --git a/src/Transformer/Xml/XpathEvaluatorTransformer.php b/src/Transformer/Xml/XpathEvaluatorTransformer.php index 5acbf351..f282e20d 100644 --- a/src/Transformer/Xml/XpathEvaluatorTransformer.php +++ b/src/Transformer/Xml/XpathEvaluatorTransformer.php @@ -19,6 +19,8 @@ /** * Manipulate XML elements using xpath. + * + * @final since 5.4 */ class XpathEvaluatorTransformer implements ConfigurableTransformerInterface { diff --git a/src/Validator/ConstraintLoader.php b/src/Validator/ConstraintLoader.php index b71c32ed..03b50053 100644 --- a/src/Validator/ConstraintLoader.php +++ b/src/Validator/ConstraintLoader.php @@ -16,6 +16,9 @@ use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AbstractLoader; +/** + * @final since 5.4 + */ class ConstraintLoader extends AbstractLoader { public function loadClassMetadata(ClassMetadata $metadata): bool