@@ -421,10 +421,10 @@ public function getConfigTreeBuilder()
421421 */
422422
423423 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 )] ;
425425 }
426426
427- return array ( 'code ' => $ value , 'urls ' => array ()) ;
427+ return [ 'code ' => $ value , 'urls ' => []] ;
428428 }, $ values );
429429 })
430430 ->end ()
@@ -481,7 +481,7 @@ public function getConfigTreeBuilder()
481481 ->canBeUnset ()
482482 ->beforeNormalization ()
483483 ->ifString ()
484- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
484+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
485485 ->end ()
486486 ->children ()
487487 ->scalarNode ('id ' )->end ()
@@ -500,7 +500,7 @@ public function getConfigTreeBuilder()
500500 ->canBeUnset ()
501501 ->beforeNormalization ()
502502 ->ifString ()
503- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
503+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
504504 ->end ()
505505 ->children ()
506506 ->scalarNode ('id ' )->end ()
@@ -528,7 +528,7 @@ public function getConfigTreeBuilder()
528528 ->canBeUnset ()
529529 ->beforeNormalization ()
530530 ->ifString ()
531- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
531+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
532532 ->end ()
533533 ->children ()
534534 ->scalarNode ('id ' )->end ()
@@ -552,7 +552,7 @@ public function getConfigTreeBuilder()
552552 ->canBeUnset ()
553553 ->beforeNormalization ()
554554 ->ifString ()
555- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
555+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
556556 ->end ()
557557 ->children ()
558558 ->scalarNode ('id ' )->end ()
@@ -573,7 +573,7 @@ public function getConfigTreeBuilder()
573573 ->canBeUnset ()
574574 ->beforeNormalization ()
575575 ->ifString ()
576- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
576+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
577577 ->end ()
578578 ->children ()
579579 ->scalarNode ('id ' )->end ()
@@ -600,7 +600,7 @@ public function getConfigTreeBuilder()
600600 ->prototype ('scalar ' )->end ()
601601 ->beforeNormalization ()
602602 ->ifString ()
603- ->then (function ($ v ) { return array ( $ v ) ; })
603+ ->then (function ($ v ) { return [ $ v ] ; })
604604 ->end ()
605605 ->end ()
606606 ->scalarNode ('subject ' )->end () // swift_mailer and native_mailer
@@ -614,7 +614,7 @@ public function getConfigTreeBuilder()
614614 ->canBeUnset ()
615615 ->beforeNormalization ()
616616 ->ifString ()
617- ->then (function ($ v ) { return array ( 'id ' => $ v) ; })
617+ ->then (function ($ v ) { return [ 'id ' => $ v] ; })
618618 ->end ()
619619 ->children ()
620620 ->scalarNode ('id ' )->isRequired ()->end ()
@@ -660,8 +660,8 @@ public function getConfigTreeBuilder()
660660 ->beforeNormalization ()
661661 ->ifArray ()
662662 ->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 ' ] ;
665665 // allow numeric indexed array with ascendning verbosity and lowercase names of the constants
666666 foreach ($ v as $ verbosity => $ level ) {
667667 if (is_int ($ verbosity ) && isset ($ verbosities [$ verbosity ])) {
@@ -683,7 +683,7 @@ public function getConfigTreeBuilder()
683683 ->end ()
684684 ->validate ()
685685 ->always (function ($ v ) {
686- $ map = array () ;
686+ $ map = [] ;
687687 foreach ($ v as $ verbosity => $ level ) {
688688 $ verbosityConstant = 'Symfony\Component\Console\Output\OutputInterface:: ' .$ verbosity ;
689689
@@ -718,11 +718,11 @@ public function getConfigTreeBuilder()
718718 ->canBeUnset ()
719719 ->beforeNormalization ()
720720 ->ifString ()
721- ->then (function ($ v ) { return array ( 'elements ' => array ( $ v )) ; })
721+ ->then (function ($ v ) { return [ 'elements ' => [ $ v ]] ; })
722722 ->end ()
723723 ->beforeNormalization ()
724724 ->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] ; })
726726 ->end ()
727727 ->validate ()
728728 ->ifTrue (function ($ v ) { return empty ($ v ); })
@@ -735,7 +735,7 @@ public function getConfigTreeBuilder()
735735 $ isExclusive = 'exclusive ' === $ v ['type ' ];
736736 }
737737
738- $ elements = array () ;
738+ $ elements = [] ;
739739 foreach ($ v ['elements ' ] as $ element ) {
740740 if (0 === strpos ($ element , '! ' )) {
741741 if (false === $ isExclusive ) {
@@ -756,13 +756,13 @@ public function getConfigTreeBuilder()
756756 return null ;
757757 }
758758
759- return array ( 'type ' => $ isExclusive ? 'exclusive ' : 'inclusive ' , 'elements ' => $ elements) ;
759+ return [ 'type ' => $ isExclusive ? 'exclusive ' : 'inclusive ' , 'elements ' => $ elements] ;
760760 })
761761 ->end ()
762762 ->children ()
763763 ->scalarNode ('type ' )
764764 ->validate ()
765- ->ifNotInArray (array ( 'inclusive ' , 'exclusive ' ) )
765+ ->ifNotInArray ([ 'inclusive ' , 'exclusive ' ] )
766766 ->thenInvalid ('The type of channels has to be inclusive or exclusive ' )
767767 ->end ()
768768 ->end ()
@@ -855,11 +855,11 @@ public function getConfigTreeBuilder()
855855 ->thenInvalid ('The token and room have to be specified to use a HipChatHandler ' )
856856 ->end ()
857857 ->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 ' ] ); })
859859 ->thenInvalid ('The message_format has to be "text" or "html" in a HipChatHandler ' )
860860 ->end ()
861861 ->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 ); })
863863 ->thenInvalid ('The api_version has to be "v1" or "v2" in a HipChatHandler ' )
864864 ->end ()
865865 ->validate ()
@@ -938,25 +938,25 @@ public function getConfigTreeBuilder()
938938 ->ifTrue (function ($ v ) { return isset ($ v ['debug ' ]); })
939939 ->thenInvalid ('The "debug" name cannot be used as it is reserved for the handler of the profiler ' )
940940 ->end ()
941- ->example (array (
942- 'syslog ' => array (
941+ ->example ([
942+ 'syslog ' => [
943943 'type ' => 'stream ' ,
944944 'path ' => '/var/log/symfony.log ' ,
945945 'level ' => 'ERROR ' ,
946946 'bubble ' => 'false ' ,
947947 'formatter ' => 'my_formatter ' ,
948- ) ,
949- 'main ' => array (
948+ ] ,
949+ 'main ' => [
950950 'type ' => 'fingers_crossed ' ,
951951 'action_level ' => 'WARNING ' ,
952952 'buffer_size ' => 30 ,
953953 'handler ' => 'custom ' ,
954- ) ,
955- 'custom ' => array (
954+ ] ,
955+ 'custom ' => [
956956 'type ' => 'service ' ,
957957 'id ' => 'my_handler ' ,
958- )
959- ) )
958+ ]
959+ ] )
960960 ->end ()
961961 ->end ()
962962 ;
0 commit comments