diff --git a/src/Helper/InflectsString.php b/src/Helper/InflectsString.php index f458620ceac16e12f56e2ed3aaab15d33bc689aa..243a8d6cf37307078100cc053978f4ef194009c0 100644 --- a/src/Helper/InflectsString.php +++ b/src/Helper/InflectsString.php @@ -53,7 +53,7 @@ trait InflectsString } /** - * Return width of string + * Return width of string. */ public function strwidth(string $string): int { @@ -65,7 +65,7 @@ trait InflectsString } /** - * 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 ed4a8729b101870aa7e59820b4ecaf48cb41409e..41e6303c58a14008b490c6ffa80bf032a7c07c5c 100644 --- a/src/Output/Table.php +++ b/src/Output/Table.php @@ -176,7 +176,7 @@ class Table } /** - * 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 51bc6346a8a13e92d199720c969e287be5c81cce..682d872bda5898c8afc75430737ce00ac737032a 100644 --- a/tests/Output/TableTest.php +++ b/tests/Output/TableTest.php @@ -642,24 +642,24 @@ class TableTest extends CliTestCase 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);