@@ -152,7 +152,7 @@ protected function processQuery(InputInterface $input, array $metricTypes, array
152152 if ($ input ->getOption ('latest ' )) {
153153 foreach (array_reverse ($ items ['data ' ]) as $ item ) {
154154 if (isset ($ item ['services ' ])) {
155- $ items ['data ' ] = array ( $ item) ;
155+ $ items ['data ' ] = [ $ item] ;
156156 break ;
157157 }
158158 }
@@ -173,7 +173,7 @@ protected function processQuery(InputInterface $input, array $metricTypes, array
173173 throw new \RuntimeException ('No data points were found in the metrics response. ' );
174174 }
175175
176- return array ( $ items , $ environment) ;
176+ return [ $ items , $ environment] ;
177177 }
178178
179179 /**
@@ -187,23 +187,23 @@ private function getServices(InputInterface $input, Environment $environment)
187187 $ deployment = $ this ->api ()->getCurrentDeployment ($ environment );
188188 $ allServices = array_merge ($ deployment ->webapps , $ deployment ->services , $ deployment ->workers );
189189 $ servicesInput = ArrayArgument::getOption ($ input , 'service ' );
190- $ selectedServiceNames = array () ;
190+ $ selectedServiceNames = [] ;
191191 if (!empty ($ servicesInput )) {
192- $ selectedServiceNames = Wildcard::select (array_merge (array_keys ($ allServices ), array ( 'router ' ) ), $ servicesInput );
192+ $ selectedServiceNames = Wildcard::select (array_merge (array_keys ($ allServices ), [ 'router ' ] ), $ servicesInput );
193193 if (!$ selectedServiceNames ) {
194194 $ this ->stdErr ->writeln ('No services were found matching the name(s): <error> ' . implode (', ' , $ servicesInput ) . '</error> ' );
195195
196196 throw new \RuntimeException ('No services were found matching the name(s): ' . implode (', ' , $ servicesInput ));
197197 }
198198 } elseif ($ typeInput = ArrayArgument::getOption ($ input , 'type ' )) {
199- $ byType = array () ;
199+ $ byType = [] ;
200200 foreach ($ allServices as $ name => $ service ) {
201201 $ type = $ service ->type ;
202202 list ($ prefix ) = explode (': ' , $ service ->type , 2 );
203203 $ byType [$ type ][] = $ name ;
204204 $ byType [$ prefix ][] = $ name ;
205205 }
206- $ selectedKeys = Wildcard::select (array_merge (array_keys ($ byType ), array ( 'router ' ) ), $ typeInput );
206+ $ selectedKeys = Wildcard::select (array_merge (array_keys ($ byType ), [ 'router ' ] ), $ typeInput );
207207 if (!$ selectedKeys ) {
208208 $ this ->stdErr ->writeln ('No services were found matching the type(s): <error> ' . implode (', ' , $ typeInput ) . '</error> ' );
209209
@@ -276,9 +276,9 @@ protected function buildRows(array $values, array $fieldMapping, Environment $en
276276 /** @var \Platformsh\Cli\Service\PropertyFormatter $formatter */
277277 $ formatter = $ this ->getService ('property_formatter ' );
278278 $ sortServices = $ this ->getSortedServices ($ environment );
279- $ serviceTypes = array () ;
279+ $ serviceTypes = [] ;
280280
281- $ rows = array () ;
281+ $ rows = [] ;
282282 $ lastCountPerTimestamp = 0 ;
283283 foreach ($ values ['data ' ] as $ point ) {
284284 $ timestamp = $ point ['timestamp ' ];
@@ -301,8 +301,8 @@ protected function buildRows(array $values, array $fieldMapping, Environment $en
301301 $ serviceTypes [$ service ] = $ this ->getServiceType ($ environment , $ service );
302302 }
303303
304- $ row = array () ;
305- $ row ['timestamp ' ] = new AdaptiveTableCell ($ formattedTimestamp , array ( 'wrap ' => false ) );
304+ $ row = [] ;
305+ $ row ['timestamp ' ] = new AdaptiveTableCell ($ formattedTimestamp , [ 'wrap ' => false ] );
306306 $ row ['service ' ] = $ service ;
307307 $ row ['type ' ] = $ formatter ->format ($ serviceTypes [$ service ], 'service_type ' );
308308 foreach ($ fieldMapping as $ field => $ fieldDefinition ) {
@@ -356,7 +356,7 @@ private function getSortedServices(Environment $environment)
356356 sort ($ appAndWorkerNames , SORT_NATURAL );
357357 $ serviceNames = array_keys ($ deployment ->services );
358358 sort ($ serviceNames , SORT_NATURAL );
359- $ nameOrder = array_flip (array_merge ($ appAndWorkerNames , $ serviceNames , array ( 'router ' ) ));
359+ $ nameOrder = array_flip (array_merge ($ appAndWorkerNames , $ serviceNames , [ 'router ' ] ));
360360 $ sortServices = function ($ a , $ b ) use ($ nameOrder ) {
361361 $ aPos = isset ($ nameOrder [$ a ]) ? $ nameOrder [$ a ] : 1000 ;
362362 $ bPos = isset ($ nameOrder [$ b ]) ? $ nameOrder [$ b ] : 1000 ;
0 commit comments