3
3
namespace Enqueue \Bundle \DependencyInjection ;
4
4
5
5
use Enqueue \AsyncCommand \RunCommandProcessor ;
6
+ use Enqueue \JobQueue \Job ;
6
7
use Enqueue \Monitoring \Symfony \DependencyInjection \MonitoringFactory ;
7
8
use Enqueue \Symfony \Client \DependencyInjection \ClientFactory ;
8
9
use Enqueue \Symfony \DependencyInjection \TransportFactory ;
@@ -35,6 +36,7 @@ public function getConfigTreeBuilder(): TreeBuilder
35
36
->append (ClientFactory::getConfiguration ($ this ->debug ))
36
37
->append ($ this ->getMonitoringConfiguration ())
37
38
->append ($ this ->getAsyncCommandsConfiguration ())
39
+ ->append ($ this ->getJobConfiguration ())
38
40
->arrayNode ('extensions ' )->addDefaultsIfNotSet ()->children ()
39
41
->booleanNode ('doctrine_ping_connection_extension ' )->defaultFalse ()->end ()
40
42
->booleanNode ('doctrine_clear_identity_map_extension ' )->defaultFalse ()->end ()
@@ -46,7 +48,6 @@ public function getConfigTreeBuilder(): TreeBuilder
46
48
;
47
49
48
50
// $rootNode->children()
49
- // ->booleanNode('job')->defaultFalse()->end()
50
51
// ->arrayNode('async_events')
51
52
// ->addDefaultsIfNotSet()
52
53
// ->canBeEnabled()
@@ -76,4 +77,16 @@ private function getAsyncCommandsConfiguration(): ArrayNodeDefinition
76
77
->canBeEnabled ()
77
78
;
78
79
}
80
+
81
+ private function getJobConfiguration (): ArrayNodeDefinition
82
+ {
83
+ if (false === class_exists (Job::class)) {
84
+ return MissingComponentFactory::getConfiguration ('job ' , ['enqueue/job-queue ' ]);
85
+ }
86
+
87
+ return (new ArrayNodeDefinition ('job ' ))
88
+ ->addDefaultsIfNotSet ()
89
+ ->canBeEnabled ()
90
+ ;
91
+ }
79
92
}
0 commit comments