@@ -421,10 +421,10 @@ public function getConfigTreeBuilder()
421
421
*/
422
422
423
423
if (is_array ($ value )) {
424
- return isset ($ value ['code ' ]) ? $ value : array ( 'code ' => key ($ value ), 'urls ' => current ($ value )) ;
424
+ return isset ($ value ['code ' ]) ? $ value : [ 'code ' => key ($ value ), 'urls ' => current ($ value )] ;
425
425
}
426
426
427
- return array ( 'code ' => $ value , 'urls ' => array ()) ;
427
+ return [ 'code ' => $ value , 'urls ' => []] ;
428
428
}, $ values );
429
429
})
430
430
->end ()
@@ -481,7 +481,7 @@ public function getConfigTreeBuilder()
481
481
->canBeUnset ()
482
482
->beforeNormalization ()
483
483
->ifString ()
484
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
484
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
485
485
->end ()
486
486
->children ()
487
487
->scalarNode ('id ' )->end ()
@@ -500,7 +500,7 @@ public function getConfigTreeBuilder()
500
500
->canBeUnset ()
501
501
->beforeNormalization ()
502
502
->ifString ()
503
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
503
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
504
504
->end ()
505
505
->children ()
506
506
->scalarNode ('id ' )->end ()
@@ -528,7 +528,7 @@ public function getConfigTreeBuilder()
528
528
->canBeUnset ()
529
529
->beforeNormalization ()
530
530
->ifString ()
531
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
531
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
532
532
->end ()
533
533
->children ()
534
534
->scalarNode ('id ' )->end ()
@@ -552,7 +552,7 @@ public function getConfigTreeBuilder()
552
552
->canBeUnset ()
553
553
->beforeNormalization ()
554
554
->ifString ()
555
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
555
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
556
556
->end ()
557
557
->children ()
558
558
->scalarNode ('id ' )->end ()
@@ -573,7 +573,7 @@ public function getConfigTreeBuilder()
573
573
->canBeUnset ()
574
574
->beforeNormalization ()
575
575
->ifString ()
576
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
576
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
577
577
->end ()
578
578
->children ()
579
579
->scalarNode ('id ' )->end ()
@@ -600,7 +600,7 @@ public function getConfigTreeBuilder()
600
600
->prototype ('scalar ' )->end ()
601
601
->beforeNormalization ()
602
602
->ifString ()
603
- ->then (function ($ v ) { return array ( $ v ) ; })
603
+ ->then (function ($ v ) { return [ $ v ] ; })
604
604
->end ()
605
605
->end ()
606
606
->scalarNode ('subject ' )->end () // swift_mailer and native_mailer
@@ -614,7 +614,7 @@ public function getConfigTreeBuilder()
614
614
->canBeUnset ()
615
615
->beforeNormalization ()
616
616
->ifString ()
617
- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
617
+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
618
618
->end ()
619
619
->children ()
620
620
->scalarNode ('id ' )->isRequired ()->end ()
@@ -660,8 +660,8 @@ public function getConfigTreeBuilder()
660
660
->beforeNormalization ()
661
661
->ifArray ()
662
662
->then (function ($ v ) {
663
- $ map = array () ;
664
- $ verbosities = array ( 'VERBOSITY_QUIET ' , 'VERBOSITY_NORMAL ' , 'VERBOSITY_VERBOSE ' , 'VERBOSITY_VERY_VERBOSE ' , 'VERBOSITY_DEBUG ' ) ;
663
+ $ map = [] ;
664
+ $ verbosities = [ 'VERBOSITY_QUIET ' , 'VERBOSITY_NORMAL ' , 'VERBOSITY_VERBOSE ' , 'VERBOSITY_VERY_VERBOSE ' , 'VERBOSITY_DEBUG ' ] ;
665
665
// allow numeric indexed array with ascendning verbosity and lowercase names of the constants
666
666
foreach ($ v as $ verbosity => $ level ) {
667
667
if (is_int ($ verbosity ) && isset ($ verbosities [$ verbosity ])) {
@@ -683,7 +683,7 @@ public function getConfigTreeBuilder()
683
683
->end ()
684
684
->validate ()
685
685
->always (function ($ v ) {
686
- $ map = array () ;
686
+ $ map = [] ;
687
687
foreach ($ v as $ verbosity => $ level ) {
688
688
$ verbosityConstant = 'Symfony\Component\Console\Output\OutputInterface:: ' .$ verbosity ;
689
689
@@ -718,11 +718,11 @@ public function getConfigTreeBuilder()
718
718
->canBeUnset ()
719
719
->beforeNormalization ()
720
720
->ifString ()
721
- ->then (function ($ v ) { return array ( 'elements ' => array ( $ v )) ; })
721
+ ->then (function ($ v ) { return [ 'elements ' => [ $ v ]] ; })
722
722
->end ()
723
723
->beforeNormalization ()
724
724
->ifTrue (function ($ v ) { return is_array ($ v ) && is_numeric (key ($ v )); })
725
- ->then (function ($ v ) { return array ( 'elements ' => $ v) ; })
725
+ ->then (function ($ v ) { return [ 'elements ' => $ v] ; })
726
726
->end ()
727
727
->validate ()
728
728
->ifTrue (function ($ v ) { return empty ($ v ); })
@@ -735,7 +735,7 @@ public function getConfigTreeBuilder()
735
735
$ isExclusive = 'exclusive ' === $ v ['type ' ];
736
736
}
737
737
738
- $ elements = array () ;
738
+ $ elements = [] ;
739
739
foreach ($ v ['elements ' ] as $ element ) {
740
740
if (0 === strpos ($ element , '! ' )) {
741
741
if (false === $ isExclusive ) {
@@ -756,13 +756,13 @@ public function getConfigTreeBuilder()
756
756
return null ;
757
757
}
758
758
759
- return array ( 'type ' => $ isExclusive ? 'exclusive ' : 'inclusive ' , 'elements ' => $ elements) ;
759
+ return [ 'type ' => $ isExclusive ? 'exclusive ' : 'inclusive ' , 'elements ' => $ elements] ;
760
760
})
761
761
->end ()
762
762
->children ()
763
763
->scalarNode ('type ' )
764
764
->validate ()
765
- ->ifNotInArray (array ( 'inclusive ' , 'exclusive ' ) )
765
+ ->ifNotInArray ([ 'inclusive ' , 'exclusive ' ] )
766
766
->thenInvalid ('The type of channels has to be inclusive or exclusive ' )
767
767
->end ()
768
768
->end ()
@@ -855,11 +855,11 @@ public function getConfigTreeBuilder()
855
855
->thenInvalid ('The token and room have to be specified to use a HipChatHandler ' )
856
856
->end ()
857
857
->validate ()
858
- ->ifTrue (function ($ v ) { return 'hipchat ' === $ v ['type ' ] && !in_array ($ v ['message_format ' ], array ( 'text ' , 'html ' ) ); })
858
+ ->ifTrue (function ($ v ) { return 'hipchat ' === $ v ['type ' ] && !in_array ($ v ['message_format ' ], [ 'text ' , 'html ' ] ); })
859
859
->thenInvalid ('The message_format has to be "text" or "html" in a HipChatHandler ' )
860
860
->end ()
861
861
->validate ()
862
- ->ifTrue (function ($ v ) { return 'hipchat ' === $ v ['type ' ] && null !== $ v ['api_version ' ] && !in_array ($ v ['api_version ' ], array ( 'v1 ' , 'v2 ' ) , true ); })
862
+ ->ifTrue (function ($ v ) { return 'hipchat ' === $ v ['type ' ] && null !== $ v ['api_version ' ] && !in_array ($ v ['api_version ' ], [ 'v1 ' , 'v2 ' ] , true ); })
863
863
->thenInvalid ('The api_version has to be "v1" or "v2" in a HipChatHandler ' )
864
864
->end ()
865
865
->validate ()
@@ -938,25 +938,25 @@ public function getConfigTreeBuilder()
938
938
->ifTrue (function ($ v ) { return isset ($ v ['debug ' ]); })
939
939
->thenInvalid ('The "debug" name cannot be used as it is reserved for the handler of the profiler ' )
940
940
->end ()
941
- ->example (array (
942
- 'syslog ' => array (
941
+ ->example ([
942
+ 'syslog ' => [
943
943
'type ' => 'stream ' ,
944
944
'path ' => '/var/log/symfony.log ' ,
945
945
'level ' => 'ERROR ' ,
946
946
'bubble ' => 'false ' ,
947
947
'formatter ' => 'my_formatter ' ,
948
- ) ,
949
- 'main ' => array (
948
+ ] ,
949
+ 'main ' => [
950
950
'type ' => 'fingers_crossed ' ,
951
951
'action_level ' => 'WARNING ' ,
952
952
'buffer_size ' => 30 ,
953
953
'handler ' => 'custom ' ,
954
- ) ,
955
- 'custom ' => array (
954
+ ] ,
955
+ 'custom ' => [
956
956
'type ' => 'service ' ,
957
957
'id ' => 'my_handler ' ,
958
- )
959
- ) )
958
+ ]
959
+ ] )
960
960
->end ()
961
961
->end ()
962
962
;
0 commit comments