Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
->in(__DIR__.'/config')
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->append([__FILE__])
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Latest
* [#428](https://github.com/cleverage/process-bundle/issues/428) Tests on PHPUnit 12.5 and 13 (PHPUnit 10 and 11 dropped), with the lowest dependencies on PHP 8.3 and 8.5.
* [#510](https://github.com/cleverage/process-bundle/issues/510) Support PHP 8.6: tests on PHP 8.6 (lowest dependencies, highest with Symfony 7.4 and 8.x), PHPStan and Rector on PHP 8.6, `symfony/polyfill-php86` is required so that the PHP 8.6 functions can be used on PHP 8.3 to 8.5.
* [#493](https://github.com/cleverage/process-bundle/issues/493) Documentation: the `constant()` function of the `evaluator` expressions is deprecated by Symfony 8.2 (a `ConstantFunctionProvider` must be registered), avoid it.
* [#277](https://github.com/cleverage/process-bundle/issues/277) `CleverAgeProcessBundle` extends `AbstractBundle`: the configuration tree (`configure()`) and the loading of the services (`loadExtension()`) move from the internal `Configuration` and `CleverAgeProcessExtension` classes, removed, to the bundle, and the service definitions are written in PHP (`config/services/*.php`, analysed by PHPStan, Rector and PHP-CS-Fixer) instead of YAML. Same configuration tree (root `cleverage_process`), same service ids and definitions. Update documentation and tests.

v5.10
-----
Expand Down
4 changes: 2 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected constants must declare it with the same type:
- `string`: `ProcessHelpCommand::CHAR_*` (`protected const string CHAR_NODE = '●';`);
- `int`: `ProcessHelpCommand::BRANCH_SIZE` / `INDENT_SIZE`, `ProcessManager::EXECUTE_*`,
`ProcessLauncherTask::STOP_TIMEOUT` (`protected const int INDENT_SIZE = 2;`);
- `array`: `ArrayMergeTask::MERGE_FUNC`, `Configuration::LOG_LEVELS`.
- `array`: `ArrayMergeTask::MERGE_FUNC`.

### Narrowed native types

Expand Down Expand Up @@ -85,7 +85,7 @@ The code of a transformer is only given by the `code` attribute of its `cleverag
- a transformer of the bundle redeclared in your application (e.g.
`CleverAge\ProcessBundle\Transformer\MappingTransformer` with other arguments) replaces the definition of the bundle
and loses its tag: declare the tag with the code of the bundle (`{ name: cleverage.transformer, code: mapping }`, see
`config/services/transformer.yaml` of the bundle), the `#[AsTransformer]` attribute cannot be added to a class of the
`config/services/transformer.php` of the bundle), the `#[AsTransformer]` attribute cannot be added to a class of the
bundle;
- `TransformerInterface::getCode()` is removed (deprecated since 5.4), as well as the `getCode()` method of the
transformers of the bundle (except `GenericTransformer` and `UnavailableTransformer`): remove the calls to it
Expand Down
43 changes: 43 additions & 0 deletions config/services/command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/ProcessBundle package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use CleverAge\ProcessBundle\Command\ExecuteProcessCommand;
use CleverAge\ProcessBundle\Command\ListProcessCommand;
use CleverAge\ProcessBundle\Command\ProcessHelpCommand;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('cleverage_process.command.execute_process', ExecuteProcessCommand::class)
->tag('console.command')
->args([
service('cleverage_process.manager.process'),
service('event_dispatcher'),
service('cleverage_process.registry.process_configuration'),
]);

$services->set('cleverage_process.command.list_process', ListProcessCommand::class)
->tag('console.command')
->args([
service('cleverage_process.registry.process_configuration'),
]);

$services->set('cleverage_process.command.process_help', ProcessHelpCommand::class)
->tag('console.command')
->args([
service('cleverage_process.registry.process_configuration'),
service('cleverage_process.registry.task'),
]);
};
27 changes: 0 additions & 27 deletions config/services/command.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions config/services/event.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/ProcessBundle package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use CleverAge\ProcessBundle\EventListener\DataQueueEventListener;
use CleverAge\ProcessBundle\EventListener\SignalStopChecker;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

// @phpstan-ignore classConstant.deprecatedClass (deprecated service, removed in v6.0)
$services->set('cleverage_process.event_listener.data_queue', DataQueueEventListener::class)
->deprecate('cleverage/process-bundle', '5.4', 'The "%service_id%" service is deprecated, it will be removed in v6.0: write your own listener of the event dispatched by the event_dispatcher task.')
->tag('kernel.event_listener', ['event' => 'cleverage_process.data_queue', 'method' => 'pushData']);

$services->set('cleverage_process.event_listener.signal_stop_checker', SignalStopChecker::class)
->args([
service('logger')->ignoreOnInvalid(),
])
->tag('cleverage_process.stop_checker')
->tag('kernel.event_listener', ['event' => 'console.signal', 'method' => 'onConsoleSignal'])
->tag('kernel.event_listener', ['event' => 'cleverage_process.start', 'method' => 'onProcessStart'])
->tag('kernel.event_listener', ['event' => 'cleverage_process.end', 'method' => 'onProcessEnd'])
->tag('kernel.event_listener', ['event' => 'cleverage_process.fail', 'method' => 'onProcessEnd'])
->tag('kernel.reset', ['method' => 'reset'])
->tag('monolog.logger', ['channel' => 'cleverage_process']);
};
24 changes: 0 additions & 24 deletions config/services/event.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions config/services/expression_language.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/ProcessBundle package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use CleverAge\ProcessBundle\ExpressionLanguage\PhpFunctionProvider;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('cleverage_process.expression_language.php_function_provider', PhpFunctionProvider::class)
->args([
['preg_match'],
]);

$services->set('cleverage_process.expression_language', ExpressionLanguage::class)
->call('registerProvider', [service('cleverage_process.expression_language.php_function_provider')]);
};
12 changes: 0 additions & 12 deletions config/services/expression_language.yaml

This file was deleted.

54 changes: 54 additions & 0 deletions config/services/logger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/ProcessBundle package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use CleverAge\ProcessBundle\Logger\ProcessLogger;
use CleverAge\ProcessBundle\Logger\ProcessProcessor;
use CleverAge\ProcessBundle\Logger\TaskLogger;
use CleverAge\ProcessBundle\Logger\TaskProcessor;
use CleverAge\ProcessBundle\Logger\TransformerProcessor;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('cleverage_process.logger.process_processor', ProcessProcessor::class)
->tag('monolog.processor', ['channel' => 'cleverage_process'])
->args([
service('cleverage_process.manager.process'),
]);

$services->set('cleverage_process.logger.task_processor', TaskProcessor::class)
->tag('monolog.processor', ['channel' => 'cleverage_process_task'])
->args([
service('cleverage_process.manager.process'),
]);

$services->set('cleverage_process.logger.transformer_processor', TransformerProcessor::class)
->tag('monolog.processor', ['channel' => 'cleverage_process_transformer'])
->args([
service('cleverage_process.manager.process'),
]);

$services->set('cleverage_process.logger.process_logger', ProcessLogger::class)
->tag('monolog.logger', ['channel' => 'cleverage_process'])
->args([
service('logger'),
]);

$services->set('cleverage_process.logger.task_logger', TaskLogger::class)
->tag('monolog.logger', ['channel' => 'cleverage_process_task'])
->args([
service('logger'),
]);
};
40 changes: 0 additions & 40 deletions config/services/logger.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions config/services/manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/ProcessBundle package.
*
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use CleverAge\ProcessBundle\Context\ContextualOptionResolver;
use CleverAge\ProcessBundle\Manager\ProcessManager;
use CleverAge\ProcessBundle\Manager\ProcessManagerInterface;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

$services->set('cleverage_process.manager.process', ProcessManager::class)
->args([
service('service_container'),
service('cleverage_process.logger.process_logger'),
service('cleverage_process.logger.task_logger'),
service('cleverage_process.registry.process_configuration'),
service('cleverage_process.context.contextual_option_resolver'),
service('event_dispatcher'),
tagged_iterator('cleverage_process.stop_checker'),
service('cleverage_process.registry.task'),
service('lock.factory')->ignoreOnInvalid(),
])
->tag('kernel.reset', ['method' => 'reset']);
$services->alias(ProcessManager::class, 'cleverage_process.manager.process');
$services->alias(ProcessManagerInterface::class, 'cleverage_process.manager.process');

$services->set('cleverage_process.context.contextual_option_resolver', ContextualOptionResolver::class);
$services->alias(ContextualOptionResolver::class, 'cleverage_process.context.contextual_option_resolver');
};
27 changes: 0 additions & 27 deletions config/services/manager.yaml

This file was deleted.

Loading