- #197 Add missing tests: every Task and Transformer is now covered by unit tests. Remove the obsolete
tests.olddirectory. - #143 Improve PHPStan configuration: remove all
ignoreErrorsand@phpstan-ignorecomments (report unmatched ignored errors again), add missing iterable value types and generic types in PHPDoc, remove unreachable code in AbstractIterableOutputTask and InputAggregatorTask. - #143 Improve PHPStan level from 6 to 7, and fix the level 8 errors that do not require a signature change (the remaining ones, due to nullable return types such as
AbstractConfigurableTask::getOptions(): ?array, will be fixed in v6.0). Default to aContextualOptionResolverin ProcessState and to a property accessor in ConditionTrait when none is set. - #94 TransformerTrait: the
transformersoption (TransformerTask, MappingTransformer, ArrayMapTransformer, CachedTransformer, RulesTransformer, generic transformers) also accepts a list, whose items are a transformer code without options (- trim) or a singlecode: optionsmap (- callback: {...}), to chain the same transformer without#suffix. The map syntax is still supported. Update documentation, add tests. - #117 MappingTransformer: writing a target property that is a nested path (e.g.
address.city) on an array destination, which silently created anaddress.cityliteral key, is deprecated and will throw an\UnexpectedValueExceptionin v6.0. Use[address.city]for a literal key or[address][city]for a nested array; a simple property name (e.g.name) is still added as a key. Update documentation, add tests.
- #143 Fix InputIteratorTask: an
\IteratorAggregateinput whosegetIterator()does not return an\Iterator(e.g. another\IteratorAggregate) is iterated instead of failing with aTypeError. Update documentation, add tests. - #143 Fix level 8 edge cases failing with a
TypeErroror anError:CsvResourcerejects a blank header line and checksftell(), XpathEvaluatorTransformer throws an explicit\UnexpectedValueExceptionon an invalid query (with the libxml messages), a namespace node to unwrap or a node without document, SlugifyTransformer on a value that cannot be transliterated,ProcessState::getContext()returns[]until the context is defined, GenericTransformer and TransformerTrait throw a\LogicExceptionwhen not initialized, IterableBatchTask and JsonStreamReaderTask can be flushed / iterated before their first execution, RegistryCompilerPass checks its configuration, SubprocessInstance checks the PHP executable. Update documentation, add tests. - #239 Fix PropertyGetterTask: catch any
\Throwable, so that theTypeErrorof the property accessor on a scalar input is set on the state (with thepropertyerror context) and handled according to the taskerror_strategyinstead of escaping it. Update documentation, add tests. - #241 Fix CsvWriterTask: a non-array input throws the documented
\UnexpectedValueExceptioninstead of aTypeErrorwhenheadersisnull, and the CSV tasks release their file onfinalize()so that the task can be executed again. Update documentation, add tests. - #240 Fix FileMoverTask: with
autoincrement, the suffix was computed on the whole path (a dot in a directory name was taken as the extension, making the move fail for a file without extension) and an existing numeric suffix of the file name was replaced (report-2024.csvbecamereport-1.csv). The suffix is now appended to the file name only (report-2024-1.csv,file-1,.env-1). Update documentation, add tests. - #243 Fix RecursivePropertySetterTransformer: a
\stdClassitem without the property was replaced by a copy in the output, so the input object was not modified; the property is now added to the item itself. Update documentation, add tests. - #242 Fix InputFileReaderTask: an input that is not a non-empty string (e.g.
null) throws an explicit\UnexpectedValueException(No file path given as input) instead of a PHP warning followed by aTypeError. Update documentation, add tests. - #244 Fix MappingTransformer: a missing target property of a
\stdClassdestination (initial_valueorkeep_input) threwProperty '...' is not writable, it is now added when the target is a simple property name (nested paths still throw). Update documentation, add tests. - #143 Type the remaining untyped task options:
split_characterof CsvWriterTask and SplitJoinLineTask must be astring(a wrong type used to fail later with aTypeError),write_headersof CsvWriterTask andlog_empty_linesof CsvReaderTask are cast tobool(any value used to be evaluated as a boolean, so it is still accepted). Update documentation, add tests.
- #190 Update quality stack: use Rector
withComposerBased()sets (removedSYMFONY_64/PHPUNIT_100sets), declare used Symfony packages and PHPUnit range in composer.json, apply quality tools fixes - #145 Add missing documentations: reference pages for every Task & Transformer, ConditionTrait & GenericTransformer, complete guides and cookbooks. Harmonize and fix existing documentation.
- #229 StatCounterTask and AdvancedStatCounterTask pass their input to their output on every execution (they used to output
null, and AdvancedStatCounterTask was skipped when not logging), so they can be placed anywhere in a branch. Update documentation, add tests. - #236 TransformerTrait: document that any non-empty
#suffixis accepted on transformer codes (callback#1,callback#reverse), and anchor the matching regex (an empty suffix is no longer accepted). Update documentation, add tests.
- #192 Fix CommandRunnerTask: only pass the
optionsoption toProcess::setOptions(), support stringcommandlinethroughProcess::fromShellCommandline(), validate option types. Update documentation, add tests. - #194 Fix ProcessLauncherTask: the
process_optionsnormalizer returned an array despite its scalar return type, so the task always failed with aTypeError. Update documentation, add tests. - #189 Fix EventDispatcherTask: dispatch the event under the
event_nameoption (regression since v4.0).event_nameis now optional: whennull(default), the event is dispatched under its class name. Update documentation, add tests. - #198 Fix DateParserTransformer: a
\DateTimeImmutableinput is converted to a\DateTimeinstead of throwing aTypeError. Update documentation, add tests. - #199 Fix PregFilterTransformer: an array
replacementis no longer cast to the string"Array", and requires an arraypattern. Update documentation, add tests. - #200 Fix GenericTransformer: a contextual option declared with
required: falseand no default can now be used; its placeholders are replaced bynullwhen omitted. Update documentation, add tests. - #202 Fix XmlReaderTask: throw an explicit
\UnexpectedValueExceptionon an empty file or invalid XML (with the libxml error messages) instead of aValueErroror a silent empty\DOMDocument. Update documentation, add tests. - #203 Fix
ProcessState::addErrorContextValue(): accept any value type, so that iterable tasks on an empty iterable are skipped and PropertySetterTask reports the original exception instead of aTypeError. Update documentation, add tests. - #204 Fix CachedTransformer, SlugifyTransformer and TypeSetterTransformer edge cases: accept a non-string input in
cached(key built afterkey_transformers), reject an invalidtransliteratorinslugifywith anInvalidOptionsException, remove the unreachable error branch oftype_setter. Update documentation, add tests. - #205 Fix FileSplitterTask: produced files lost the first line, doubled line breaks and ended with an empty file; each file now contains exactly
max_lineslines of the source. Update documentation, add tests. - #206 Fix AdvancedStatCounterTask, IterableBatchTask, ConditionTrait and ColumnAggregatorTask edge cases: log the first counted execution with correct counts, accept a
nullbatch_count(only flush at the end), allow scalar inputs in conditions (''path on the whole value), aggregatenullcolumn values. Update documentation, add tests. - #207 Fix JsonStreamReaderTask / JsonStreamWriterTask: throw an explicit
\UnexpectedValueExceptionwhen a line decodes to a scalar, create the missing parent directory when writing. Update documentation, add tests. - #208 Fix FolderBrowserTask, InputFolderBrowserTask, CsvReaderTask and LineReaderTask (and their
Input*variants): reset the state at the end of the iteration, so that a following input is read from its beginning. Update documentation, add tests. - #201 Fix minor defects: error messages of TransformerTrait, RulesTransformer and ExpressionLanguageMapTransformer, useless
setRequired()in ImplodeTransformer and SprintfTransformer, stray namespace in TrimTransformer, wrong or missing docblocks. Add tests. - #220 Fix the stop error strategy: throw a
ProcessFailedException(with the original exception asprevious) instead of aFatalError, so that the command exits with a non-zero code when a process fails andProcessLauncherTaskdetects failed sub-processes. Update documentation, add tests. - #221 Fix CsvSplitterTask: each produced file contains
max_linesdata lines (instead ofmax_lines - 2), no infinite loop withmax_lines<= 2 (max_linesmust now be an integer greater than 0), no header-only file at the end. Update documentation, add tests. - #223 Fix CounterTask: the final count is outputted once, as
flush()may be called several times. Document thatflush()implementations must be idempotent. Update documentation, add tests. - #228 Add the missing
setAllowedTypes()on HashTransformer (raw_output), SimpleBatchTask (batch_count), ConditionTrait (empty,not_empty), NormalizerTask / SerializerTask / DeserializerTask (context) and ObjectUpdaterTask (property_path): a wrong type is now reported when the options are resolved. Add tests. - #232 Fix edge cases looping forever or failing with a
TypeError: validate FileSplitterTaskmax_lines(greater than 0, also when given as input), catch any\Throwablein PropertySetterTask, type SlugifyTransformer options, explicit exceptions in InputFolderBrowserTask (no folder path) andXmlFile::write()(saveXML()failure). Update documentation, add tests.
- #189 EventDispatcherTask: when
event_nameis set, listening toCleverAge\ProcessBundle\Event\EventDispatcherTaskEventis deprecated (the event is still dispatched under its class name, with anE_USER_DEPRECATEDerror, if it has listeners). Listen to the configuredevent_nameinstead: the BC layer will be removed in v6.0. - #222 ProcessManager: going on with the process after an exception thrown by a task
initialize()is deprecated (anE_USER_DEPRECATEDerror is triggered). In v6.0, the process will fail before executing any task.
- #179 Add support for PHP 8.5 and Symfony 8.* Update phpunit/phpunit to version >10.0
- #179 Remove support for PHP 8.1 and Symfony 7.3
- #176 Upgrade to Symfony 7.3 & PHP 8.4
- #168 Add JsonStreamWriterTask with related doc
- #172 Add spl_file_object_flags and json_flags options on JsonStream*Tasks. Update docs.
- #174 Add FileSplitterTask using Filesystem/SplFile. Add doc.
- #169 Fix JsonStreamFile empty line at the end issue, even if SKIP_EMPTY is set. Add JsonStreamReaderTask doc.
- #166 Add PregMatchTransformer
- #cleverage/archive-process-bundle#1 Add new bridge ArchiveProcessBundle
- #162 Add timestamp placeholder on file_path parameter of CsvWriterTask. Improve documentation.
- #164 Add cleverage/cache-process-bundle dependency
- #158 Add dependency to symfony/service-contract
- #155 Add InputFileReaderTask (Reads the whole input file and outputs its content), InputLineReaderTask (Reads an input file line by line and outputs each line.) and LineReaderTask (Reads a file line by line and outputs each line.)
- #142 Remove FileFetchTask, use
cleverage/flysystem-process-bundleinstead. - #142 YamlReaderTask & YamlWriterTask namespaces changed to
CleverAge\ProcessBundle\Task\File\Yaml - #142 Array***Transformers namespaces changed to
CleverAge\ProcessBundle\Transformer\Array - #142 NormalizeTransformer & DenormalizeTransformer namespaces changed to
CleverAge\ProcessBundle\Transformer\Serialization - #142 DateFormatTransformer & DateParserTransformer namespaces changed to
CleverAge\ProcessBundle\Transformer\Date - #142 ExplodeTransformer, HashTransformer, ImplodeTransformer, SlugifyTransformer, SprintfTransformer & TrimTransformer namespaces changed to
CleverAge\ProcessBundle\Transformer\String - #142 InstantiateTransformer, PropertyAccessorTransformer RecursivePropertySetterTransformer namespaces changed to
CleverAge\ProcessBundle\Transformer\Object - #147 Replace
Symfony\Component\Form\Exception\InvalidConfigurationExceptionbySymfony\Component\Config\Definition\Exception\InvalidConfigurationException - #148 Update services (step 1) according to Symfony best practices. Services should not use autowiring or autoconfiguration. Instead, all services should be defined explicitly.
Services must be prefixed with the bundle alias instead of using fully qualified class names =>
cleverage_process - #150 The class
\CleverAge\ProcessBundle\Task\Debug\MemInfoDumpTaskhas been deleted without suggested replacement - #115 New mandatory configuration
default_error_strategyonclever_age_processlevel. See Quick Start/Global configuration
- #139 Update Makefile & .docker for local standalone usage
- #139 Update rector, phpstan & php-cs-fixer configurations & apply it
- #141
league/flysystem-bundleis not required anymore - #130 EventDispatcherInterface service declaration breaks dependency injection
- #147 Add missing dependencies on
symfony/dotenvandsymfony/runtime - #147 Remove dependencies on
symfony/form,symfony/messenger&symfony/scheduler - #146 eav-process-bundle, enqueue-process-bundle, cache-process-bundle and process-soap-bundle were deprecated / archived.
- #141 Add a default value to the node "default_error_strategy"
- #129 Remove wrong replace configuration on composer.json. Add missing suggest
- Miscellaneous fixes, show full diff : https://github.com/cleverage/process-bundle/compare/v4.0.0-rc2...v4.0.0
- Bump php version to >=8.2
- Bump symfony version to ^6.4|^7.1
- Miscellaneous fixes, show full diff : https://github.com/cleverage/process-bundle/compare/v4.0.0-rc1...v4.0.0-rc2
- Bump php version to >=8.1
- Bump symfony version to ^6.3
- Add some phpunit tests
- Apply Rector & Phpstan
- Add StopwatchTask
- Change directory structure. Move Symfony code to /src, documentation to /doc, and tests to /tests
- Miscellaneous fixes, show full diff : https://github.com/cleverage/process-bundle/compare/v3.2.9...v4.0.0-rc1
https://github.com/cleverage/process-bundle/compare/v3.2.8...v3.2.9
https://github.com/cleverage/process-bundle/compare/v3.2.7...v3.2.8
Suppress deprecation message
Fix SubprocessInstance Task for Symfony >=5
Upgrade psr/cache
- Added a
ttloption in thecachedtransformer
- Added
multi_replacetransformer - Added
cachedtransformer
- Fixed return value of list and help commands (mandatory for Symfony 5)
- Added
psr/cacheas a dependency, but it shouldn't break anything - Added
ext-intlas a dependency, since required by theslugifytransformer
- Ignore empty lines in
\CleverAge\ProcessBundle\Filesystem\CsvResource::getLineCount. - Fixed
\CleverAge\ProcessBundle\Task\AbstractIterableOutputTaskskipping iterations when inside another iteration loop \CleverAge\ProcessBundle\Exception\InvalidProcessConfigurationExceptionnow displays the failing process code\CleverAge\ProcessBundle\Transformer\TransformerTraitnow displays a more explicit message on wrong options type
- Fatal error while loading configuration in Symfony 3.4
- GITHUB-121: Enable compatibility with Symfony 5
- GITHUB-118: Added boilerplate code to avoid deprecations notices for event listeners
There is no BC break for this version, but note that sidus/base-bundle has been removed from dependencies.
If you use it, it should already be inside your own composer.json.
Nothing yet
Nothing yet
Nothing yet
- GITHUB-120: FolderBrowserTask: Accept array type for
name_patternoption
- (backport from v3.0.9) Adding simple task to launch system commands
- (backport from v3.0.7) Allowing ValidatorTask to output constraint violations with an option
- (backport from v3.0.6) Adding ArrayUnsetTransformer
- (backport from v3.0.5) Adding basic debug transformer
- (backport from v3.0.8) Fixing AbstractIterableOutputTask that was inconsistent when chained, refactoring InputIteratorTask that had the proper implementation with the AbstractIterableOutputTask as parent
- Fixed bad static access in tests
- (backport from v3.0.4) Adding simple file reader task and cast transformer
- (backport from v3.0.3) FilterTask now outputs skipped content to error output
- Removed useless, CPU intensive, log on CsvSplitterTask
- GITHUB-83: added events around process execution
- GITHUB-86: added XML manipulation tools
- GITHUB-109: added an event during CLI process execution
- GITHUB-107: allow to use directly a string in task
outputsanderrorsconfigurations
- GITHUB-99: transformer exception message improvements
- GIHTUB-82: the
default_error_strategyis now mandatory. If you have any doubt, you can usedefault_error_strategy: skipto keep previous behavior. - GITHUB-106: an entry-point cannot have an ancestor anymore. The behaviour was undefined, and now it will throw an exception.
Instead of using CleverAge\ProcessBundle\Model\ProcessState::log you must now use the standard
Psr\Log\LoggerInterface with the cleverage_process_task chanel. You should also pass
CleverAge\ProcessBundle\Model\ProcessState::getLogContext to the log context.
The main option is now "transformers", which accept transformer codes and then transformer options. Default options should now look like:
options:
transformers:
mapping:
mapping:
<key>: <options>- The option "ignore_extra" is renamed to "keep_input".
- Fixed issues with blocking tasks
- Removed deprecated methods
- added input/output in process manager (may allow a start_process_task)
New issues :
- Error workflow
- automated transformer creation & refactoring
- easy test cases via yml ?
- changes in interfaces
- allow blocking + iterable
- FIFO queues for in/out