Skip to content

Commit 3eca307

Browse files
committed
some update
1 parent 58a09ab commit 3eca307

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Utils/Helper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ public static function spliceKeyValue(array $data, array $opts = [])
338338
'sepChar' => ' ', // e.g ' | ' OUT: key | value
339339
'keyStyle' => '', // e.g 'info','comment'
340340
'valStyle' => '', // e.g 'info','comment'
341+
'keyMinWidth' => 8,
341342
'keyMaxWidth' => null, // if not set, will automatic calculation
342343
'ucFirst' => true, // upper first char
343344
], $opts);
@@ -346,6 +347,11 @@ public static function spliceKeyValue(array $data, array $opts = [])
346347
$opts['keyMaxWidth'] = self::getKeyMaxWidth($data);
347348
}
348349

350+
// compare
351+
if ((int)$opts['keyMinWidth'] > $opts['keyMaxWidth']) {
352+
$opts['keyMaxWidth'] = $opts['keyMinWidth'];
353+
}
354+
349355
$keyStyle = trim($opts['keyStyle']);
350356

351357
foreach ($data as $key => $value) {

src/Utils/Show.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ public static function aList($data, $title = null, array $opts = [])
330330
$opts = array_merge([
331331
'leftChar' => ' ',
332332
'keyStyle' => 'info',
333+
'keyMinWidth' => 8,
333334
'titleStyle' => 'comment',
334335
'returned' => false,
335336
], $opts);

0 commit comments

Comments
 (0)