@@ -32,20 +32,20 @@ abstract class Descriptor implements DescriptorInterface
3232 /** @var OutputStyle */
3333 protected $ output ;
3434 protected $ type ;
35- protected $ ownOptions = array () ;
36- protected $ overriddenOptions = array () ;
37- protected $ parentOptions = array () ;
38- protected $ extensionOptions = array () ;
39- protected $ requiredOptions = array () ;
40- protected $ parents = array () ;
41- protected $ extensions = array () ;
35+ protected $ ownOptions = [] ;
36+ protected $ overriddenOptions = [] ;
37+ protected $ parentOptions = [] ;
38+ protected $ extensionOptions = [] ;
39+ protected $ requiredOptions = [] ;
40+ protected $ parents = [] ;
41+ protected $ extensions = [] ;
4242
4343 /**
4444 * {@inheritdoc}
4545 */
46- public function describe (OutputInterface $ output , $ object , array $ options = array () )
46+ public function describe (OutputInterface $ output , $ object , array $ options = [] )
4747 {
48- $ this ->output = $ output instanceof OutputStyle ? $ output : new SymfonyStyle (new ArrayInput (array () ), $ output );
48+ $ this ->output = $ output instanceof OutputStyle ? $ output : new SymfonyStyle (new ArrayInput ([] ), $ output );
4949
5050 switch (true ) {
5151 case null === $ object :
@@ -64,14 +64,14 @@ public function describe(OutputInterface $output, $object, array $options = arra
6464
6565 abstract protected function describeDefaults (array $ options );
6666
67- abstract protected function describeResolvedFormType (ResolvedFormTypeInterface $ resolvedFormType , array $ options = array () );
67+ abstract protected function describeResolvedFormType (ResolvedFormTypeInterface $ resolvedFormType , array $ options = [] );
6868
6969 abstract protected function describeOption (OptionsResolver $ optionsResolver , array $ options );
7070
7171 protected function collectOptions (ResolvedFormTypeInterface $ type )
7272 {
73- $ this ->parents = array () ;
74- $ this ->extensions = array () ;
73+ $ this ->parents = [] ;
74+ $ this ->extensions = [] ;
7575
7676 if (null !== $ type ->getParent ()) {
7777 $ optionsResolver = clone $ this ->getParentOptionsResolver ($ type ->getParent ());
@@ -83,15 +83,15 @@ protected function collectOptions(ResolvedFormTypeInterface $type)
8383 $ this ->ownOptions = array_diff ($ ownOptionsResolver ->getDefinedOptions (), $ optionsResolver ->getDefinedOptions ());
8484 $ overriddenOptions = array_intersect (array_merge ($ ownOptionsResolver ->getDefinedOptions (), $ ownOptionsResolver ->getUndefinedOptions ()), $ optionsResolver ->getDefinedOptions ());
8585
86- $ this ->parentOptions = array () ;
86+ $ this ->parentOptions = [] ;
8787 foreach ($ this ->parents as $ class => $ parentOptions ) {
8888 $ this ->overriddenOptions [$ class ] = array_intersect ($ overriddenOptions , $ parentOptions );
8989 $ this ->parentOptions [$ class ] = array_diff ($ parentOptions , $ overriddenOptions );
9090 }
9191
9292 $ type ->getInnerType ()->configureOptions ($ optionsResolver );
9393 $ this ->collectTypeExtensionsOptions ($ type , $ optionsResolver );
94- $ this ->extensionOptions = array () ;
94+ $ this ->extensionOptions = [] ;
9595 foreach ($ this ->extensions as $ class => $ extensionOptions ) {
9696 $ this ->overriddenOptions [$ class ] = array_intersect ($ overriddenOptions , $ extensionOptions );
9797 $ this ->extensionOptions [$ class ] = array_diff ($ extensionOptions , $ overriddenOptions );
@@ -108,21 +108,21 @@ protected function collectOptions(ResolvedFormTypeInterface $type)
108108
109109 protected function getOptionDefinition (OptionsResolver $ optionsResolver , $ option )
110110 {
111- $ definition = array (
111+ $ definition = [
112112 'required ' => $ optionsResolver ->isRequired ($ option ),
113113 'deprecated ' => $ optionsResolver ->isDeprecated ($ option ),
114- ) ;
114+ ] ;
115115
116116 $ introspector = new OptionsResolverIntrospector ($ optionsResolver );
117117
118- $ map = array (
118+ $ map = [
119119 'default ' => 'getDefault ' ,
120120 'lazy ' => 'getLazyClosures ' ,
121121 'allowedTypes ' => 'getAllowedTypes ' ,
122122 'allowedValues ' => 'getAllowedValues ' ,
123123 'normalizer ' => 'getNormalizer ' ,
124124 'deprecationMessage ' => 'getDeprecationMessage ' ,
125- ) ;
125+ ] ;
126126
127127 foreach ($ map as $ key => $ method ) {
128128 try {
@@ -133,15 +133,15 @@ protected function getOptionDefinition(OptionsResolver $optionsResolver, $option
133133 }
134134
135135 if (isset ($ definition ['deprecationMessage ' ]) && \is_string ($ definition ['deprecationMessage ' ])) {
136- $ definition ['deprecationMessage ' ] = strtr ($ definition ['deprecationMessage ' ], array ( '%name% ' => $ option) );
136+ $ definition ['deprecationMessage ' ] = strtr ($ definition ['deprecationMessage ' ], [ '%name% ' => $ option] );
137137 }
138138
139139 return $ definition ;
140140 }
141141
142142 protected function filterOptionsByDeprecated (ResolvedFormTypeInterface $ type )
143143 {
144- $ deprecatedOptions = array () ;
144+ $ deprecatedOptions = [] ;
145145 $ resolver = $ type ->getOptionsResolver ();
146146 foreach ($ resolver ->getDefinedOptions () as $ option ) {
147147 if ($ resolver ->isDeprecated ($ option )) {
@@ -169,7 +169,7 @@ protected function filterOptionsByDeprecated(ResolvedFormTypeInterface $type)
169169
170170 private function getParentOptionsResolver (ResolvedFormTypeInterface $ type )
171171 {
172- $ this ->parents [$ class = \get_class ($ type ->getInnerType ())] = array () ;
172+ $ this ->parents [$ class = \get_class ($ type ->getInnerType ())] = [] ;
173173
174174 if (null !== $ type ->getParent ()) {
175175 $ optionsResolver = clone $ this ->getParentOptionsResolver ($ type ->getParent ());
0 commit comments