workflow.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
  12. use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
  13. use Symfony\Component\Workflow\Registry;
  14. use Symfony\Component\Workflow\StateMachine;
  15. use Symfony\Component\Workflow\Workflow;
  16. return static function (ContainerConfigurator $container) {
  17. $container->services()
  18. ->set('workflow.abstract', Workflow::class)
  19. ->args([
  20. abstract_arg('workflow definition'),
  21. abstract_arg('marking store'),
  22. service('event_dispatcher')->ignoreOnInvalid(),
  23. abstract_arg('workflow name'),
  24. abstract_arg('events to dispatch'),
  25. ])
  26. ->abstract()
  27. ->public()
  28. ->set('state_machine.abstract', StateMachine::class)
  29. ->args([
  30. abstract_arg('workflow definition'),
  31. abstract_arg('marking store'),
  32. service('event_dispatcher')->ignoreOnInvalid(),
  33. abstract_arg('workflow name'),
  34. abstract_arg('events to dispatch'),
  35. ])
  36. ->abstract()
  37. ->public()
  38. ->set('workflow.marking_store.method', MethodMarkingStore::class)
  39. ->abstract()
  40. ->set('workflow.registry', Registry::class)
  41. ->alias(Registry::class, 'workflow.registry')
  42. ->set('workflow.security.expression_language', ExpressionLanguage::class)
  43. ;
  44. };