File tree 2 files changed +29
-1
lines changed
src/Symfony/Bundle/FrameworkBundle
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1531,7 +1531,30 @@ function ($a) {
1531
1531
->arrayNode ('stop_worker_on_signals ' )
1532
1532
->defaultValue ([])
1533
1533
->info ('A list of signals that should stop the worker; defaults to SIGTERM and SIGINT. ' )
1534
- ->integerPrototype ()->end ()
1534
+ ->beforeNormalization ()
1535
+ ->always ()
1536
+ ->then (function ($ v ) {
1537
+ return array_map (static function ($ element ): int {
1538
+ $ element = \is_array ($ element ) ? $ element ['signal ' ] : $ element ;
1539
+ if (\is_string ($ element )) {
1540
+ try {
1541
+ $ signal = \constant ($ element );
1542
+ } catch (\Error ) {
1543
+ $ signal = null ;
1544
+ }
1545
+
1546
+ if (null === $ signal || !str_starts_with ($ element , 'SIG ' ) || !\array_key_exists ($ element , get_defined_constants (true )['pcntl ' ])) {
1547
+ throw new \InvalidArgumentException (sprintf ('"%s" is not a valid signal constant and can \'t be used with the "stop_worker_on_signals" option. ' , $ element ));
1548
+ }
1549
+
1550
+ return $ signal ;
1551
+ }
1552
+
1553
+ return $ element ;
1554
+ }, $ v );
1555
+ })
1556
+ ->end ()
1557
+ ->variablePrototype ()->end ()
1535
1558
->end ()
1536
1559
->scalarNode ('default_bus ' )->defaultNull ()->end ()
1537
1560
->arrayNode ('buses ' )
Original file line number Diff line number Diff line change 543
543
<xsd : element name =" routing" type =" messenger_routing" minOccurs =" 0" maxOccurs =" unbounded" />
544
544
<xsd : element name =" transport" type =" messenger_transport" minOccurs =" 0" maxOccurs =" unbounded" />
545
545
<xsd : element name =" bus" type =" messenger_bus" minOccurs =" 0" maxOccurs =" unbounded" />
546
+ <xsd : element name =" stop-worker-on-signals" type =" messenger_stop_worker_on_signal" minOccurs =" 0" maxOccurs =" unbounded" />
546
547
</xsd : sequence >
547
548
<xsd : attribute name =" default-bus" type =" xsd:string" />
548
549
<xsd : attribute name =" enabled" type =" xsd:boolean" />
611
612
<xsd : attribute name =" id" type =" xsd:string" use =" required" />
612
613
</xsd : complexType >
613
614
615
+ <xsd : complexType name =" messenger_stop_worker_on_signal" >
616
+ <xsd : attribute name =" signal" type =" xsd:string" use =" required" />
617
+ </xsd : complexType >
618
+
614
619
<xsd : complexType name =" http_client" >
615
620
<xsd : sequence >
616
621
<xsd : element name =" default-options" type =" http_client_default_options" minOccurs =" 0" />
You can’t perform that action at this time.
0 commit comments