Skip to content

Commit da6313d

Browse files
kenjissamsonasik
andauthored
refactor: use arrow function
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
1 parent 3b48aae commit da6313d

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

system/Commands/Database/ShowTableInfo.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,10 @@ private function makeTableRows(string $tableName, int $limitRows, int $limitFiel
205205

206206
foreach ($rows as $row) {
207207
$row = array_map(
208-
static function ($item) use ($limitFieldValue) {
209-
if (mb_strlen((string) $item) > $limitFieldValue) {
210-
return mb_substr((string) $item, 0, $limitFieldValue) . '...';
211-
}
212-
213-
return $item;
214-
},
208+
static fn ($item): string => mb_strlen((string) $item) > $limitFieldValue)
209+
? mb_substr((string) $item, 0, $limitFieldValue) . '...'
210+
: $item
211+
,
215212
$row
216213
);
217214
$this->tbody[] = $row;

0 commit comments

Comments
 (0)