Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Helper/InflectsString.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function toWords(string $string): string
}

/**
* Return width of string
* Return width of string.
*/
public function strwidth(string $string): int
{
Expand All @@ -65,7 +65,7 @@ public function strwidth(string $string): int
}

/**
* Get part of string
* Get part of string.
*/
public function substr(string $string, int $start, ?int $length = null): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Output/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function parseStyle(array|callable $style, $val, array $row, array $ta
}

/**
* Pad a multibyte string to a certain length with another multibyte string
* Pad a multibyte string to a certain length with another multibyte string.
*/
protected function strPad(string $string, int $length, string $pad_string = ' '): string
{
Expand Down
18 changes: 9 additions & 9 deletions tests/Output/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,24 +642,24 @@ public function test_render_with_html_like_tags_in_cell_content(): void

public function test_render_with_unicode_characters_in_cell_content(): void
{
if (! extension_loaded('mbstring')) {
if (!extension_loaded('mbstring')) {
$this->markTestSkipped('The mbstring extension is not installed. This test will faill without it');
}

$rows = [
['name' => 'François', 'greeting' => 'Bonjour'],
['name' => 'Jürgen', 'greeting' => 'Guten Tag'],
['name' => '北京', 'greeting' => '你好']
['name' => '北京', 'greeting' => '你好'],
];

$expectedOutput =
"+----------+-----------+" . PHP_EOL .
"| Name | Greeting |" . PHP_EOL .
"+----------+-----------+" . PHP_EOL .
"| François | Bonjour |" . PHP_EOL .
"| Jürgen | Guten Tag |" . PHP_EOL .
"| 北京 | 你好 |" . PHP_EOL .
"+----------+-----------+";
'+----------+-----------+' . PHP_EOL .
'| Name | Greeting |' . PHP_EOL .
'+----------+-----------+' . PHP_EOL .
'| François | Bonjour |' . PHP_EOL .
'| Jürgen | Guten Tag |' . PHP_EOL .
'| 北京 | 你好 |' . PHP_EOL .
'+----------+-----------+';

$result = $this->table->render($rows);

Expand Down