diff --git a/src/Helper/InflectsString.php b/src/Helper/InflectsString.php index f458620..243a8d6 100644 --- a/src/Helper/InflectsString.php +++ b/src/Helper/InflectsString.php @@ -53,7 +53,7 @@ public function toWords(string $string): string } /** - * Return width of string + * Return width of string. */ public function strwidth(string $string): int { @@ -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 { diff --git a/src/Output/Table.php b/src/Output/Table.php index ed4a872..41e6303 100644 --- a/src/Output/Table.php +++ b/src/Output/Table.php @@ -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 { diff --git a/tests/Output/TableTest.php b/tests/Output/TableTest.php index 51bc634..682d872 100644 --- a/tests/Output/TableTest.php +++ b/tests/Output/TableTest.php @@ -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);