@@ -29,49 +29,49 @@ class JsonDescriptor extends Descriptor
2929 /**
3030 * {@inheritdoc}
3131 */
32- protected function describeInputArgument (InputArgument $ argument , array $ options = array () )
32+ protected function describeInputArgument (InputArgument $ argument , array $ options = [] )
3333 {
3434 $ this ->writeData ($ this ->getInputArgumentData ($ argument ), $ options );
3535 }
3636
3737 /**
3838 * {@inheritdoc}
3939 */
40- protected function describeInputOption (InputOption $ option , array $ options = array () )
40+ protected function describeInputOption (InputOption $ option , array $ options = [] )
4141 {
4242 $ this ->writeData ($ this ->getInputOptionData ($ option ), $ options );
4343 }
4444
4545 /**
4646 * {@inheritdoc}
4747 */
48- protected function describeInputDefinition (InputDefinition $ definition , array $ options = array () )
48+ protected function describeInputDefinition (InputDefinition $ definition , array $ options = [] )
4949 {
5050 $ this ->writeData ($ this ->getInputDefinitionData ($ definition ), $ options );
5151 }
5252
5353 /**
5454 * {@inheritdoc}
5555 */
56- protected function describeCommand (Command $ command , array $ options = array () )
56+ protected function describeCommand (Command $ command , array $ options = [] )
5757 {
5858 $ this ->writeData ($ this ->getCommandData ($ command ), $ options );
5959 }
6060
6161 /**
6262 * {@inheritdoc}
6363 */
64- protected function describeApplication (Application $ application , array $ options = array () )
64+ protected function describeApplication (Application $ application , array $ options = [] )
6565 {
6666 $ describedNamespace = isset ($ options ['namespace ' ]) ? $ options ['namespace ' ] : null ;
6767 $ description = new ApplicationDescription ($ application , $ describedNamespace , true );
68- $ commands = array () ;
68+ $ commands = [] ;
6969
7070 foreach ($ description ->getCommands () as $ command ) {
7171 $ commands [] = $ this ->getCommandData ($ command );
7272 }
7373
74- $ data = array () ;
74+ $ data = [] ;
7575 if ('UNKNOWN ' !== $ application ->getName ()) {
7676 $ data ['application ' ]['name ' ] = $ application ->getName ();
7777 if ('UNKNOWN ' !== $ application ->getVersion ()) {
@@ -105,47 +105,47 @@ private function writeData(array $data, array $options)
105105 */
106106 private function getInputArgumentData (InputArgument $ argument )
107107 {
108- return array (
108+ return [
109109 'name ' => $ argument ->getName (),
110110 'is_required ' => $ argument ->isRequired (),
111111 'is_array ' => $ argument ->isArray (),
112112 'description ' => preg_replace ('/\s*[\r\n]\s*/ ' , ' ' , $ argument ->getDescription ()),
113113 'default ' => INF === $ argument ->getDefault () ? 'INF ' : $ argument ->getDefault (),
114- ) ;
114+ ] ;
115115 }
116116
117117 /**
118118 * @return array
119119 */
120120 private function getInputOptionData (InputOption $ option )
121121 {
122- return array (
122+ return [
123123 'name ' => '-- ' .$ option ->getName (),
124124 'shortcut ' => $ option ->getShortcut () ? '- ' .str_replace ('| ' , '|- ' , $ option ->getShortcut ()) : '' ,
125125 'accept_value ' => $ option ->acceptValue (),
126126 'is_value_required ' => $ option ->isValueRequired (),
127127 'is_multiple ' => $ option ->isArray (),
128128 'description ' => preg_replace ('/\s*[\r\n]\s*/ ' , ' ' , $ option ->getDescription ()),
129129 'default ' => INF === $ option ->getDefault () ? 'INF ' : $ option ->getDefault (),
130- ) ;
130+ ] ;
131131 }
132132
133133 /**
134134 * @return array
135135 */
136136 private function getInputDefinitionData (InputDefinition $ definition )
137137 {
138- $ inputArguments = array () ;
138+ $ inputArguments = [] ;
139139 foreach ($ definition ->getArguments () as $ name => $ argument ) {
140140 $ inputArguments [$ name ] = $ this ->getInputArgumentData ($ argument );
141141 }
142142
143- $ inputOptions = array () ;
143+ $ inputOptions = [] ;
144144 foreach ($ definition ->getOptions () as $ name => $ option ) {
145145 $ inputOptions [$ name ] = $ this ->getInputOptionData ($ option );
146146 }
147147
148- return array ( 'arguments ' => $ inputArguments , 'options ' => $ inputOptions) ;
148+ return [ 'arguments ' => $ inputArguments , 'options ' => $ inputOptions] ;
149149 }
150150
151151 /**
@@ -156,13 +156,13 @@ private function getCommandData(Command $command)
156156 $ command ->getSynopsis ();
157157 $ command ->mergeApplicationDefinition (false );
158158
159- return array (
159+ return [
160160 'name ' => $ command ->getName (),
161- 'usage ' => array_merge (array ( $ command ->getSynopsis ()) , $ command ->getUsages (), $ command ->getAliases ()),
161+ 'usage ' => array_merge ([ $ command ->getSynopsis ()] , $ command ->getUsages (), $ command ->getAliases ()),
162162 'description ' => $ command ->getDescription (),
163163 'help ' => $ command ->getProcessedHelp (),
164164 'definition ' => $ this ->getInputDefinitionData ($ command ->getNativeDefinition ()),
165165 'hidden ' => $ command ->isHidden (),
166- ) ;
166+ ] ;
167167 }
168168}
0 commit comments