@@ -73,7 +73,7 @@ public function onExecAfter(int $exitCode, ?string $outputLevel = null): void
73
73
$ outputLevel ,
74
74
);
75
75
76
- $ this ->_ ("Exit Code is \"{$ exitCode }\"" , $ outputLevel );
76
+ $ this ->_ ("Exit Code is \"{$ exitCode }\"" , OutLvl:: DEBUG );
77
77
}
78
78
79
79
public function onExecException (\Exception $ exception ): void
@@ -235,16 +235,17 @@ protected function printMessage(
235
235
if ($ executePrint && $ printCallback !== null ) {
236
236
if ($ this ->isDisplayProfiling ()) {
237
237
$ profile = $ this ->getProfileInfo ();
238
+ $ oneKb = 1024 ;
238
239
239
- $ timeTotal = \number_format ($ profile ['time_total_ms ' ] / 1000 , 2 );
240
+ $ timeTotal = \str_pad ( \ number_format ($ profile ['time_total_ms ' ] / 1000 , 2 ), 5 , ' ' , \ STR_PAD_LEFT );
240
241
241
- $ timeDiff = \number_format ($ profile ['time_diff_ms ' ] / 1000 , 2 );
242
- $ timeDiff = $ timeDiff === '0.00 ' ? '<gray> - </gray> ' : "{ $ timeDiff} s " ;
242
+ $ timeDiff = \str_pad ( \ number_format ($ profile ['time_diff_ms ' ] / 1000 , 2 ), 5 , ' ' , \ STR_PAD_LEFT );
243
+ $ timeDiff = $ timeDiff === ' 0.00 ' ? '<gray> 0 </gray> ' : $ timeDiff ;
243
244
244
245
$ memoryDiff = FS ::format ($ profile ['memory_usage_diff ' ], 0 );
245
246
$ memoryDiff = \str_pad ($ memoryDiff , 6 , ' ' , \STR_PAD_LEFT );
246
- if ($ profile ['memory_usage_diff ' ] === 0 ) {
247
- $ memoryDiff = '<gray> ' . \str_pad (' 0 ' , 6 , ' ' , \STR_PAD_LEFT ) . '</gray> ' ;
247
+ if (\abs ( $ profile ['memory_usage_diff ' ]) < $ oneKb ) {
248
+ $ memoryDiff = '<gray> ' . \str_pad ($ memoryDiff , 6 , ' ' , \STR_PAD_LEFT ) . '</gray> ' ;
248
249
} else {
249
250
$ memoryDiff = $ profile ['memory_usage_diff ' ] > 0
250
251
? "<yellow> {$ memoryDiff }</yellow> "
@@ -260,25 +261,25 @@ protected function printMessage(
260
261
$ profilerData [] = $ timeTotal ;
261
262
$ profilerData [] = $ timeDiff ;
262
263
$ profilerData [] = $ memoryDiff ;
263
- $ profilerData [] = FS ::format ($ profile ['memory_usage ' ], 0 );
264
- $ profilerData [] = 'P: ' . FS ::format ($ profile ['memory_peak ' ], 0 );
264
+ $ profilerData [] = \str_pad ( FS ::format ($ profile ['memory_usage ' ], 0 ), 7 , ' ' , \ STR_PAD_LEFT );
265
+ $ profilerData [] = 'P: ' . FS ::format ($ profile ['memory_peak ' ], 0 );
265
266
} elseif ($ this ->showMessage (OutputInterface::VERBOSITY_VERY_VERBOSE )) {
266
267
$ profilerData [] = $ timeTotal ;
267
268
$ profilerData [] = $ timeDiff ;
268
269
$ profilerData [] = $ memoryDiff ;
269
- $ profilerData [] = FS ::format ($ profile ['memory_usage ' ], 0 );
270
+ $ profilerData [] = \str_pad ( FS ::format ($ profile ['memory_usage ' ], 0 ), 7 , ' ' , \ STR_PAD_LEFT );
270
271
} elseif ($ this ->showMessage (OutputInterface::VERBOSITY_VERBOSE )) {
271
272
$ profilerData [] = $ timeDiff ;
272
273
$ profilerData [] = $ memoryDiff ;
273
- $ profilerData [] = FS ::format ($ profile ['memory_usage ' ], 0 );
274
+ $ profilerData [] = \str_pad ( FS ::format ($ profile ['memory_usage ' ], 0 ), 7 , ' ' , \ STR_PAD_LEFT );
274
275
} else {
275
276
$ profilerData [] = $ timeDiff ;
276
277
$ profilerData [] = $ memoryDiff ;
277
278
}
278
279
}
279
280
280
281
$ profilePrefix .= '<green>[</green> '
281
- . \implode (' <green>|</green> ' , $ profilerData )
282
+ . \implode ('<green>|</green> ' , $ profilerData )
282
283
. '<green>]</green> ' ;
283
284
}
284
285
$ printCallback ($ profilePrefix );
0 commit comments