You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ea89bd2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ Latest
6
6
*[#483](https://github.com/cleverage/process-bundle/issues/483) Documentation: an exception thrown by `IterableTaskInterface::next()` makes the process fail right away with this exception, the `error_strategy` and the `error_outputs` of the task do not apply.
7
7
8
8
## Fixes
9
+
*[#475](https://github.com/cleverage/process-bundle/issues/475) Generic transformers: restore, deprecated, the former names (with underscores instead of dashes) of their transformer codes and contextual options, which no longer worked since 5.9 ([#438](https://github.com/cleverage/process-bundle/issues/438)): a transformer code with a dash that is only registered with underscores (`array-first` for `array_first`), and a contextual option with a dash given or used by its former name (`the_prefix`, `{{ the_prefix }}` for `the-prefix`). Update documentation, add tests.
9
10
*[#477](https://github.com/cleverage/process-bundle/issues/477) "Stop the process on the first invalid item" (`error_strategy: skip` and an error branch ending on a `StopTask`) ends as stopped when the failing task is finalizable (`csv_reader`, `xml_stream_reader`, `stat_counter`...): the error of the skipped item, kept by its state, was taken for a finalization failure and the process ended as failed. Add tests.
10
11
*[#473](https://github.com/cleverage/process-bundle/issues/473) A task failing with the `stop` error strategy makes the process fail even when its error branch stops the flow (`StopTask`, `ProcessState::stop()`): the failure was swallowed, the process ended as succeeded or stopped (`cleverage_process.end` event, exit code 0) and a parent process went on with a `null` output. Update documentation, add tests.
11
12
*[#485](https://github.com/cleverage/process-bundle/issues/485) The process returns the last output of its `end_point` passed on to the next tasks: the output of an execution whose output is ignored (skipped, filtered, failed with the `skip` strategy) was returned, e.g. `""` for a `skip_empty` end point whose last item is empty, or `null` for a filtered last item. Update documentation, add tests.
@@ -397,7 +398,6 @@ v3.2.2
397
398
*`\CleverAge\ProcessBundle\Exception\InvalidProcessConfigurationException` now displays the failing process code
398
399
*`\CleverAge\ProcessBundle\Transformer\TransformerTrait` now displays a more explicit message on wrong options type
399
400
400
-
401
401
v3.2.1
402
402
------
403
403
@@ -418,8 +418,6 @@ v3.2.0
418
418
There is no BC break for this version, but note that `sidus/base-bundle` has been removed from dependencies.
419
419
If you use it, it should already be inside your own composer.json.
420
420
421
-
422
-
423
421
Release v3.1
424
422
============
425
423
@@ -445,15 +443,13 @@ v3.1.5
445
443
446
444
*[GITHUB-120](https://github.com/cleverage/process-bundle/pull/120): FolderBrowserTask: Accept array type for `name_pattern` option
447
445
448
-
449
446
v3.1.4
450
447
------
451
448
452
449
### Features
453
450
454
451
* (_backport from v3.0.9_) Adding simple task to launch system commands
455
452
456
-
457
453
v3.1.3
458
454
------
459
455
@@ -509,7 +505,6 @@ v3.1.0
509
505
*[GITHUB-106](https://github.com/cleverage/process-bundle/issues/106): an entry-point cannot have an ancestor anymore.
510
506
The behaviour was undefined, and now it will throw an exception.
if (!\is_string($key) || !str_contains($key, '-') || str_contains($key, '_')) {
226
+
return$key;
227
+
}
228
+
$formerKey = str_replace('-', '_', $key);
229
+
// Both were written: none was renamed
230
+
if (\array_key_exists($formerKey, $transformers)) {
231
+
return$key;
232
+
}
233
+
// The code, without the "#" suffix of the key
234
+
$code = explode('#', $key, 2)[0];
235
+
$formerCode = str_replace('-', '_', $code);
236
+
$registry = $this->transformerRegistry;
237
+
if (!$registryinstanceof TransformerRegistry || $registry->hasTransformer($code) || !$registry->hasTransformer($formerCode)) {
238
+
return$key;
239
+
}
240
+
trigger_deprecation(
241
+
'cleverage/process-bundle',
242
+
'5.10',
243
+
'The transformer "%s" of the generic transformer "%s" is not registered, its former name "%s", with underscores instead of dashes, is used: write "%s". The dashes of the transformer codes of a generic transformer were replaced by underscores before 5.9, the former name will not be used in v6.0.',
244
+
$code,
245
+
$this->transformerCode,
246
+
$formerCode,
247
+
$formerCode,
248
+
);
249
+
250
+
return$formerKey;
251
+
}
252
+
253
+
/**
254
+
* Before 5.9, a contextual option whose code has a dash was named with underscores, also in "{{ former_name }}".
if (preg_match_all($pattern, $string, $matches)) {
270
+
$used = [...$used, ...$matches[1]];
271
+
}
272
+
}
273
+
foreach (array_unique($used) as$formerName) {
274
+
trigger_deprecation(
275
+
'cleverage/process-bundle',
276
+
'5.10',
277
+
'Using the contextual option "%s" of the generic transformer "%s" as "{{ %s }}", with underscores instead of dashes, is deprecated: write "{{ %s }}". The dashes of the contextual option codes were replaced by underscores before 5.9, the former name will not be replaced in v6.0.',
278
+
$this->deprecatedContextualOptions[$formerName],
279
+
$this->transformerCode,
280
+
$formerName,
281
+
$this->deprecatedContextualOptions[$formerName],
282
+
);
283
+
}
284
+
}
285
+
286
+
/**
287
+
* A contextual option whose code has a dash can also be given by its former name, with underscores (deprecated).
// Given by its code, by its former name, or the default value
298
+
$resolver->setDefault($option, staticfunction (Options$options) use ($option, $formerName, $optionConfig, $transformerCode): mixed {
299
+
if ($options->offsetExists($formerName)) {
300
+
trigger_deprecation(
301
+
'cleverage/process-bundle',
302
+
'5.10',
303
+
'Using the contextual option "%s" of the generic transformer "%s" by the name "%s", with underscores instead of dashes, is deprecated: use "%s". The dashes of the contextual option codes were replaced by underscores before 5.9, the former name will not be accepted in v6.0.',
304
+
$option,
305
+
$transformerCode,
306
+
$formerName,
307
+
$option,
308
+
);
309
+
310
+
return$options[$formerName];
311
+
}
312
+
if (null !== $optionConfig['default'] || $optionConfig['default_is_null']) {
313
+
return$optionConfig['default'];
314
+
}
315
+
if ($optionConfig['required']) {
316
+
thrownewMissingOptionsException(\sprintf('The required option "%s" is missing.', $option));
317
+
}
318
+
319
+
returnnull;
320
+
});
321
+
}
322
+
323
+
/**
324
+
* The strings of the transformer options, keys and values, where "{{ code }}" is replaced.
0 commit comments