Skip to content

Commit 99161f3

Browse files
#148 Update services (step 1) according to Symfony best practices
1 parent fff486e commit 99161f3

8 files changed

+76
-28
lines changed

config/services/command.yaml

+26-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
services:
2-
CleverAge\ProcessBundle\Command\:
3-
resource: '../../../Command/*'
4-
autowire: true
5-
autoconfigure: true
6-
bind:
7-
$container: '@service_container'
2+
cleverage_process.command.execute_process:
3+
class: CleverAge\ProcessBundle\Command\ExecuteProcessCommand
4+
public: false
5+
tags:
6+
- { name: console.command }
7+
arguments:
8+
- '@process_bundle.manager.process'
9+
- '@event_dispatcher'
10+
- '@process_bundle.registry.process_configuration'
11+
12+
cleverage_process.command.list_process:
13+
class: CleverAge\ProcessBundle\Command\ListProcessCommand
14+
public: false
15+
tags:
16+
- { name: console.command }
17+
arguments:
18+
- '@process_bundle.registry.process_configuration'
19+
20+
cleverage_process.command.process_help:
21+
class: CleverAge\ProcessBundle\Command\ProcessHelpCommand
22+
public: false
23+
tags:
24+
- { name: console.command }
25+
arguments:
26+
- '@process_bundle.registry.process_configuration'
27+
- '@service_container'

config/services/event.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
services:
2-
CleverAge\ProcessBundle\EventListener\DataQueueEventListener:
2+
cleverage_process.event_listener.data_queue:
3+
class: CleverAge\ProcessBundle\EventListener\DataQueueEventListener
34
public: false
45
tags:
56
- { name: kernel.event_listener, event: cleverage_process.data_queue, method: pushData }
+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
services:
2-
CleverAge\ProcessBundle\ExpressionLanguage\PhpFunctionProvider:
2+
cleverage_process.expression_language.php_function_provider:
3+
class: CleverAge\ProcessBundle\ExpressionLanguage\PhpFunctionProvider
4+
public: false
35
arguments:
46
- [ 'preg_match' ]
57

68
cleverage_process.expression_language:
79
class: Symfony\Component\ExpressionLanguage\ExpressionLanguage
10+
public: false
811
calls:
9-
- ['registerProvider', ['@CleverAge\ProcessBundle\ExpressionLanguage\PhpFunctionProvider']]
12+
- ['registerProvider', ['@cleverage_process.expression_language.php_function_provider']]

config/services/logger.yaml

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
services:
2-
CleverAge\ProcessBundle\Logger\ProcessProcessor:
3-
autowire: true
2+
cleverage_process.logger.process_processor:
3+
class: CleverAge\ProcessBundle\Logger\ProcessProcessor
4+
public: false
45
tags:
56
- { name: monolog.processor, channel: cleverage_process }
7+
arguments:
8+
- '@process_bundle.manager.process'
69

7-
CleverAge\ProcessBundle\Logger\TaskProcessor:
8-
autowire: true
10+
cleverage_process.logger.task_processor:
11+
class: CleverAge\ProcessBundle\Logger\TaskProcessor
12+
public: false
913
tags:
1014
- { name: monolog.processor, channel: cleverage_process_task }
15+
arguments:
16+
- '@process_bundle.manager.process'
1117

12-
CleverAge\ProcessBundle\Logger\TransformerProcessor:
13-
autowire: true
18+
cleverage_process.logger.transformer_processor:
19+
class: CleverAge\ProcessBundle\Logger\TransformerProcessor
20+
public: false
1421
tags:
1522
- { name: monolog.processor, channel: cleverage_process_transformer }
23+
arguments:
24+
- '@process_bundle.manager.process'
1625

17-
CleverAge\ProcessBundle\Logger\ProcessLogger:
18-
autowire: true
26+
cleverage_process.logger.process_logger:
27+
class: CleverAge\ProcessBundle\Logger\ProcessLogger
28+
public: false
1929
tags:
2030
- { name: monolog.logger, channel: cleverage_process }
31+
arguments:
32+
- '@monolog.logger'
2133

22-
CleverAge\ProcessBundle\Logger\TaskLogger:
23-
autowire: true
34+
cleverage_process.logger.task_logger:
35+
class: CleverAge\ProcessBundle\Logger\TaskLogger
36+
public: false
2437
tags:
2538
- { name: monolog.logger, channel: cleverage_process_task }
39+
arguments:
40+
- '@monolog.logger'

config/services/manager.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
services:
2-
CleverAge\ProcessBundle\Manager\ProcessManager:
3-
autowire: true
2+
process_bundle.manager.process:
3+
class: CleverAge\ProcessBundle\Manager\ProcessManager
44
public: false
55
arguments:
6-
$container: '@service_container'
6+
- '@service_container'
7+
- '@cleverage_process.logger.process_logger'
8+
- '@cleverage_process.logger.task_logger'
9+
- '@process_bundle.registry.process_configuration'
10+
- '@process_bundle.context.contextual_option_resolver'
11+
- '@event_dispatcher'
712

8-
CleverAge\ProcessBundle\Context\ContextualOptionResolver:
13+
process_bundle.context.contextual_option_resolver:
14+
class: CleverAge\ProcessBundle\Context\ContextualOptionResolver
915
public: false

config/services/registry.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
services:
2-
CleverAge\ProcessBundle\Registry\ProcessConfigurationRegistry:
2+
process_bundle.registry.process_configuration:
3+
class: CleverAge\ProcessBundle\Registry\ProcessConfigurationRegistry
4+
public: false
35
arguments:
46
- ~
57
- ~
68

7-
CleverAge\ProcessBundle\Registry\TransformerRegistry:
9+
process_bundle.registry.transformer:
10+
class: CleverAge\ProcessBundle\Registry\TransformerRegistry
811
public: false

config/services/task.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
CleverAge\ProcessBundle\Task\:
3-
resource: '../../../Task/*'
3+
resource: '../../src/Task/*'
44
autowire: true
55
public: true
66
shared: false

config/services/transformer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
$language: '@cleverage_process.expression_language'
88

99
CleverAge\ProcessBundle\Transformer\:
10-
resource: '../../../Transformer/*'
11-
exclude: '../../../Transformer/GenericTransformer.php'
10+
resource: '../../src/Transformer/*'
11+
exclude: '../../src/Transformer/GenericTransformer.php'
1212
tags:
1313
- { name: cleverage.transformer }
1414
- { name: monolog.logger, channel: cleverage_process_transformer }

0 commit comments

Comments
 (0)