Skip to content

Commit

Permalink
Merge pull request #119 from adhocore/analysis-MPm3GO
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
adhocore authored Nov 29, 2024
2 parents f96cc05 + 70616bd commit bacbbda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
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

0 comments on commit bacbbda

Please sign in to comment.